Re: non-empty default graphs

On Thu, Jun 02, 2005 at 09:29:09AM -0500, Dan Connolly wrote:
> 
> On Thu, 2005-06-02 at 07:35 -0400, Eric Prud'hommeaux wrote:
> > 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> }

Perhaps i over-abbreviated. This particular query service has no
innate data (unlike, say, a database of the CIA World Fact Book).
There are also two rdf files, lies and truth, out there on the web.

> > and a query:
> > 
> >   SELECT ?stuff
> >   FROM <truth.rdf>

per rq23, reads <truth.rdf> into the default graph.

> >   FROM NAMED <lies.rdf>

reads <lies.rdf> into a named graph called <lies.rdf>.

> >   WHERE { <TheMoon> <isMadeOf> ?stuff }
> > 
> > I get pretty predictable results:
> > 
> >   | Rocks |
> >   | Dirt  |
> 
> Huh? Above you said the default graph was empty. So
> you should get no results.
> 
> Your example has two conflicting descriptions of
> the dataset. Pick one, please.
> 
> If you pick the one suggested by the FROM/FROM NAMED
> parts of the query, you get:
> 
>   default: { <TheMoon> <isMadeOf> <Rocks>, <Dirt> }
>   <lies.rdf>: { <TheMoon> <isMadeOf> <GreenCheese> }
>   <truth.rdf>: { <TheMoon> <isMadeOf> <Rocks>, <Dirt> }
> 
> 
> 
> > But the default graph need not start out empty.
> 
> "start out"? datasets don't change. They just are.

The notional SPARQL interface to W3C mail search is a service that
starts out with some amount of innate data. It could be in named
graphs or in the default graph. Both FROM and FROM NAMED change the
data that is available to the query.

> >  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 15:06:28 UTC