diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/FederationEvalStrategy.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/FederationEvalStrategy.java index 561a00bacbc..5dafe137315 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/FederationEvalStrategy.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/FederationEvalStrategy.java @@ -935,7 +935,10 @@ public abstract CloseableIteration evaluateBoundJoinStatementPattern * @param bindings * @return the result iteration * @throws QueryEvaluationException + * @deprecated with VALUES implementation, control flow goes via + * {@link #evaluateBoundJoinStatementPattern(StatementTupleExpr, List)} */ + @Deprecated(forRemoval = true) public abstract CloseableIteration evaluateGroupedCheck( CheckStatementPattern stmt, final List bindings) throws QueryEvaluationException; diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/SparqlFederationEvalStrategy.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/SparqlFederationEvalStrategy.java index 69bdf63cb38..68f0012d536 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/SparqlFederationEvalStrategy.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/SparqlFederationEvalStrategy.java @@ -118,8 +118,9 @@ public CloseableIteration evaluateBoundJoinStatementPattern( /** * Alternative evaluation implementation using UNION. Nowadays we use a VALUES clause based implementation * - * @deprecated + * @deprecated no longer used */ + @Deprecated(forRemoval = true) protected CloseableIteration evaluateBoundJoinStatementPattern_UNION( StatementTupleExpr stmt, List bindings) throws QueryEvaluationException { diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/join/ControlledWorkerBindJoin.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/join/ControlledWorkerBindJoin.java index 17010b1e3c5..2da2c52a494 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/join/ControlledWorkerBindJoin.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/join/ControlledWorkerBindJoin.java @@ -45,12 +45,7 @@ protected TaskCreator determineTaskCreator(TupleExpr expr, BindingSet bs) { final TaskCreator taskCreator; if (expr instanceof StatementTupleExpr) { StatementTupleExpr stmt = (StatementTupleExpr) expr; - if (stmt.hasFreeVarsFor(bs)) { - taskCreator = new BoundJoinTaskCreator(strategy, stmt); - } else { - expr = new CheckStatementPattern(stmt, queryInfo); - taskCreator = new CheckJoinTaskCreator(strategy, (CheckStatementPattern) expr); - } + taskCreator = new BoundJoinTaskCreator(strategy, stmt); } else if (expr instanceof FedXService) { taskCreator = new FedXServiceJoinTaskCreator(strategy, (FedXService) expr); } else { @@ -77,6 +72,7 @@ public ParallelTask getTask(ParallelExecutor control, Li } } + @Deprecated(forRemoval = true) protected class CheckJoinTaskCreator implements TaskCreator { protected final FederationEvalStrategy _strategy; protected final CheckStatementPattern _expr; diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/join/ParallelCheckJoinTask.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/join/ParallelCheckJoinTask.java index b567d1c91f0..358178e4fa5 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/join/ParallelCheckJoinTask.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/join/ParallelCheckJoinTask.java @@ -24,7 +24,9 @@ * {@link FederationEvalStrategy#evaluateGroupedCheck(CheckStatementPattern, List)} for further details. * * @author Andreas Schwarte + * @deprecated now integrated in {@link ParallelBoundJoinTask} (with VALUES clause) */ +@Deprecated(forRemoval = true) public class ParallelCheckJoinTask extends ParallelTaskBase { protected final FederationEvalStrategy strategy; diff --git a/tools/federation/src/test/java/org/eclipse/rdf4j/federated/BoundJoinTests.java b/tools/federation/src/test/java/org/eclipse/rdf4j/federated/BoundJoinTests.java index e74a51c73c9..6f673026230 100644 --- a/tools/federation/src/test/java/org/eclipse/rdf4j/federated/BoundJoinTests.java +++ b/tools/federation/src/test/java/org/eclipse/rdf4j/federated/BoundJoinTests.java @@ -45,4 +45,12 @@ public void testBoundJoin_FailingEndpoint() throws Exception { execute("/tests/boundjoin/query01.rq", "/tests/boundjoin/query01.srx", false, true); }); } + + @Test + public void testBoundCheck() throws Exception { + + /* test with VALUES clause based bound join, check join */ + prepareTest(Arrays.asList("/tests/data/data1.ttl", "/tests/data/data2.ttl")); + execute("/tests/boundjoin/query02_checkJoin.rq", "/tests/boundjoin/query02_checkJoin.srx", false, true); + } } diff --git a/tools/federation/src/test/resources/tests/boundjoin/query02_checkJoin.rq b/tools/federation/src/test/resources/tests/boundjoin/query02_checkJoin.rq new file mode 100644 index 00000000000..c42aef1590f --- /dev/null +++ b/tools/federation/src/test/resources/tests/boundjoin/query02_checkJoin.rq @@ -0,0 +1,10 @@ +# bound join query (where in the bind join all variables are bound) +PREFIX ns1: +PREFIX foaf: +PREFIX rdf: +PREFIX owl: + +SELECT ?person ?name WHERE { + ?person rdf:type foaf:Person . + ?person foaf:age 25 . +} \ No newline at end of file diff --git a/tools/federation/src/test/resources/tests/boundjoin/query02_checkJoin.srx b/tools/federation/src/test/resources/tests/boundjoin/query02_checkJoin.srx new file mode 100644 index 00000000000..c7a011d85e9 --- /dev/null +++ b/tools/federation/src/test/resources/tests/boundjoin/query02_checkJoin.srx @@ -0,0 +1,20 @@ + + + + + + + + + + + http://namespace1.org/Person_4 + + + + + http://namespace2.org/Person_6 + + + + diff --git a/tools/federation/src/test/resources/tests/data/data1.ttl b/tools/federation/src/test/resources/tests/data/data1.ttl index 30836bfbfe5..63c1a44044f 100644 --- a/tools/federation/src/test/resources/tests/data/data1.ttl +++ b/tools/federation/src/test/resources/tests/data/data1.ttl @@ -24,6 +24,7 @@ :Person_4 rdf:type foaf:Person . :Person_4 rdf:type :Person . :Person_4 foaf:name "Person4" . +:Person_4 foaf:age "25"^^xsd:integer . :Person_5 rdf:type foaf:Person . :Person_5 rdf:type :Person . diff --git a/tools/federation/src/test/resources/tests/data/data2.ttl b/tools/federation/src/test/resources/tests/data/data2.ttl index feaca13c428..003aa7faf8f 100644 --- a/tools/federation/src/test/resources/tests/data/data2.ttl +++ b/tools/federation/src/test/resources/tests/data/data2.ttl @@ -9,7 +9,7 @@ :Person_6 rdf:type foaf:Person . :Person_6 rdf:type :Person . :Person_6 foaf:name "Person6" . -:Person_1 foaf:age "25"^^xsd:integer . +:Person_6 foaf:age "25"^^xsd:integer . :Person_7 rdf:type foaf:Person . :Person_7 rdf:type :Person .