Skip to content

Commit

Permalink
Add test Reproducing #241
Browse files Browse the repository at this point in the history
  • Loading branch information
enridaga committed Apr 22, 2022
1 parent 79f6f78 commit 855e762
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
}
29 changes: 29 additions & 0 deletions sparql-anything-it/src/test/resources/issues/issue241.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PREFIX fx: <http://sparql.xyz/facade-x/ns/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xyz: <http://sparql.xyz/facade-x/data/>

SELECT *
WHERE
{ SERVICE <x-sparql-anything:>
{
SERVICE <x-sparql-anything:>
{ 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
}
}

0 comments on commit 855e762

Please sign in to comment.