diff --git a/sparql-anything-engine/src/main/java/com/github/sparqlanything/engine/AnySlot.java b/sparql-anything-engine/src/main/java/com/github/sparqlanything/engine/AnySlot.java index e4b4f032..9cbdb5c0 100644 --- a/sparql-anything-engine/src/main/java/com/github/sparqlanything/engine/AnySlot.java +++ b/sparql-anything-engine/src/main/java/com/github/sparqlanything/engine/AnySlot.java @@ -45,13 +45,13 @@ public QueryIterator execEvaluated(Binding parent, Node subject, Node predicate, ExecutionContext execCxt) { Node s, o; - if (subject.isURI()) { + if (!subject.isVariable()) { s = subject; } else { s = Node.ANY; } - if (object.isURI() || object.isLiteral()) { + if (!object.isVariable()) { o = object; } else { o = Node.ANY; diff --git a/sparql-anything-it/src/test/java/com/github/sparqlanything/it/Issues.java b/sparql-anything-it/src/test/java/com/github/sparqlanything/it/Issues.java index a49191eb..e9df0437 100644 --- a/sparql-anything-it/src/test/java/com/github/sparqlanything/it/Issues.java +++ b/sparql-anything-it/src/test/java/com/github/sparqlanything/it/Issues.java @@ -195,7 +195,7 @@ public void testIssue114() throws IOException, URISyntaxException { } } - assertEquals(Sets.newHashSet("b", "d", "c"), slots); + assertEquals(Sets.newHashSet( "d", "c"), slots); } /** @@ -204,10 +204,10 @@ public void testIssue114() throws IOException, URISyntaxException { * @throws URISyntaxException * @throws IOException */ - @Ignore @Test public void testIssue154() throws URISyntaxException, IOException { - String queryStr = IOUtils.toString(getClass().getClassLoader().getResource("issues/e.sparql").toURI(), StandardCharsets.UTF_8); + String queryStr = IOUtils.toString(getClass().getClassLoader().getResource("issues/e.sparql").toURI(), + StandardCharsets.UTF_8); String location = getClass().getClassLoader().getResource("issues/a00002-1036.xml").toURI().toString(); Query query = QueryFactory.create(queryStr.replace("%%LOCATION%%", location)); Dataset ds = DatasetFactory.createGeneral(); diff --git a/sparql-anything-it/src/test/java/com/github/sparqlanything/it/ItTest.java b/sparql-anything-it/src/test/java/com/github/sparqlanything/it/ItTest.java index da615192..8594a053 100644 --- a/sparql-anything-it/src/test/java/com/github/sparqlanything/it/ItTest.java +++ b/sparql-anything-it/src/test/java/com/github/sparqlanything/it/ItTest.java @@ -558,7 +558,7 @@ public void testAnySlotMagicPropertyPropertyPath() throws IOException, URISyntax } } - assertEquals(Sets.newHashSet("b", "d", "c"), slots); + assertEquals(Sets.newHashSet("d", "c"), slots); }