W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > April to June 2005

non-empty default graphs

From: Eric Prud'hommeaux <eric@w3.org>
Date: Thu, 2 Jun 2005 07:35:22 -0400
To: Dan Connolly <connolly@w3.org>
Cc: RDF Data Access Working Group <public-rdf-dawg@w3.org>
Message-ID: <20050602113522.GK1967@w3.org>
This is kind of like a test case for fromUnionQuery, hence the
threading choice.

Using Named Graphs (rq23) parlance, if I have a dataset:

  default: { }
  <lies.rdf>: { <TheMoon> <isMadeOf> <GreenCheese> }
  <truth.rdf>: { <TheMoon> <isMadeOf> <Rocks>, <Dirt> }

and a query:

  SELECT ?stuff
  FROM <truth.rdf>
  FROM NAMED <lies.rdf>
  WHERE { <TheMoon> <isMadeOf> ?stuff }

I get pretty predictable results:

  | Rocks |
  | Dirt  |

But the default graph need not start out empty. If i happen on a default
graph that alreay has <lies.rdf> in it:

  default: { <TheMoon> <isMadeOf> <GreenCheese> }

and do the same query, I get:

  | Rocks       |
  | Dirt        |
  | GreenCheese |

Thus, if the defualt database *may* be contiminated, you need to fall
back to the more verbose form of provenance constraint:
  SELECT ?stuff
  FROM <truth.rdf>
  FROM NAMED <lies.rdf>
  WHERE { GRAPH <truth.rdf> { <TheMoon> <isMadeOf> ?stuff } }

-- 
-eric

office: +81.466.49.1170 W3C, Keio Research Institute at SFC,
                        Shonan Fujisawa Campus, Keio University,
                        5322 Endo, Fujisawa, Kanagawa 252-8520
                        JAPAN
        +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
cell:   +81.90.6533.3882

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Thursday, 2 June 2005 11:35:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:23 GMT