why I don't like default graphs in the DATASET proposal

Hi all,

as Richard asked me during the telecon of 09-29, I'll try to pinpoint
what bothers me in the SPARQL DATASET proposal.

One such point is the notion of *default graph*, which works well
with SPARQL but, IMHO, is not relevant in RDF Concepts.

In general, a *default value* is the value to use for a parameter when
no value is explicitly specified.

In the case of SPARQL, this is the value corresponding to the GRAPH
keyword when this keyword is not used. E.g.

  SELECT * WHERE {
    :pa foaf:knows ?s .            // a triple from the default graph
    GRAPH ?s { ?s foaf:name ?n }   // a triple from a named graph
  }

But an equivalent query could be written

  SELECT * WHERE {
    GRAPH :pa { :pa foaf:knows ?s }
    GRAPH ?s { ?s foaf:name ?n }
  }

provided that I knew that the default graph of my SPARQL engine is :pa .

A such, I consider the default graph to be a *property of the SPARQL
engine* used to query the data, rather than a property of the data itself.

The fact that the SPARQL rec had to define all together the data
structure and the querying process can explain that they ended up with
the dataset proposal as it is.

I agree with Richard that we should integrate a proposal that has
already been widely implemented and tested, rather than reinventing the
wheel. However, keeping default graphs looks like keeping the bath water
with the baby...

I would prefer, in a nutshell, if the proposal was to :

* define an RDF DATASET as a set of named graphs (uri, graph) -- i.e.
remove the default graph;
* explain that a SPARQL DATASET, used by a particular SPARQL engine, is
an RDF DATASET where one of the named graphs is also considered the
default graph in order to allow for shorter queries.

I know that SPARQL does not require that the default graph is *also*
present as a named graph (though it does not forbid it), so the
statement above is slightly more constraining than what SPARQL specifies.

So here are a few questions to SPARQL implementers: is it more frequent
that the default graph also has a URI, or that it doesn't? Would it be
hard to ensure that it has one? Would that break something in existing
applications?

  pa


PS: if I didn't make myself clear about the default graph being a
property of the engine rather than the data, please consider the
following thought experiment:

Imagine a world where SPARQL would have defined, as part of a dataset,
the notion of *default resource*, so that I could write

  SELECT ?friend WHERE {
    foaf:knows ?friend
  }

Would we feel compelled to include the default resource in RDF Concepts?

Received on Thursday, 29 September 2011 14:42:47 UTC