Re: OUTER JOIN and DISJUNCTION

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 UTC