W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > February 2005

RE: Question/Comment on FROM and WITH

From: Geoff Chappell <geoff@sover.net>
Date: Wed, 23 Feb 2005 12:12:07 -0500
To: <andy.seaborne@hp.com>
Cc: <public-rdf-dawg-comments@w3.org>
Message-ID: <01dd01c519ca$d0ad1760$6401a8c0@gsclaptop>



> -----Original Message-----
> From: Seaborne, Andy [mailto:andy.seaborne@hp.com]
> Sent: Wednesday, February 23, 2005 9:59 AM
> To: Geoff Chappell
> Cc: public-rdf-dawg-comments@w3.org
> Subject: Re: Question/Comment on FROM and WITH
> 
> Geoff Chappell wrote:
> > Are graph labels lost when assembling a background graph with WITH
> clause?
> 
> Yes, they are.
> 
> > E.g. what would I get for this query?
>  >
> >
> > SELECT ?src
> > WITH <http://example.org/foaf/aliceFoaf>
> <http://example.org/foaf/bobFoaf>
> > WHERE
> >   GRAPH ?src
> >   {
> >     ( ?x ?y ?z )
> >   }
> >
> > and what about this one - will it return any results?
> >
> > SELECT ?x
> > FROM <http://example.org/foaf/aliceFoaf>
> > WHERE
> >     ( ?x ?y ?z )
> 
> There are no solutions to either query.  And, yes, it's potentially
> confusing.
> As in the message to Bob MacGregor, suggestions for better names most
> welcome -

I'll predict that people are going to get pretty confused about FROM/WITH if
they remain as they are. I wonder if a slightly different model would make
more sense to people - e.g. something like this:

SELECT ?src
FROM <http://example.org/foaf/aliceFoaf> <http://example.org/foaf/bobFoaf>
AS <http://example.org/foaf/allFoaf>
...

I.e. use AS to rename one or more graphs; if no AS is specified each graph
is known by its own uri/name. You'd need to come up with a well-known name
for the default/background/nameless graph - e.g:

SELECT ?src
FROM  <http://example.org/foaf/aliceFoaf> 
	<http://example.org/foaf/bobFoaf>
 		AS <http://example.org/foaf/allFoaf>,
	<http://example.org/otherData>
		AS <http://www.sparql.org/DefaultGraph>
...

would have one named graph (allFoaf - containing bob and alice's foaf data)
and one background graph (DefaultGraph containing otherData).

Then:

WHERE
     ( ?x ?y ?z )

would match all triples in the default
(<http://www.sparql.org/DefaultGraph>) graph. 

Or Alternatively, have no name for the background graph and say that if no
AS is specified, the graph(s) are in the background graph - e.g:

SELECT ?src
FROM  <http://example.org/foaf/aliceFoaf> 
	<http://example.org/foaf/bobFoaf>
 		AS <http://example.org/foaf/allFoaf>,
	<http://example.org/otherData>
...

would have one named graph (allFoaf - containing bob and alice's foaf data)
and one background graph (containing otherData).

I don't think the slight benefit you get from the FROM/WITH shorthand
outweighs the confusion it will likely cause.


-Geoff
Received on Wednesday, 23 February 2005 17:13:05 GMT

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