W3C home > Mailing lists > Public > public-sparql-dev@w3.org > October to December 2007

Named Graphs VS plain quads in SPARQL syntax

From: alan gebert <alan.gebert@gmail.com>
Date: Sat, 10 Nov 2007 00:59:25 -0300
Message-ID: <c4cccf6a0711091959n6d800251me99fc13f563d9e5c@mail.gmail.com>
To: public-sparql-dev@w3.org

Hi all,

I assume there is a perfectly good reason for this... but I would
really like to understand it thouroughly

Why was there a need to use the NAMED and FROM NAMED graph syntax
instead of extending sparql to use quads?
( by attaching an extra iri to statements patterns, for example ).

The following two queries should be equivalent... right?

SELECT ?mbox ?nick ?ppd
FROM NAMED <http://example.org/foaf/aliceFoaf>
FROM NAMED <http://example.org/foaf/bobFoaf>
WHERE
{
  GRAPH data:aliceFoaf
  {
    ?alice foaf:mbox <mailto:alice@work.example> ;
           foaf:knows ?whom .
    ?whom  foaf:mbox ?mbox ;
           rdfs:seeAlso ?ppd .
    ?ppd  a foaf:PersonalProfileDocument .
  } .
  GRAPH ?ppd
  {
      ?w foaf:mbox ?mbox ;
         foaf:nick ?nick
  }
}





SELECT ?mbox ?nick ?ppd
WHERE
{
    ?alice foaf:mbox <mailto:alice@work.example> data:aliceFoaf;
           foaf:knows ?whom data:aliceFoaf .
    ?whom  foaf:mbox ?mbox data:aliceFoaf ;
           rdfs:seeAlso ?ppd data:aliceFoaf.
    ?ppd  a foaf:PersonalProfileDocument data:aliceFoaf .
      ?w foaf:mbox ?mbox ?ppd ;
         foaf:nick ?nick ?ppd
}


Thanks,
A
Received on Monday, 12 November 2007 05:27:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:17:05 GMT