W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2004

Re: OUTER JOIN and DISJUNCTION

From: Simon Raboczi <raboczi@tucanatech.com>
Date: Tue, 16 Nov 2004 17:06:15 +1000
Message-Id: <01C4B9AA-379E-11D9-889A-000A95C5686E@tucanatech.com>
Cc: public-rdf-dawg@w3.org
To: Eric Prud'hommeaux <eric@w3.org>


On 16/11/2004, at 16:42, Eric Prud'hommeaux wrote:

>>> Can you demonstrate for the simplest case of
>>>
>>> SELECT ?a ?b WHERE (?a <x:p1> <x:o1>) UNION (?b <x:p2> <x:o2>)
>>>
>>> targeting a graph with the following triples
>>>
>>> <x:s1> <x:p1> <x:o1> .
>>> <x:s2> <x:p2> <x:o2> .
>
> On IRC, Andy proposed:
>
>   2004-11-15T15:08:28Z <AndyS> SELECT a, NULL as b WHERE stmt.p = x:p1 
> stmt.o = o1  UNION
>   2004-11-15T15:08:28Z <AndyS>  SELECT a as NULL, b WHERE stmt.p = 
> x:p2 stmt.o = o2
>   2004-11-15T15:08:47Z <AndyS> (with apologies to SQL!)
>
> [...] But it *does* work in last night's nightly build of mysql 4.1 *.
>
> +------+------+
> | a    | b    |
> +------+------+
> | x:s1 | NULL |
> | NULL | x:s2 |
> +------+------+

Right, but all that's been proven here is that SQL has disjunction 
(i.e. UNION) and that therefore it can express the SPARQL disjunction 
example.  It hasn't demonstrated that in either SQL or SPARQL there's a 
way to replace UNION with some equivalent OUTER JOIN/OPTIONAL-based 
expression.
Received on Tuesday, 16 November 2004 07:06:53 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:21 GMT