On 14/10/11 09:38, Dave Reynolds wrote:
On Thu, 2011-10-13 at 09:36 -0430, Israel wrote:
Hi there,

....
Here's the chunk of code there I try to do this:

String construct = "CONSTRUCT { ?s ?p ?o } FROM<http://thesis.com#>  WHERE {
?s ?p ?o }";

I'm not sure how Virtuoso handles named graphs but the correct way to pick one graph from many in SPARQL is to use GRAPH:

CONSTRUCT { ?s ?p ?o }
WHERE {
   GRAPH <http://thesis.com#> { ?s ?p ?o }
}



VirtuosoQueryExecution vqe2 =
VirtuosoQueryExecutionFactory.create(construct, graph);

If graph is a model, then what Virtuoso should do is to make that graph the default graph for the query in which case:

CONSTRUCT { ?s ?p ?o }
WHERE { ?s ?p ?o }

should work.  Otherwise, please report it to OpenLink.

A dataset, not a model would be better, then use the GRAPH form.


The above is all Virtuso-specific so you'll need to ask them for support
for that.


Dave

An alternative is to treat the Virtuoso server as a SPARQL endpoint and use QueryExecutionFactory.sparqService

        Andy

Reply via email to