Skip to content

Conversation

hartig
Copy link
Contributor

@hartig hartig commented Sep 25, 2025

This PR addresses #254


Preview | Diff

@hartig hartig requested review from kasei, afs, rubensworks and Tpt September 25, 2025 10:57
@hartig hartig linked an issue Sep 25, 2025 that may be closed by this pull request
Comment on lines 10091 to 10112
<p>Let <var>Ω<sub>1</sub></var> and <var>Ω<sub>2</sub></var> be multisets 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_algDiff" class="algFct">Diff</a>(<var>Ω<sub>1</sub></var>, <var>Ω<sub>2</sub></var>, <var>expr</var>, |D|, |G|) = { <var>μ</var> | <var>μ</var> in <var>Ω<sub>1</sub></var> such that ∀ <var>μ'</var> in
<var>Ω<sub>2</sub></var>, either i)&nbsp;<var>μ</var> and <var>μ'</var> are not <a href="#defn_algCompatibleMapping">compatible</a>,
or
ii)&nbsp;<var>μ</var> and <var>μ'</var> are <a href="#defn_algCompatibleMapping">compatible</a> and
|expr|(merge(<var>μ</var>, <var>μ'</var>), |D|, |G|) is an [=error=],
or
iii)&nbsp;<var>μ</var> and <var>μ'</var> are <a href="#defn_algCompatibleMapping">compatible</a> and
|expr|(merge(<var>μ</var>, <var>μ'</var>), |D|, |G|) is an RDF term |t| for which
<a href="#func-ebv">EBV</a>(|t|) is not `"true"^^xsd:boolean` }</p>
<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>, |D|, |G|) ) =
<a href="#defn_Multiplicity">multiplicity</a>( <var>μ</var> | <var>Ω<sub>1</sub></var> )</p>
<p>
where, for every solution mapping <var>μ</var>,
|expr|(<var>μ</var>, |D|, |G|) is the result of
<a href="#expression-evaluation">evaluating</a> expression |expr|
with respect to <var>μ</var>, in the context of dataset |D| with active graph |G|.
</p>
Copy link
Member

Choose a reason for hiding this comment

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

It seems likely that this section (and likely others I'm not seeing right now) will benefit from HTML markup that delivers to the spec reader something like the subparagraphs which have been produced within the HTML markup. Perfect world, the lowercase Roman numerals could be reproduced in an ordered list, but these would be OK as a unordered list (to which I would suggest it be changed if there's no importance to the i/ii/iii) following the either (which I would suggest be changed to one of the following).

This is a rough suggestion (I have no HTML preview, at present), and it may itself need substantial change, if not a full rewrite, before merging.

Suggested change
<p>Let <var>Ω<sub>1</sub></var> and <var>Ω<sub>2</sub></var> be multisets 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_algDiff" class="algFct">Diff</a>(<var>Ω<sub>1</sub></var>, <var>Ω<sub>2</sub></var>, <var>expr</var>, |D|, |G|) = { <var>μ</var> | <var>μ</var> in <var>Ω<sub>1</sub></var> such that ∀ <var>μ'</var> in
<var>Ω<sub>2</sub></var>, either i)&nbsp;<var>μ</var> and <var>μ'</var> are not <a href="#defn_algCompatibleMapping">compatible</a>,
or
ii)&nbsp;<var>μ</var> and <var>μ'</var> are <a href="#defn_algCompatibleMapping">compatible</a> and
|expr|(merge(<var>μ</var>, <var>μ'</var>), |D|, |G|) is an [=error=],
or
iii)&nbsp;<var>μ</var> and <var>μ'</var> are <a href="#defn_algCompatibleMapping">compatible</a> and
|expr|(merge(<var>μ</var>, <var>μ'</var>), |D|, |G|) is an RDF term |t| for which
<a href="#func-ebv">EBV</a>(|t|) is not `"true"^^xsd:boolean` }</p>
<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>, |D|, |G|) ) =
<a href="#defn_Multiplicity">multiplicity</a>( <var>μ</var> | <var>Ω<sub>1</sub></var> )</p>
<p>
where, for every solution mapping <var>μ</var>,
|expr|(<var>μ</var>, |D|, |G|) is the result of
<a href="#expression-evaluation">evaluating</a> expression |expr|
with respect to <var>μ</var>, in the context of dataset |D| with active graph |G|.
</p>
<p>Let <var>Ω<sub>1</sub></var> and <var>Ω<sub>2</sub></var>
be multisets 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 the following:</p>
<ul>
<li><a href="#defn_algDiff"
class="algFct">Diff</a>(<var>Ω<sub>1</sub></var>,
<var>Ω<sub>2</sub></var>, <var>expr</var>, |D|, |G|) =
{ <var>μ</var> | <var>μ</var> in <var>Ω<sub>1</sub></var>
such that ∀ <var>μ'</var> in
<var>Ω<sub>2</sub></var>, either of the following
<ol type="i">
<li><var>μ</var> and <var>μ'</var> are not
<a href="#defn_algCompatibleMapping">compatible</a></li>
<li><var>μ</var> and <var>μ'</var> are
<a href="#defn_algCompatibleMapping">compatible</a> and
|expr|(merge(<var>μ</var>, <var>μ'</var>), |D|, |G|)
is an [=error=]</li>
<li><var>μ</var> and <var>μ'</var> are
<a href="#defn_algCompatibleMapping">compatible</a> </li>
</ol>
<p>and |expr|(merge(<var>μ</var>, <var>μ'</var>), |D|, |G|)
is an RDF term |t| for which
<a href="#func-ebv">EBV</a>(|t|)
is not `"true"^^xsd:boolean` }</p></li>
<li><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>, |D|, |G|) ) =
<a href="#defn_Multiplicity">multiplicity</a>( <var>μ</var> | <var>Ω<sub>1</sub></var> )</li></ul>
<p>
where, for every solution mapping <var>μ</var>,
|expr|(<var>μ</var>, |D|, |G|) is the result of
<a href="#expression-evaluation">evaluating</a> expression |expr|
with respect to <var>μ</var>, in the context of dataset |D| with active graph |G|.
</p>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I have implemented it in commit 0c316c4

Copy link
Member

Choose a reason for hiding this comment

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

Great! Similar should be applied to the other blocks that are similarly prettified as HTML, without prettifying their rendering in the browser.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great! Similar should be applied to the other blocks that are similarly prettified as HTML, without prettifying their rendering in the browser.

There are no other such blocks within the scope of this PR (whose purpose is to fix issues in the formalization of algebra operators that involve expressions).

Copy link
Member

Choose a reason for hiding this comment

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

I did look before posting the above ... but apparently I was hallucinating at the time. Sorry!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries Ted.

So, you are okay now with this PR?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. Merge away. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Merge away. :-)

Thanks Ted!

I will still wait for @afs' review.

Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expressions and their evaluation are ill-defined
5 participants