streamreasoning / rsp4j

RSP4J a library for RDF Stream Processing
Apache License 2.0
31 stars 12 forks source link

Exception when streaming triple having data value as double #14

Closed rahuldh2006 closed 2 years ago

rahuldh2006 commented 2 years ago

In RSP4J when we stream triple having data value as double, as shown below, we get an exception. Please note that we observe this exception when the data value is part of the select query result.

Query: SELECT ?s ?p ?o from stream http://test/stream [RANGE 10s STEP 1s] WHERE { ?s ?p ?o }

Relevant code fragment : graph.add(instance.createTriple(instance.createIRI("http://test#S1"), instance.createIRI("http://test#hasValue"), rdf.createLiteral("56.1519", Types.XSD_DOUBLE))); OR graph.add(instance.createTriple(instance.createIRI("http://test#S1"), instance.createIRI("http://test#hasValue"), rdf.createLiteral("56.1519", instance.createIRI("http://www.w3.org/2001/XMLSchema#double"))));

Exception: [com.espertech.esper.Timer-default-1] ERROR com.espertech.esper.core.StatementResultServiceImpl - Unexpected exception invoking listener update method on listener class 'QueryListener' : IllegalArgumentException : Illegal character in path at index 0: "56.1519"^^null java.lang.IllegalArgumentException: Illegal character in path at index 0: "56.1519"^^null at java.base/java.net.URI.create(URI.java:906) at org.apache.commons.rdf.simple.IRIImpl.(IRIImpl.java:33) at org.apache.commons.rdf.simple.SimpleRDF.createIRI(SimpleRDF.java:82) at org.streamreasoning.rsp4j.api.RDFUtils.createIRI(RDFUtils.java:48) at org.streamreasoning.rsp4j.csparql.CSPARQLEngineRSP4J$WrappedSelectListener.update(CSPARQLEngineRSP4J.java:120)

As debugging showed, the problem seems to be in repository/com/github/pbonte/CSPARQL-engine/csparql-sparql-jena/0.9.5.1-pomfix/csparql-sparql-jena-0.9.5.1-pomfix.jar!/eu/larkc/csparql/sparql/jena/JenaEngine.class in evaluateQuery function that is called by repository/com/github/pbonte/CSPARQL-engine/csparql-core/0.9.5.1-pomfix/csparql-core-0.9.5.1-pomfix.jar!/eu/larkc/csparql/core/engine/CsparqlEngineImpl.class in update function on line 437 (RDFTable result = this.sparqlEngine.evaluateQuery(csparqlquery.getSparqlQuery());)

pbonte commented 2 years ago

This should be solved now