Re: comments on SPARQL Query Language for RDF

Hi Bob,

  Apologies if this is brief; I'm using my phone.

  Regarding point 1: GRAPH also admits variables (as in my example, GRAPH ?foo). You can refer to these variables elsewhere in the query.

  Regarding point 2: yes, AllegroGraph allows you to store whatever you like in the graph field of a triple. Other stores might not. I'm not sure that I agree with you about naming -- why not mint URIs, or use UUID URNs? You can cram almost anything into a URI! -- but you can certainly use variables in your queries.

  Regarding point 3: the dataset issue is the only obstacle. Implementations can do what they like if you don't specify a dataset (so AG lets you choose what happens), but there is no support in the spec for anything like FROM NAMED * -- there was discussion about this recently.

  If your implementation is kind to you on the dataset issue (i.e., you can run a query against all graphs), then something like:

SELECT ?foo WHERE {
  GRAPH ?g {
    ?foo ?bar "foo" .
  }
  GRAPH <urn:prov> {
    ?g dc:date ?asserted .
    FILTER (?asserted > ...)
  }
}

should do what you want. Notice the provenance graph (though you can easily use the default graph for this).

  There is messiness if you try to write large queries using this style, which is an argument for moving the provenance filtering outside of SPARQL. That's a topic for another day, though.

-R

Received on Monday, 28 May 2007 21:35:46 UTC