W3C home > Mailing lists > Public > public-sparql-dev@w3.org > April to June 2007

Re: question on UNION

From: Steve Harris <swh@ecs.soton.ac.uk>
Date: Tue, 5 Jun 2007 07:16:27 +0100
Message-Id: <4CBA1EBB-1783-46E6-8347-E26D482911BB@ecs.soton.ac.uk>
Cc: public-sparql-dev@w3.org
To: "Andrew Newman" <andrewfnewman@gmail.com>

On 5 Jun 2007, at 06:55, Andrew Newman wrote:

> On 6/5/07, Steve Harris <swh@ecs.soton.ac.uk> wrote:
>> if that works then you have a bug. The behaviour of SPARQLs UNION  
>> is not
>> very natural from a relation algebra p.o.v., and this may have  
>> confused
>> developers familiar with that.
> Isn't it just outer union?  And isn't outer union just part of SQL 92.
> And isn't SQL 92 implemented by most (all?) databases.

In a sense. You can expand any SPARQL UNION into a set of SQL UNIONs,  
but SQLs UNION doesn't allow you to explicitly write
    :x :y ?z { ?z :p ?q } UNION { ?z :r ?q }
where the ?z-s are scoped to the whole expression and the ?q-s are  
scoped to the block. In relational the equivalent would be to join  
two expressions, each of two joins and use rho to unify the  
variables. But, I personally wouldn't write it that way.

- Steve
Received on Tuesday, 5 June 2007 06:16:14 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:15:49 UTC