You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Adrian Gschwend <ml...@netlabs.org> on 2015/11/10 20:33:09 UTC

Script creation of a new database in Fuseki 2.3

Hi,

I can't seem to figure out how I can create a new (persistent) database
via scripts in Fuseki 2.3, documentation didn't help.

I need this for Travis so everything I do needs to be fully automated.
Any hints on what I would have to execute towards the Fuseki endpoint?

regards

Adrian

Re: Script creation of a new database in Fuseki 2.3

Posted by Adrian Gschwend <ml...@netlabs.org>.
On 10.11.15 20:37, A. Soroka wrote:

Hi,

> That’s Java, but it should be pretty easy to translate. The important
> point is to realize that the administrative forms are at the
> “{your-fuseki-instance}/$” url. In your case you want the
> “{your-fuseki-instance}/$/datasets” section, to which you can POST
> your request for a new dataset.

thanks that helped, got it work like this:

curl -u youruser:yourpassword --data "dbType=tdb&dbName=foobar"
http://localhost:3030/$/datasets

regards

Adrian

Re: Script creation of a new database in Fuseki 2.3

Posted by Adrian Gschwend <ml...@netlabs.org>.
On 10.11.15 23:09, Andy Seaborne wrote:

Hi Andy,

> http://jena.apache.org/documentation/fuseki2/fuseki-server-protocol.html
> 
> Suggestion for improvement?

That's exactly what I was looking for thanks. Documents what I didn't
see in the index -> PEBCAK :-)

thanks

adrian

Re: Script creation of a new database in Fuseki 2.3

Posted by Andy Seaborne <an...@apache.org>.
On 10/11/15 19:37, A. Soroka wrote:
> You can do something like this:
>
> // find our Fuseki instance
> final String fusekiUrl = "http://localhost:" + PORT + "/jena-fuseki-war/";
> // build a dataset to work with
> final String datasetName = "testNormalOperation";
> final Params params = new Params();
> // we’re using an in-memory dataset here, but you could use a TDB-backed dataset instead
> params.addParam("dbType", "mem");
> params.addParam("dbName", datasetName);
> execHttpPostForm(fusekiUrl + "$/datasets", params);
>
> That’s Java, but it should be pretty easy to translate. The important point is to realize that the administrative forms are at the “{your-fuseki-instance}/$” url. In your case you want the  “{your-fuseki-instance}/$/datasets” section, to which you can POST your request for a new dataset.
>
> ---
> A. Soroka
> The University of Virginia Library
>
>> On Nov 10, 2015, at 2:33 PM, Adrian Gschwend <ml...@netlabs.org> wrote:
>>
>> Hi,
>>
>> I can't seem to figure out how I can create a new (persistent) database
>> via scripts in Fuseki 2.3, documentation didn't help.

http://jena.apache.org/documentation/fuseki2/fuseki-server-protocol.html

Suggestion for improvement?

>>
>> I need this for Travis so everything I do needs to be fully automated.
>> Any hints on what I would have to execute towards the Fuseki endpoint?
>>
>> regards
>>
>> Adrian
>


Re: Script creation of a new database in Fuseki 2.3

Posted by "A. Soroka" <aj...@virginia.edu>.
You can do something like this:

// find our Fuseki instance
final String fusekiUrl = "http://localhost:" + PORT + "/jena-fuseki-war/";
// build a dataset to work with
final String datasetName = "testNormalOperation";
final Params params = new Params();
// we’re using an in-memory dataset here, but you could use a TDB-backed dataset instead
params.addParam("dbType", "mem");
params.addParam("dbName", datasetName);
execHttpPostForm(fusekiUrl + "$/datasets", params);

That’s Java, but it should be pretty easy to translate. The important point is to realize that the administrative forms are at the “{your-fuseki-instance}/$” url. In your case you want the  “{your-fuseki-instance}/$/datasets” section, to which you can POST your request for a new dataset.

---
A. Soroka
The University of Virginia Library

> On Nov 10, 2015, at 2:33 PM, Adrian Gschwend <ml...@netlabs.org> wrote:
> 
> Hi,
> 
> I can't seem to figure out how I can create a new (persistent) database
> via scripts in Fuseki 2.3, documentation didn't help.
> 
> I need this for Travis so everything I do needs to be fully automated.
> Any hints on what I would have to execute towards the Fuseki endpoint?
> 
> regards
> 
> Adrian