W3C home > Mailing lists > Public > www-rdf-interest@w3.org > November 2003

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

From: Seaborne, Andy <Andy_Seaborne@hplb.hpl.hp.com>
Date: Tue, 11 Nov 2003 17:34:49 -0000
Message-ID: <E864E95CB35C1C46B72FEA0626A2E808712CAF@0-mail-br1.hpl.hp.com>
To: "'Steve Harris'" <S.W.Harris@ecs.soton.ac.uk>, www-rdf-interest@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:52:03 GMT