[Mulgara-general] Mulgara SPARQL default dataset
Paul Gearon
gearon at ieee.org
Tue Dec 30 07:53:42 UTC 2008
On Tue, Dec 30, 2008 at 3:57 AM, David Bigwood <dbigwood at metatomix.com> wrote:
>
> Thank you for the feedback Paul.
>
> >From my understanding of your reply:
>
> 1. The default dataset as used by SPARQL is always empty and will return no
> rows unless a named graph is referenced either by the FROM or GRAPH usage.
Not quite. That is the case if you don't specify a default dataset on
the connection either. SPARQL requires that if no graphs are specified
with FROM or GRAPH clauses, then we should use a default as specified
by the connection. If none is specified in the connection, then the
default is up to us. We opted for a null graph.
The default graph on a connection can be specified in several ways,
depending on how you are using Mulgara:
1. In the WebUI, put the graph name in the "Graph" text field.
2. With the SPARQL servlet (http://hostname:8080/sparql/) specify the
graph name with a "default-graph-uri" parameter. This is described in
section 2.1.2 in the SPARQL protocol document:
http://www.w3.org/TR/rdf-sparql-protocol/
3. Programmatically, when using the SparqlInterpreter object, call
SparqlInterpreter.setDefaultGraphUri(URI).
> 2. There is no way to query across ALL "documents" stored in a mulgara
> server instance.
There is. Use a variable when specifying a GRAPH keyword. If that
isn't working, then file a bug report, and use the workaround of
querying the <#> graph (which stores a list of all the graphs).
> Our problem is that the process doing the querying, is not the same as the
> process storing the documents, which can come from lots of different
> sources. Documents are generally not stored into a single URI - so we
> basically do not know the document URI at query time and cannot put it in
> the SPARQL - in fact we do not want to as we want to query across all
> documents. Are we out of luck here with mulgara as it stands now or am I
> missing something from your explanation below?
No, you're not out of luck. You're missing something in my
explanation. Maybe I've been rendered unclear due to too much Xmas
cheer. :-)
> Also, I am not sure what you are saying by "can always be overridden by the
> connection" below.
See section 8.3 of the SPARQL query language:
http://www.w3.org/TR/rdf-sparql-query/#specifyingDataset
Here is the quote I am referring to:
"The RDF dataset may also be specified in a SPARQL protocol request,
in which case the protocol description overrides any description in
the query itself."
Regards,
Paul
More information about the Mulgara-general
mailing list