Re: Comments on SPARQL: Semantics of queries involving named graphs [OK?]

Jagannathan Srinivasan wrote:

> Can you clarify the query semantics for the following cases:
> 
> A SPARQL query can specify RDF dataset as follows:
> FROM d1
> FROM d2
> ...
> FROM dn
> 
> FROM NAMED g1
> FROM NAMED g2
> ...
> FROM NAMED gm
> 
> Then the query may use graph clause in several ways:
> 1) GRAPH gx (explicit naming) => BUT, gx may not exist in {g1, g2, ..., 
> gm}, then what is the expected behavior?
> 2) GRAPH ?g (variable-based naming)
>    ?g may get instantiated from global (that is not enclosed inside a 
> GRAPH clause) graph-pattern to a value gx (say)
>    BUT gx may not be a member of {g1, g2, ..., gm}, then what is the 
> expected behavior?

The relevant section of the current editor's draft here is section 9, 
which deals with specifying the dataset (see [1]). To quote from section 9:

  "The FROM and FROM NAMED keywords allow a query to specify an RDF
   dataset by reference; they indicate that the dataset should include
   graphs that are obtained from representations of the resources
   identified by the given IRIs (i.e. the absolute form of the given IRI
   references). The dataset resulting from a number of FROM and FROM
   NAMED clauses is:

     * a default graph consisting of the merge of the graphs referred to
       in the FROM clauses
     * a set of (IRI, graph) pairs, one from each FROM NAMED clause.

   If a query provides such a dataset description, then it is used in
   place of any dataset that the query service would use if no dataset
   description is provided in a query."

The last sentence in particular is of relevance to your question: a 
SPARQL processor is expected, if a dataset description is provided using 
FROM and FROM NAMED, to _only_ query the dataset as specified in those 
clauses. Thus, for the purposes of evaluating dataset graph patterns (or 
any other graph patterns), it is not really relevant whether the dataset 
to query is obtained by reference (through FROM or FROM NAMED clauses), 
or whether it is implicitly available to the processor already. But 
however the dataset is obtained, a GRAPH clause may indeed reference a 
graph name that does not exist in the current dataset. What happens then 
is formalized in the definition of the pattern solution for dataset 
graph patterns (see [2]).

If a GRAPH clause mentions a graph name (either by explicit naming or by 
variable binding from outside the clause) that is not present in the 
dataset, the pattern fails, because no pattern solution S exists that 
satisfies the conditions in definition 2 of section 7 (see [2]).

If this clarification addresses your concern in satisfactory fashion, 
please indicate so by responding with [CLOSED] in the subject line, to 
allow issue tracking scripts to close the issue. If not, please feel 
free to provide additional feedback.

Regards,

Jeen

[1] http://www.w3.org/2001/sw/DataAccess/rq23/#specifyingDataset
[2] http://www.w3.org/2001/sw/DataAccess/rq23/#rdfDataset
-- 
Jeen Broekstra          Aduna BV
Knowledge Engineer      Julianaplein 14b, 3817 CS Amersfoort
http://aduna.biz        The Netherlands
tel. +31 33 46599877

Received on Wednesday, 9 November 2005 11:58:21 UTC