RE: Semantic Web Phase 2 Activity - Protocol - Query Language

Hi there - I have an example query with optional triples and I wondered what
the various systems do with it:

Thanks to Jeremy Carroll for this example.

Consider the data:

<x> <p> <y> .
<x> <q> <z> .

and the query:

[ <x> <p> ?a ]
[ <x> <q> ?a ]

where [] is an optional match.

?? Does the query match the data?
?? What does it return?
?? Does it matter whether it is constructing a graph or returning variable
bindings?

The issue is that the query binds a variable in the optional part but it
can't be done consistently on the data.  It could match the first triple
pattern and skip the second, it could also match the second but not the
first but it can't match both.

	Andy

PS Follow on problem - what if by inference <y> owl:sameAs <z> ?



-------- Original Message --------
> From: Steve Harris <mailto:S.W.Harris@ecs.soton.ac.uk>
> Date: 11 November 2003 17:10
> 
> On Tue, Nov 11, 2003 at 05:04:35 +0100, Leo Sauermann wrote:
> > because from your answer I think you understood that i wanted to have
> > some SQL standard stuff written in the Rdf-Query standard. Like "to
> > implement a RDF-Query, you have to use these internal SQL queries"
> > thats not what I meant, the OUTER JOIN problem is a RDF problem you
> > have when you try to use RDQL (a very popular query language, imho).
> > ... 
> > but with today's RDQL this is more complicated:
> > if there is no <foaf:image> triple for leo, you don't get any data at
> > all.
> 
> Yes, agreed, this is a problem. I think that SQL behaviour is a LEFT
> JOIN 
> though. I'm not sure how an OUTER JOIN would map to RDQL, but it
> would probably give you more rows than that.
> http://www.w3schools.com/sql/sql_join.asp
> 
> - Steve

Received on Tuesday, 11 November 2003 12:35:11 UTC