Skip to content

simple exists changes #211

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

simple exists changes #211

wants to merge 1 commit into from

Conversation

lisp
Copy link

@lisp lisp commented May 2, 2025

these are the minimal changes to suggest to an implementor that exists' interpretation should be analogous to the nested loop approach to bgp interpretation.

HTML section 17.4.1.4

HTML Definition: Evaluation of Exists

@pfps
Copy link
Contributor

pfps commented May 2, 2025

Suppose we actually wanted minimal change in the exposition of NOT EXISTS and EXISTS in section 17.4.1.4. My suggestion would be to not change that section at all.

That section is incorrect with the current definition of EXISTS because EXISTS does deep textual substitution. The proposal to do deep value injection requires changes to the exposition because the deep value injection modifies how the entire pattern is evaluated, including in subqueries. Shallow value injection actually does what the exposition says - it evaluates the pattern just like any other pattern except that the the current solution mapping is used to provide values for variables in the pattern, just as the exposition says.

@pfps
Copy link
Contributor

pfps commented May 2, 2025

.

@@ -3598,7 +3604,8 @@ <h3><a name="sparqlAlgebraEval" id="sparqlAlgebraEval"></a>18.6 Evaluation Seman
<p>substitute(<i>pattern</i>, μ) = the pattern formed by replacing every
occurrence of a variable v in <i>pattern</i> by μ(v) for each v in dom(μ)</p>
</blockquote></div><div class="defn"><p><b>Definition: <a name="defn_evalExists" id="defn_evalExists">Evaluation of Exists</a></b></p><p>Let μ be the current solution mapping for a filter and P a graph pattern:</p><blockquote>
The value exists(P), given D(G) is true if and only if eval(D(G), substitute(P, μ)) is a non-empty sequence.
The value exists(P), given D(G) is true if and only if eval(D(G), substitute(P, μ)) is a non-empty sequence.
In the evaluation, blank node do not contribute to RDF instance mapping of statement patterns, but instead act as contants to contrain the match.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In the evaluation, blank node do not contribute to RDF instance mapping of statement patterns, but instead act as contants to contrain the match.
In the evaluation, blank nodes do not contribute to RDF instance mapping of statement patterns, but instead act as constants to constrain the match.

@afs afs marked this pull request as draft May 2, 2025 20:04
@afs
Copy link
Contributor

afs commented May 2, 2025

The directory input/ is a record of the SPARQL 1.1 material and the conversion to reSpec that formed the initial content for 1.2 work.

Changing this document will have no effect; it will break the provenance chain.

The current working document for SPARQL 1.2 is spec/index.html.

I've changed this PR to "draft" to avoid accidental merging.

@lisp
Copy link
Author

lisp commented May 2, 2025

i misunderstood.

the purpose was just to introduce the idea, rather than to ever merge it.
if the current form is too hard to read, i will redo it based on the correct source.
othewise, it can just be left as the draft.

@afs
Copy link
Contributor

afs commented May 3, 2025

PR #177 addresses the blank node issue (issue 3) by joining the current row to restrict the bindings.

In joins, blank nodes behave as RDF terms.

@pfps
Copy link
Contributor

pfps commented May 3, 2025

As far as I can tell, this PR doesn't fix EXISTS, as it still changes BIND and VALUES variables.

@afs
Copy link
Contributor

afs commented May 3, 2025

What do you mean by "this"?

@pfps
Copy link
Contributor

pfps commented May 3, 2025

What do you mean by "this"?

This PR. I edited my comment to reflect this as well.

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.

3 participants