Re: semantics of OPTIONAL/LeftJoin

Dear Roman, Andy,

not having looked in detail into it yet (travelling), admittedly, but in our original suggestion for an erratum, 
we had suggested

>>>>>>> LeftJoin(Ω1, Ω2, expr) =
>>>>>>> { merge(mu1, mu2) | mu1 in Omega1 and mu2 in Omega2, mu1 and mu2 are compatible and expr(merge(μ1, μ2)) is true }
>>>>>>> UNION
>>>>>>> { μ1 | μ1 in Ω1, *forall* mu2 in Omega2, either mu1 and mu2 are not compatible
>>>>>>>                                         or mu1 and mu2 are compatible and expr(merge(mu1, mu2)) is false }

which doesn't separate the 2nd and 3rd branch of the UNION.

Axel
--
Prof. Dr. Axel Polleres
Institute for Information Business, WU Vienna
url: http://www.polleres.net/  twitter: @AxelPolleres

> On 22 Jun 2015, at 12:46, Andy Seaborne <andy@apache.org> wrote:
> 
> Roman,
> 
> Thank you for the comment.  I've recorded this as query-errata-7a.
> 
> I agree that it may be impossible to write an explanatory expansion because the second two elements of the union can't be considered separately.  (When combined, they seem to form the diff part of the definition.)
> 
>    Andy
> 
> On 16/06/15 16:42, Roman Kontchakov wrote:
>> Dear Andy
>> 
>> It seems to me that the fix to the "written in full" definition of LeftJoin as described in http://www.w3.org/2013/sparql-errata#sparql11-query does not quite work.
>> 
>> For example, let Ω1 = { (?X -> :a) }, Ω2 = { (?X -> :a,  ?A -> 20), (?X -> :b, ?A -> 30) } and F = ?A = 30.
>> 
>> Using the normative definition, LeftJoin(Ω1,Ω2,F) = Filter(F, Join(Ω1,Ω2)) union Diff(Ω1,Ω2,F), we obtain
>> 
>>   - Join(Ω1,Ω2) = { (?X -> :a, ?A -> 20) } and so Filter(F, Join(Ω1,Ω2)) is empty;
>> 
>>   - on the other hand, Diff(Ω1,Ω2,F) = { (?X -> :a) } because for the only mapping μ1 in Ω1, the first mapping in Ω2 is compatible with μ1 but the effective boolean value of F is false and the second mapping in Ω2 is not compatible with μ1.
>> 
>> Thus,  LeftJoin(Ω, Ω2, F) = { (?X -> :a) }       (1)
>> 
>> Using the "written in full" definition from the errata,
>> 
>> LeftJoin(Ω1, Ω2, F) =   { merge(μ1, μ2) | μ1 in Ω1 and μ2 in Ω2, μ1 and μ2 are compatible and F(merge(μ1, μ2)) is true }
>>     ∪  { μ1 | μ1 in Ω1, ∀ μ2 in Ω2, μ1 and μ2 are not compatible, or Ω2 is empty }
>>     ∪  { μ1 | μ1 in Ω1, ∀ μ2 in Ω2, μ1 and μ2 are compatible and F(merge(μ1, μ2)) is false }
>> 
>> we obtain, respectively,
>> 
>>    - the empty set (see above),
>>    - the empty set (because Ω2 is not empty and contains a mapping compatible with the only mapping in Ω1),
>>    - the empty set (because the first mapping in Ω2 is compatible with the only mapping in Ω1 but F is false).
>> 
>> The result, therefore, is the empty set, which is not equal to (1).
>> 
>> In fact, I suspect, there is no simple way of translating the two components in the union of the normative definition into some sort of `three-component' union. So, in my view, it is easier to replace the current "written in full" version of LeftJoin with Filter over Join + Diff (or omit it altogether to avoid any confusion).
>> 
>> Best regards
>> Roman
>> 
>> --
>> Roman Kontchakov
>> Birkbeck, University of London
>> 
> 
> 

Received on Thursday, 25 June 2015 12:03:10 UTC