On 16/01/12 19:43, Luigi Selmi wrote:

Hi,
I would like to access a default graph from a java application
that is stored in a dataset inside  Jena TDB from a remote machine and
then use the model in the application. It seems that the only way is to
use Joseki or Fuseki and make a SPARQL query using the
QueryExecutionFactory class

QueryExecution qexec = QueryExecutionFactory.sparqlService(service, query);

but how can I get the model of the default graph from qexec ?

Btw with arq2.8.8 the query seems to be sent malformed  to Fuseki. My app sends

"SELECT * WHERE { ?s ?p ?o }"

and Fuseki gets

INFO
  [qtp14696971-15] (SPARQL_ServletBase.java:117) - [1] GET
http://localhost:3030/datadir?query=SELECT++*%0AWHERE%0A++%7B+%3Fs+%3Fp+%3Fo+%7D%0A
  INFO [qtp14696971-15] (SPARQL_ServletBase.java:154) - [1] 400 Neither 
?default and ?graph in request



Thanks


Luigi                                   

Luigi,

Just to check my understanding - you want to read the whole of the default graph out of a remote dataset in Fuseki.

The "SPARQL 1.1 Graph Store Protocol" is you're friend here.

Just do.

String str = "http://localhost:3030/datadir/data?default"; ;
Model m = FileManager.get().loadModel(str) ;

Note the /datadir/data -- ../data is the service for the graph store protocol.

> INFO
>   [qtp14696971-15] (SPARQL_ServletBase.java:117) - [1] GET
> http://localhost:3030/datadir?query=SELECT++*%0AWHERE%0A++%7B+%3Fs+%3Fp+%3Fo+%7D%0A > INFO [qtp14696971-15] (SPARQL_ServletBase.java:154) - [1] 400 Neither ?default and ?graph in request

http://localhost:3030/datadir isn't the SPARQL endpoint.

Each dataset has a number of services : usually called

http://localhost:3030/datadir/sparql    SPARQL Query
http://localhost:3030/datadir/data      graph store protocol
http://localhost:3030/datadir/update    SPARQL Update

but config.ttl can change those.

So you want

http://localhost:3030/datadir/sparql?query=....

        Andy

Reply via email to