From 855e762761c03017aea9c8b430c736d57162d040 Mon Sep 17 00:00:00 2001 From: Enrico Daga Date: Fri, 22 Apr 2022 15:48:33 +0100 Subject: [PATCH] Add test Reproducing #241 --- .../com/github/sparqlanything/it/Issues.java | 14 +++++++++ .../src/test/resources/issues/issue241.sparql | 29 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 sparql-anything-it/src/test/resources/issues/issue241.sparql 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 9ea9fc01..32bffe35 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 @@ -33,6 +33,7 @@ import org.apache.jena.rdf.model.Model; import org.apache.jena.sparql.engine.main.QC; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -310,4 +311,17 @@ public void testIssue194() throws URISyntaxException, IOException { assertTrue(QueryExecutionFactory.create(queryStr, ds).execSelect().hasNext()); } + /** + * TODO See #241 - Currently returns results but ends with a SOE + */ + @Ignore + @Test + public void testIssue241() throws Exception { + String queryStr = IOUtils.toString(getClass().getClassLoader().getResource("issues/issue241.sparql").toURI(), + StandardCharsets.UTF_8); + Dataset ds = DatasetFactory.createGeneral(); + QC.setFactory(ARQ.getContext(), FacadeX.ExecutorFactory); + System.out.println(ResultSetFormatter.asText(QueryExecutionFactory.create(queryStr, ds).execSelect())); + //assertTrue(QueryExecutionFactory.create(queryStr, ds).execSelect().hasNext()); + } } diff --git a/sparql-anything-it/src/test/resources/issues/issue241.sparql b/sparql-anything-it/src/test/resources/issues/issue241.sparql new file mode 100644 index 00000000..c54c84c5 --- /dev/null +++ b/sparql-anything-it/src/test/resources/issues/issue241.sparql @@ -0,0 +1,29 @@ +PREFIX fx: +PREFIX rdf: +PREFIX xyz: + +SELECT * +WHERE + { SERVICE + { + SERVICE + { fx:properties + fx:command "echo 4,5,6" ; + fx:media-type "text/csv" . + ?s ?p ?num . + # BIND(bnode() AS ?bob) # breaks + # BIND(struuid() AS ?bob) # breaks + # BIND(concat("a","b") AS ?bob) # works + # BIND("lala" AS ?bob) # works + } + + BIND(concat("seq ", ?num) AS ?second_cmd) + + fx:properties + fx:command ?second_cmd ; + fx:media-type "text/plain" ; + fx:txt.split "\n" . + + ?ss ?pp ?oo + } + } \ No newline at end of file