I have two queries with variable bindings (running in python with pystardog).
The first has only numeric values for the bound variables and works correctly. The following returns an error that the bound value is malformed. Here is the query:
PREFIX : <urn:xxx:ontology:>
SELECT ?propValue WHERE {
BIND(IRI(CONCAT("urn:xxx:ontology:", ?prop)) as ?predicate) .
?s ?predicate ?propValue } LIMIT 10
And the binding:
encoder = json.JSONEncoder()
queryBindings = encoder.encode({ "prop": "foo" })
And, here is the dump from the stardog.log:
WARN 2020-06-23 15:40:55,075 [stardog-user-3] com.complexible.stardog.protocols.http.server.StardogUndertowErrorHandler:accept(64): Unexpected exception was handled by the server
java.lang.IllegalArgumentException: The query binding 'foo' is a malformed Turtle value
at com.complexible.stardog.protocols.http.server.ProtocolUtils.parseValue(ProtocolUtils.java:979) ~[stardog-protocols-http-server-7.3.1.jar:?]
at com.complexible.stardog.protocols.http.server.ProtocolUtils.lambda$parseQuery$22(ProtocolUtils.java:967) ~[stardog-protocols-http-server-7.3.1.jar:?]
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:1.8.0_252]
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_252]
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_252]
at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:419) ~[?:1.8.0_252]
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647) ~[?:1.8.0_252]
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:272) ~[?:1.8.0_252]
at java.util.TreeMap$EntrySpliterator.forEachRemaining(TreeMap.java:2969) ~[?:1.8.0_252]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_252]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_252]
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:1.8.0_252]
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:1.8.0_252]
Obviously, I am missing something obvious. What is it?
Andrea