Re: SPARQL 1.1 - LeftJoin definition

* David McNeil <dmcneil@revelytix.com> [2011-11-23 08:05-0600]
> I was studying the SPARQL 1.1 spec [1] and found that to my reading this
> text in 18.4 could be tightened up a bit.
> 
> LeftJoin(Ω1, Ω2, expr) =
>     { merge(μ1, μ2) | μ1 in Ω1and μ2 in Ω2, and μ1 and μ2 are compatible
> and expr(merge(μ1, μ2)) is true }
> ∪
>     { μ1 | μ1 in Ω1and μ2 in Ω2, and μ1 and μ2 are not compatible, or Ω2 is
> empty }
> ∪
>     { μ1 | μ1 in Ω1and μ2 in Ω2, and μ1 and μ2 are compatible and
> expr(merge(μ1, μ2)) is false, or Ω2 is empty }
> 
> Notice that the last two clauses can be read to mean that every tuple
> in Ω1should be paired with every tuple in Ω
> 2 . I don't think this matches the prior definition of Diff. Would it make
> sense to change the last two clauses to something like:
> 
>     { μ1 | μ1 in Ω1, ∀ μ2 in Ω2, μ1 and μ2 are not compatible, or Ω2 is
> empty }
> ∪
>    { μ1 | μ1 in Ω1 and ∃ μ2 in Ω2, such that μ1 and μ2 are compatible and
> expr(merge(μ1, μ2)) is false, or Ω2 is empty }
> 
> In addition, shouldn't the "or Ω2 is empty" condition be dropped from one
> of these clauses so that we only include the contents of Ω1 one time if Ω2
> is empty?

LeftJoin(Ω1, Ω2, expr) =
    { merge(μ1, μ2) | μ1 in Ω1 and μ2 in Ω2, and μ1 and μ2 are compatible and expr(merge(μ1, μ2)) is true }
∪
    { μ1 | μ1 in Ω1 | ∄ μ2 in Ω2 | μ1 and μ2 are compatible and expr(merge(μ1, μ2)) is true }

?

> Thank you.
> -David
> 
> [1] - http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/

-- 
-ericP

Received on Thursday, 24 November 2011 20:33:05 UTC