Skip to content

SPARQL 1.1: variable introduced by GRAPH is not affecting MINUS disjointness - #228

Merged
Tpt merged 2 commits into
mainfrom
tpt/graph-minus
Oct 9, 2025
Merged

Tpt merged 2 commits into
mainfrom
tpt/graph-minus

Conversation

@Tpt

@Tpt Tpt commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

variable scoping is already tested but it seems to me this case is easy to get wrong

@Tpt
Tpt requested a review from afs October 5, 2025 15:44
@Tpt
Tpt merged commit ef4d172 into main Oct 9, 2025
@Tpt
Tpt deleted the tpt/graph-minus branch October 9, 2025 19:30
rubensworks added a commit to rubensworks/SPARQLAlgebra.js that referenced this pull request Oct 15, 2025
Since our graph translation is not really part of the spec,
there is a MINUS edge case we need to consider with GRAPH ?g.
If left and right of MINUS have disjoint variables,
the whole left solution sequence must be kept.
If GRAPH is defined outside of an operator (e.g. MINUS),
then the spec says that evaluation of the operators
must be done as union over the evaluation of that operator
within each graph separately,
and that the variable of ?g must only be bound
**after** that evaluation.
As such, MINUS will not be aware of this variable ?g,
and the disjoint case will apply.
This code adds metadata to the operation so that engines
can special-case this.

See w3c/rdf-tests#228
joachimvh pushed a commit to rubensworks/SPARQLAlgebra.js that referenced this pull request Oct 15, 2025
Since our graph translation is not really part of the spec,
there is a MINUS edge case we need to consider with GRAPH ?g.
If left and right of MINUS have disjoint variables,
the whole left solution sequence must be kept.
If GRAPH is defined outside of an operator (e.g. MINUS),
then the spec says that evaluation of the operators
must be done as union over the evaluation of that operator
within each graph separately,
and that the variable of ?g must only be bound
**after** that evaluation.
As such, MINUS will not be aware of this variable ?g,
and the disjoint case will apply.
This code adds metadata to the operation so that engines
can special-case this.

See w3c/rdf-tests#228
joachimvh pushed a commit to joachimvh/SPARQLAlgebra.js that referenced this pull request Oct 15, 2025
Since our graph translation is not really part of the spec,
there is a MINUS edge case we need to consider with GRAPH ?g.
If left and right of MINUS have disjoint variables,
the whole left solution sequence must be kept.
If GRAPH is defined outside of an operator (e.g. MINUS),
then the spec says that evaluation of the operators
must be done as union over the evaluation of that operator
within each graph separately,
and that the variable of ?g must only be bound
**after** that evaluation.
As such, MINUS will not be aware of this variable ?g,
and the disjoint case will apply.
This code adds metadata to the operation so that engines
can special-case this.

See w3c/rdf-tests#228
rubensworks added a commit to comunica/comunica that referenced this pull request Oct 15, 2025
Since our algebraic graph translation is not really part of the spec,
there is a MINUS edge case we need to consider with GRAPH ?g.
If left and right of MINUS have disjoint variables,
the whole left solution sequence must be kept.
If GRAPH is defined outside of an operator (e.g. MINUS),
then the spec says that evaluation of the operators
must be done as union over the evaluation of that operator
within each graph separately,
and that the variable of ?g must only be bound
**after** that evaluation.
As such, MINUS will not be aware of this variable ?g,
and the disjoint case will apply.
This is fixed by adding metadata to the operation so that engines
can special-case this.

See w3c/rdf-tests#228
rubensworks added a commit to comunica/comunica that referenced this pull request Oct 15, 2025
Since our algebraic graph translation is not really part of the spec,
there is a MINUS edge case we need to consider with GRAPH ?g.
If left and right of MINUS have disjoint variables,
the whole left solution sequence must be kept.
If GRAPH is defined outside of an operator (e.g. MINUS),
then the spec says that evaluation of the operators
must be done as union over the evaluation of that operator
within each graph separately,
and that the variable of ?g must only be bound
**after** that evaluation.
As such, MINUS will not be aware of this variable ?g,
and the disjoint case will apply.
This is fixed by adding metadata to the operation so that engines
can special-case this.

See w3c/rdf-tests#228
joachimvh/SPARQLAlgebra.js#128
rubensworks added a commit to comunica/comunica that referenced this pull request Oct 15, 2025
Since our algebraic graph translation is not really part of the spec,
there is a MINUS edge case we need to consider with GRAPH ?g.
If left and right of MINUS have disjoint variables,
the whole left solution sequence must be kept.
If GRAPH is defined outside of an operator (e.g. MINUS),
then the spec says that evaluation of the operators
must be done as union over the evaluation of that operator
within each graph separately,
and that the variable of ?g must only be bound
**after** that evaluation.
As such, MINUS will not be aware of this variable ?g,
and the disjoint case will apply.
This is fixed by adding metadata to the operation so that engines
can special-case this.

See w3c/rdf-tests#228
joachimvh/SPARQLAlgebra.js#128
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