rdf4j
rdf4j copied to clipboard
Several testsuite tests flagging lots of assertions in algebra.Var.setParentNode(Var.java:112)
Current Behavior
SPARQLQueryTest, SPARQLUpdateTest, ComplexSPARQLQueryText, W3CApprovedSPARQL11QueryTest
~15 tests are failing as a result of some variant of this.
Some stacks:
java.lang.AssertionError
at org.eclipse.rdf4j.query.algebra.Var.setParentNode(Var.java:112)
at org.eclipse.rdf4j.query.algebra.BinaryValueOperator.setLeftArg(BinaryValueOperator.java:70)
at org.eclipse.rdf4j.query.algebra.BinaryValueOperator.
java.lang.AssertionError
at org.eclipse.rdf4j.query.algebra.Var.setParentNode(Var.java:112)
at org.eclipse.rdf4j.query.algebra.FunctionCall.addArg(FunctionCall.java:92)
at org.eclipse.rdf4j.query.algebra.FunctionCall.addArgs(FunctionCall.java:79)
at org.eclipse.rdf4j.query.algebra.FunctionCall.
java.lang.AssertionError
at org.eclipse.rdf4j.query.algebra.Var.setParentNode(Var.java:112)
at org.eclipse.rdf4j.query.algebra.StatementPattern.
Expected Behavior
No assert errors
Steps To Reproduce
Run testsuite on files: SPARQLQueryTest, SPARQLUpdateTest, ComplexSPARQLQueryText, W3CApprovedSPARQL11QueryTest
Version
4.1.2-SNAPSHOT
Are you interested in contributing a solution yourself?
No response
Anything else?
No response
I know @hmottestad has recently gone over quite a lot of the codebase to fix this (see GH-4189 and GH-4157). Are these problems still occurring or has this now been rectified?
Test Results - com_msd_gin_halyard_strategy_in_halyard-strategy.txt
Still occuring on 4.1.3 (see attached -- had to rename from .html to .txt to upload to comment here)
@hmottestad any updates on these asserts?
Could you create a pull request to reproduce these issues as I'm having a hard time reproducing them myself.
just to sync, but were you able to wire up the tests mentioned here and still not seeing an issue? if so, maybe a halyard issue.
This is what I did: https://github.com/eclipse/rdf4j/pull/4211
Was it one of those tests?
I reran the tests w/o halyard stuff and no more asserts. However, one of the test is failing and incorrect (tested against graphdb and docker rdf4j 4.2.0. graphdb returns correct result, 4.2.0 does not. It appears to also be broken in 4.1.0; i did not go back further).
Test is sparql11-exists-06
input data:
@prefix : <http://example/> .
:a :p 1 ; :q 1, 2 .
:b :p 3.0 ; :q 4.0, 5.0 .
query:
PREFIX : <http://example/>
SELECT * WHERE {
?a :p ?n
FILTER NOT EXISTS {
?a :q ?m .
FILTER(?n = ?m)
}
}
==========================================================================================
# Expected bindings:
a=http://example/b n="3.0"^^<http://www.w3.org/2001/XMLSchema#decimal>
==========================================================================================
# Actual bindings:
a=http://example/a n="1"^^<http://www.w3.org/2001/XMLSchema#integer>
a=http://example/b n="3.0"^^<http://www.w3.org/2001/XMLSchema#decimal>
==========================================================================================
# Unexpected bindings:
a=http://example/a n="1"^^<http://www.w3.org/2001/XMLSchema#integer>
==========================================================================================
Query plan:
Projection (resultSizeActual=2)
╠══ProjectionElemList
║ ProjectionElem "a"
║ ProjectionElem "n"
╚══Filter (resultSizeActual=2)
├──Not
│ Exists
│ Filter (resultSizeActual=0)
│ ╠══Compare (=)
│ ║ Var (name=n)
│ ║ Var (name=m)
│ ╚══StatementPattern (resultSizeEstimate=8, resultSizeActual=4)
│ Var (name=a)
│ Var (name=_const_f65eef3a_uri, value=http://example/q, anonymous)
│ Var (name=m)
└──StatementPattern (resultSizeEstimate=4, resultSizeActual=2)
Var (name=a)
Var (name=_const_f65eef39_uri, value=http://example/p, anonymous)
Var (name=n)
It works if I change the query to:
PREFIX : <http://example/>
SELECT * WHERE {
?a :p ?n
FILTER NOT EXISTS {
?a :q ?n .
}
}
So I think it's a scoping issue when using filters inside and EXISTS clause.
I'm closing this issue since the original issue was about the assert in the Var class. I've create a new issue for the EXISTS
scoping issue. https://github.com/eclipse/rdf4j/issues/4256