RE: Question/Comment on FROM and WITH

> -----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 UTC