Re: Q: ISSUE-41 bNode semantics

On 18 May 2011, at 17:41, Alexandre Bertails wrote:

> So my questions are:
> * what is your requirement for NULL values?
> * what do you expect to see in the RDF?
> * what's missing today in the Direct Mapping?
> * do you have concrete examples?
> * can you be specific about which part(s) of the Direct Mapping must be
> fixed?

If you propose that the direct mapping should just not translate an attribute of a tuple if it contains a NULL value, then this is wrong for several reasons.

1) The following two RDBs, have the same direct mapping, but they do mean completely different things:

DB1:

R +----+------+
  | ID |   A  |
  +----+------+
  |  1 | null |
  |  2 | null |
  +----+------+

DB2:

R +----+
  | ID |
  +----+
  |  1 |
  |  2 |
  +----+

2) The query [let me be sloppy in the syntax here] 
   (:bn type R).(:bn A ?X)
   returns in both DB1 and DB2 no assignment for ?X, 
     while in DB1 it should return the NULL value(s).

3) The query
   (?X type R).(?Y type R).(?X A ?Z).(?Y A ?Z)
   correctly returns the empty assignments.

4) With the direct mapping translating the NULL value as a special constant,
   the query (3) returns the empty assignments in DB2 but not in DB1,
   where the given incorrect answer is:
   {{?X=1,?Y=1,?Z=null},
    {?X=1,?Y=2,?Z=null},
    {?X=2,?Y=1,?Z=null},
    {?X=2,?Y=2,?Z=null}}
    
(2) and (4) show that the naive approaches based on not translating NULL values or on translating the NULL value as a special constant are wrong.

cheers
--e.

Received on Wednesday, 18 May 2011 20:53:43 UTC