non-empty default graphs

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 UTC