Skip to content

Fixes inconsistency in the definition versus the use of the 'Filter' algebra operator #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9904,14 +9904,20 @@ <h3>SPARQL Algebra</h3>
described above.</p>
<div class="defn">
<p><b>Definition: <span id="defn_algFilter">Filter</span></b></p>
<p>Let <var>Ω</var> be a multiset of solution mappings and <var>expr</var> be an expression. We define:</p>
<p><a href="#defn_algFilter" class="algFct">Filter</a>(<var>expr</var>, <var>Ω</var>) = { <var>μ</var> | <var>μ</var> in <var>Ω</var> and <var>expr</var>(<var>μ</var>) is an expression that has an
<p>Let <var>Ω</var> be a multiset of solution mappings,
<var>expr</var> be an <a href="#expressions">expression</a>,
|D| be a <a href="#sparqlDataset">dataset</a>,
and |G| be the <a href="#defn_ActiveGraph">active graph</a>.
We define:</p>
<p><a href="#defn_algFilter" class="algFct">Filter</a>(<var>expr</var>, <var>Ω</var>, |D|, |G|) = { <var>μ</var> in <var>Ω</var> | <var>expr</var>(<var>μ</var>) is an expression that has an
effective boolean value of true }</p>
<p><a href="#defn_Multiplicity">multiplicity</a>( <var>μ</var> | <a href="#defn_algFilter" class="algFct">Filter</a>(<var>expr</var>, <var>Ω</var>) )
<div class="issue" data-number="254">
It is not clear what <var>expr</var>(<var>μ</var>) is, and it is not apparent in the formula that the expression |expr| is meant to be evaluated not only with respect to <var>μ</var> but also with respect to |D| with active graph |G|.</div>
<p><a href="#defn_Multiplicity">multiplicity</a>( <var>μ</var> | <a href="#defn_algFilter" class="algFct">Filter</a>(<var>expr</var>, <var>Ω</var>, |D|, |G|) )
= <a href="#defn_Multiplicity">multiplicity</a>( <var>μ</var> | <var>Ω</var> )</p>
Comment on lines +9911 to 9917
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears likely that these <p> should instead be a list (I think unordered, but I could be wrong) beneath the We define: which I suggest should be changed to We define the following:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any other instances of We define:</p> and subsequent <p> should get similar handling.

I agree with the We define the following:.

Your other suggestion (to present each block of formulas as a list) is a matter of taste, I guess.

In any case, these changes are not related to the purpose of this PR and, thus, I would keep them for a separate PR (to be created after this one is merged). I created an issue to remember this TODO: #258

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced by the " the following" which to me suggests "one or more".

It's not separate items - it's a unit (singular).

<blockquote>
Note that evaluating an <code>exists(pattern)</code> expression uses the dataset and
active graph, D(G). See the <a href="#defn_evalFilter">evaluation of filter</a>.
Note that evaluating an <code>exists(pattern)</code> expression uses the dataset |D| and
active graph |G|. See the <a href="#defn_evalFilter">evaluation of filter</a>.
</blockquote>
</div>
<div class="defn">
Expand All @@ -9933,10 +9939,12 @@ <h3>SPARQL Algebra</h3>
<div class="defn">
<p><b>Definition: <span id="defn_algDiff">Diff</span></b></p>
<p>Let <var>Ω<sub>1</sub></var> and <var>Ω<sub>2</sub></var> be multisets of solution mappings and <var>expr</var> be an
expression. We define:</p>
<a href="#expressions">expression</a>. We define:</p>
<p><a href="#defn_algDiff" class="algFct">Diff</a>(<var>Ω<sub>1</sub></var>, <var>Ω<sub>2</sub></var>, <var>expr</var>) = { <var>μ</var> | <var>μ</var> in <var>Ω<sub>1</sub></var> such that ∀ <var>μ'</var> in
<var>Ω<sub>2</sub></var>, either <var>μ</var> and <var>μ'</var> are not <a href="#defn_algCompatibleMapping">compatible</a> or <var>μ</var> and <var>μ'</var> are <a href="#defn_algCompatibleMapping">compatible</a> and
<var>expr</var>(merge(<var>μ</var>, <var>μ'</var>)) does not have an effective boolean value of true }</p>
<div class="issue" data-number="254">
It is not clear what <var>expr</var>(<var>μ</var>) is, and it is not apparent in the formula that the expression |expr| is meant to be evaluated not only with respect to <var>μ</var> but also with respect to |D| with active graph |G|.</div>
<p><a href="#defn_Multiplicity">multiplicity</a>( <var>μ</var> | <a href="#defn_algDiff" class="algFct">Diff</a>(<var>Ω<sub>1</sub></var>, <var>Ω<sub>2</sub></var>, <var>expr</var>) ) =
<a href="#defn_Multiplicity">multiplicity</a>( <var>μ</var> | <var>Ω<sub>1</sub></var> )</p>
Comment on lines +9942 to 9949
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with above We define: and subsequent <p>.

</div>
Expand All @@ -9946,7 +9954,7 @@ <h3>SPARQL Algebra</h3>
<div class="defn">
<p><b>Definition: <span id="defn_algLeftJoin">LeftJoin</span></b></p>
<p>Let <var>Ω<sub>1</sub></var> and <var>Ω<sub>2</sub></var> be multisets of solution mappings and <var>expr</var> be an
expression. We define:</p>
<a href="#expressions">expression</a>. We define:</p>
<p><a href="#defn_algLeftJoin" class="algFct">LeftJoin</a>(<var>Ω<sub>1</sub></var>, <var>Ω<sub>2</sub></var>, <var>expr</var>) = <a href="#defn_algFilter" class="algFct">Filter</a>(<var>expr</var>, <a href="#defn_algJoin" class="algFct">Join</a>(<var>Ω<sub>1</sub></var>,
<var>Ω<sub>2</sub></var>)) ∪ <a href="#defn_algDiff" class="algFct">Diff</a>(<var>Ω<sub>1</sub></var>, <var>Ω<sub>2</sub></var>, <var>expr</var>)</p>
<p><a href="#defn_Multiplicity">multiplicity</a>( <var>μ</var> | <a href="#defn_algLeftJoin" class="algFct">LeftJoin</a>(<var>Ω<sub>1</sub></var>, <var>Ω<sub>2</sub></var>, <var>expr</var>) ) =
Comment on lines +9957 to 9960
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with above, and extending down to line 9963.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any other instances of We define:</p> and subsequent <p> should get similar handling.

Expand Down Expand Up @@ -9984,6 +9992,8 @@ <h3>SPARQL Algebra</h3>
<p>Let <var>μ</var> be a solution mapping, <var>Ω</var> a multiset of solution mappings, <var>var</var> a variable
and <var>expr</var> be an <a href="#expressions">expression</a>, then we define:</p>
<p><a href="#defn_algExtend" class="algFct">Extend</a>(<var>μ</var>, <var>var</var>, <var>expr</var>) = <var>μ</var> ∪ { (<var>var</var>, <var>value</var>) | <var>var</var> not in dom(<var>μ</var>) and <var>value</var> = <var>expr</var>(<var>μ</var>) }</p>
<div class="issue" data-number="254">
It is not clear what <var>expr</var>(<var>μ</var>) is, and it is not apparent in the formula that the expression |expr| is meant to be evaluated not only with respect to <var>μ</var> but also with respect to |D| with active graph |G|.</div>
<p><a href="#defn_algExtend" class="algFct">Extend</a>(<var>μ</var>, <var>var</var>, <var>expr</var>) = <var>μ</var> if <var>var</var> not in dom(<var>μ</var>) and expr(<var>μ</var>) is an error</p>
<p><a href="#defn_algExtend" class="algFct">Extend</a> is undefined if <var>var</var> in dom(<var>μ</var>).</p>
<p><a href="#defn_algExtend" class="algFct">Extend</a>(<var>Ω</var>, <var>var</var>, <var>expr</var>) = { <a href="#defn_algExtend" class="algFct">Extend</a>(<var>μ</var>, <var>var</var>, <var>expr</var>) | <var>μ</var> in <var>Ω</var> }</p>
Expand Down Expand Up @@ -10437,7 +10447,7 @@ <h3>Evaluation Semantics</h3>
<ul>
<li>|P|, <var>P<sub>1</sub></var>, <var>P<sub>2</sub></var> : graph patterns</li>
<li>|L| : a solution sequence</li>
<li>|F| : an expression</li>
<li>|F| : an <a href="#expressions">expression</a></li>
</ul>
<div class="issue" data-number="225">
The definitions in this section do not cover the cases in which
Expand All @@ -10454,7 +10464,7 @@ <h3>Evaluation Semantics</h3>
</div>
<div class="defn">
<p><b>Definition: <span id="defn_evalFilter">Evaluation of Filter</span></b></p>
<p><a href="#defn_eval" class="evalFct">eval</a>( |D|(|G|), <a href="#defn_absFilter" class="absOp">Filter</a>(|F|, |P|) ) = <a href="#defn_algFilter" class="algFct">Filter</a>( |F|, <a href="#defn_eval" class="evalFct">eval</a>(|D|(|G|), |P|), |D|(|G|) )</p>
<p><a href="#defn_eval" class="evalFct">eval</a>( |D|(|G|), <a href="#defn_absFilter" class="absOp">Filter</a>(|F|, |P|) ) = <a href="#defn_algFilter" class="algFct">Filter</a>( |F|, <a href="#defn_eval" class="evalFct">eval</a>(|D|(|G|), |P|), |D|, |G| )</p>
</div>
<p>'substitute' is a filter function in support of the evaluation of
<a href="#func-filter-exists"><code>EXISTS</code>
Expand Down
Loading