On 02/07/13 00:34, Lewis John Mcgibbney wrote:
Hi,
I am slightly confused as to what API I should be using to do the following.
I have triples data (from an Any23 pipeline) in a Java
ByteArrayOutputStream.
I want to write them in to a standalone Fuseki server which is already
running and we can assume will always be running in my data centre. I would
like to run my code and just push triples in to Fuseki for the time being.
Another application plays with querying and getting them out... which I am
working on elsewhere (sigh ;))
Should I be using the Fuseki API [0] for this? I lodged JENA-483 as I
intend to document everything I discover over the next while and put it in
to trunk.

Great - thanks.


How do I get hold of an instance of a server which is already running?
I never need to call fuseki.init(), or use DatasetAccessorFactory or
anything like that, all I want to do is push data through my pipeline to a
running Fuseki instance.

Thank you for any directions.
Best

[0] http://jena.apache.org/documentation/javadoc/fuseki/index.html


Hi Lewis - you want to push a bytestream?  And you know the content type?

Fuseki is a server - most people run it like you are as a complete server. The "API" is HTTP :-) Or the API is SPARQL (protocol for query/update and also GSP (Graph SPARQL Store Protocol).

There are some helper classes that might help but they going to end up pulling in Jena (and Any23 is sesame-based). So for example, DatasetAccessor is a graph put/get interface to a Dataset with GSP-like operations.

The instance is the URL for the server endpoint.

What you want to do is POST the bytes (content-type) to the GSP endpoint, usually http://HOST:3030/dataset/data?default or http://HOST:3030/dataset/data?graph=encodedURI.

You can do that with whatever networking code you like so you don't need to pull in Jena just for that.

There is some helper code (mostly Jena independent) in HttpOp.execHttpPost which is a wrapping up of use of Apache HTTP Client.

Actually, HttpOp's main role is to centralize Jena's use of HTTP for common logging and common functionality.

As that comes down to about 20 lines of Apache HTTP Client driver code, you're probably better using it as an example.

Or use plain old java.net - no extra dependencies.

        Andy

http://jena.apache.org/documentation/serving_data/index.html

Reply via email to