Re: Dealing with RDB NULL values (was: Q: ISSUE-41 bNode semantics)

The third query (Q1 MINUS Q2) has two components.
Q1 selects the identifiers of all the tuples.
Q2 selects the identifiers of the tuples which have an existing value for the other attributes.

It turns out that in SQL the two components can be written in the very same way, since a tuple can not have a 'hole' - namely a missing value (due to the 1NF):

(select ID from R) MINUS (select ID from R)  :-)

On the other hand, in the current status of the direct mapping, you can have a 'hole' in a tuple, since NULL values are not translated. Therefore the two components are not the same anymore.

cheers
--e.

On 19 May 2011, at 15:55, Juan Sequeda wrote:

> Enrico,
> 
> I'm trying to understand your proposal and comments on the wiki in order to come up with my proposal using your same examples and queries. I do not want to be sloppy :) ... so I'm writing the queries in SQL.
> 
> Query A: select A from R
> Query B: select * from R as x, R as y where x.A = y.A
> 
> However, I'm unsure how to write Query C (it's a bit confusing using a sparql-like graph query syntax over relational tables). As I understand this query is to select all the rows of the table R except the rows that have a value in the attribute A. Is this right? If so, the SQL query would be 
> 
> select * from R where id not in ( select id from R where A is not null)
> 
> Thanks for your clarification. With this, I will be able to present my proposal
> 
> Juan Sequeda
> +1-575-SEQ-UEDA
> www.juansequeda.com
> 
> 
> On Thu, May 19, 2011 at 8:05 AM, Enrico Franconi <franconi@inf.unibz.it> wrote:
> 
> On 19 May 2011, at 10:35, Michael Hausenblas wrote:
> 
> > http://www.w3.org/2001/sw/rdb2rdf/wiki/RDBNullValues
> 
> I've committed in the Winki my part of the story.
> I hope it is clearer now.
> --e.
> 
> 

Received on Thursday, 19 May 2011 14:19:01 UTC