W3C home > Mailing lists > Public > public-lod@w3.org > February 2012

Re: Metadata about single triples

From: David Booth <david@dbooth.org>
Date: Thu, 23 Feb 2012 13:44:15 -0500
To: Michael Brunnbauer <brunni@netestate.de>
Cc: carsten.kessler@uni-muenster.de, public-lod@w3.org, Chad Hendrix <hendrix@un.org>
Message-ID: <1330022655.15521.4976.camel@dbooth-laptop>
Hi Michael,

On Thu, 2012-02-23 at 16:59 +0100, Michael Brunnbauer wrote:
[ . . . ]
> I do not see why you have to name thousands of graphs in the query. Is
> the metadata not attached to the named graph with the named graph URI
> as subject ?
> You could query it like this:
> select ?s ?p ?o where {
> graph ?g1 { ?g <http://xmlns.com/foaf/0.1/maker> <http://www.brunni.de/foaf.rdf#me> }
> graph ?g { ?s ?p ?o }
> }

That technique may usable in some cases, but it means something
different from using multiple "FROM NAMED" clauses.  In the example
above, graph ?g is an *individual* graph -- the triples from all of
the ?g graphs are never merged.  The difference shows up when you need
to join triples that originate in different graphs.  For example, if
your query wanted both "?s :p1 ?o" and "?s :p2 ?o" to be true and you
wrote something like this:

  select ?s ?p ?o where {
  graph ?g1 { ?g <http://xmlns.com/foaf/0.1/maker> 
                     <http://www.brunni.de/foaf.rdf#me> }
  graph ?g { ?s :p1 ?o .  
           ?s :p2 ?o .}

then this query will only work if both of these triples come from the
*same* graph ?g, whereas if the graphs were all listed in "FROM NAMED"
clauses, then one triple could come from one graph and the other from

David Booth, Ph.D.

Opinions expressed herein are those of the author and do not necessarily
reflect those of his employer.
Received on Thursday, 23 February 2012 18:45:12 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:29:57 UTC