Hi Chris,

Jena functions as a triple rather than quad store by default, so it will query 
over the default graph only "by default" . If you want to execute a query 
againts all graphs in Virtuoso, you must call the VirtGraph method 
"setReadFromAllGraphs(true)” to scope it to all graphs as below:

        VirtGraph vg = new VirtGraph ("mygraph", 
"jdbc:virtuoso://localhost:1111", "dba", "dba");
        vg.setReadFromAllGraphs(true);
        QueryExecution vqe = VirtuosoQueryExecutionFactory.create ("SELECT * 
WHERE { GRAPH ?graph { ?s ?p ?o } } limit 100", vg);

The methods is documented in the Virtuoso Jena Provider Java docs at:

        http://docs.openlinksw.com/jena2/ <http://docs.openlinksw.com/jena2/>

Best Regards
Hugh Williams
Professional Services
OpenLink Software, Inc.      //              http://www.openlinksw.com/
Weblog   -- http://www.openlinksw.com/blogs/
LinkedIn -- http://www.linkedin.com/company/openlink-software/
Twitter  -- http://twitter.com/OpenLink
Google+  -- http://plus.google.com/100570109519069333827/
Facebook -- http://www.facebook.com/OpenLinkSoftware
Universal Data Access, Integration, and Management Technology Providers

> On 12 Mar 2015, at 10:21, Chris Rimmer <chris.rim...@67bricks.com> wrote:
> 
> I have a workaround. It seems if I set the names of the graphs using a VALUES 
> clause like so, it works:
> 
> SELECT ?s ?p ?o
> WHERE {
>     VALUES (?to ?from) {(<first-graph-uri> <second-graph-uri>)}
>     GRAPH ?from {
>         ?s rdf:type skos:Concept .
>         ?s ?p ?o .
>     }
>     MINUS {
>         GRAPH ?to {
>             ?s ?p ?o .
>         }
>     }
> }
> 
> Chris
> 
> On 12 March 2015 at 09:27, Chris Rimmer <chris.rim...@67bricks.com 
> <mailto:chris.rim...@67bricks.com>> wrote:
> Hugh,
> 
> I'm using the Virtuoso Jena Provider. 
> The version of Virtuoso is 07.10.3211, the Virtuoso Jena Provider jar is 
> version 1.10, the JDBC jar is version 3.76 and the version of Jena itself is 
> 2.12.1.
> 
> Chris
> 
> On 11 March 2015 at 17:27, Hugh Williams <hwilli...@openlinksw.com 
> <mailto:hwilli...@openlinksw.com>> wrote:
> Hi Chris,
> 
> How are you connecting Jena to Virtuoso, is this via is http client to the 
> Virtuoso SPARQL endpoint or via the Virtuoso Jena Provider ? Also confirm the 
> version of Virtuoso being used and if using the Jena Provider the version of 
> it …
> 
> Best Regards
> Hugh Williams
> Professional Services
> OpenLink Software, Inc.      //              http://www.openlinksw.com/ 
> <http://www.openlinksw.com/>
> Weblog   -- http://www.openlinksw.com/blogs/ 
> <http://www.openlinksw.com/blogs/>
> LinkedIn -- http://www.linkedin.com/company/openlink-software/ 
> <http://www.linkedin.com/company/openlink-software/>
> Twitter  -- http://twitter.com/OpenLink <http://twitter.com/OpenLink>
> Google+  -- http://plus.google.com/100570109519069333827/ 
> <http://plus.google.com/100570109519069333827/>
> Facebook -- http://www.facebook.com/OpenLinkSoftware 
> <http://www.facebook.com/OpenLinkSoftware>
> Universal Data Access, Integration, and Management Technology Providers
> 
>> On 11 Mar 2015, at 16:23, Chris Rimmer <chris.rim...@67bricks.com 
>> <mailto:chris.rim...@67bricks.com>> wrote:
>> 
>> I am running the following query to give me a list of triples which exist in 
>> one graph but do not exist in another:
>> 
>> SELECT ?s ?p ?o
>> WHERE {
>>     GRAPH ?from {
>>         ?s rdf:type skos:Concept .
>>         ?s ?p ?o .
>>     }
>>     MINUS {
>>         GRAPH ?to {
>>             ?s ?p ?o .
>>         }
>>     }
>> }
>> 
>> This works as expected when run via the Conductor SPARQL interface (with 
>> ?from and ?to bound correctly) and also works via Jena operating against an 
>> in-memory TDB datastore. But when run via Jena against Virtuoso I get no 
>> results at all.
>> 
>> Any clue as to what is going wrong here?
>> 
>> Thanks
>> 
>> Chris
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming The Go Parallel Website, 
>> sponsored
>> by Intel and developed in partnership with Slashdot Media, is your hub for 
>> all
>> things parallel software development, from weekly thought leadership blogs to
>> news, videos, case studies, tutorials and more. Take a look and join the 
>> conversation now. 
>> http://goparallel.sourceforge.net/_______________________________________________
>>  
>> <http://goparallel.sourceforge.net/_______________________________________________>
>> Virtuoso-users mailing list
>> Virtuoso-users@lists.sourceforge.net 
>> <mailto:Virtuoso-users@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/virtuoso-users 
>> <https://lists.sourceforge.net/lists/listinfo/virtuoso-users>
> 
> 
> 
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the 
> conversation now. 
> http://goparallel.sourceforge.net/_______________________________________________
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to