Re: OUTER JOIN and DISJUNCTION

On 15/11/2004, at 20:50, Eric Prud'hommeaux wrote:

>
> Related to
>   ACTION SimonR: explain how much of disjuction can be done with
>   optionals, nested or otherwise.  Point to references, problems with
>   LEFT OUTER JOIN in the literature.
>
> In my experiments, I haven't found DISJUNCTION that I couldn't
> implement with OUTER JOINs.

I haven't quite gotten the trick yet, embarrassingly enough.  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> .

I'd expect the result

+--------+--------+
|   ?a   |   ?b   |
+--------+--------+
| <x:s1> |        |
|        | <x:s2> |
+--------+--------+

What's the equivalent SPARQL using [ ] instead of UNION?

Received on Monday, 15 November 2004 14:50:31 UTC