Andy Seaborne
2016-12-21 16:07:59 UTC
szQuery = "" + " PREFIX dc: <http://purl.org/dc/elements/1.1/>" + "
PREFIX foaf: <http://xmlns.com/foaf/0.1/>" + " SELECT ?graph ?who ?mbox"
+ " FROM NAMED <http://example.org/alice>" + " FROM NAMED
<http://example.org/bob>" + " WHERE " + " { \n" + " ?graph dc:publisher
?who . " + " GRAPH ?graph { ?x foaf:mbox ?mbox . } " + " }";
Take out the FROM NAMED.PREFIX foaf: <http://xmlns.com/foaf/0.1/>" + " SELECT ?graph ?who ?mbox"
+ " FROM NAMED <http://example.org/alice>" + " FROM NAMED
<http://example.org/bob>" + " WHERE " + " { \n" + " ?graph dc:publisher
?who . " + " GRAPH ?graph { ?x foaf:mbox ?mbox . } " + " }";
Adding FROM or FROM NAMED creates a view of the original data - in this
case with just 2 named graphs. You don't want a view - you want the
real thing.
Andy
to have more than two in total, and only search on some of them.
1/ Use FROM <urn:x-arq:DefaultGraph> to include the default graph in
the view dataset.
2/ Make a union model and query that.
3/ Use GRAPH <g> in a query (when it is just one graph)
4/ Use GRAPH ?g {} FILTER( ... ?g ....) in a query (when it is just one
graph)
(They are not exactly equivalent. )
The details of the usage will suggest a particular approach as will the
total volume of data.
Andy
See you
Jorge
Jorge