You're right; my mistake. Correcting the typo doesn't affect the error,
though.
Chris
On 7/14/2016 10:47 AM, A. Soroka wrote:
I don't quite see how this would cause the problem, but I do note that of the three bindings in
your code below, the first is _not_ to "s" (as you say in your description), but to
"o".
---
A. Soroka
The University of Virginia Library
On Jul 14, 2016, at 12:09 PM, Chris Jones <[email protected]> wrote:
I'm building a simple query of the form "?s ?p1 / ?p2 ?o" and binding s, p1,
and p2 using QuerySolutionMap. I get this error back:
Exception in thread "main" org.apache.jena.query.QueryParseException: Encountered " "/"
"/ "" at line 1, column 26.
Here's the code that reproduces the error, using Jena 3.1.0:
package org.cjones.test;
import org.apache.jena.query.*;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.tdb.TDBFactory;
public class Test {
public static void main(String[] args) {
Dataset dataset = TDBFactory.createDataset("db");
String queryStr ="select ?o where { ?s ?p1 / ?p2 ?o }";
QuerySolutionMap bindings =new QuerySolutionMap();
bindings.add("o",
ResourceFactory.createResource("http://example.com/Alice"));
bindings.add("p1",
ResourceFactory.createResource("http://example.com/boss"));
bindings.add("p2",
ResourceFactory.createResource("http://example.com/givenName"));
dataset.begin(ReadWrite.READ);
QueryExecution qe = QueryExecutionFactory.create(queryStr, dataset,
bindings);
ResultSet rs = qe.execSelect();
// ... dataset.end();
}
}
I don't think I'm doing anything wrong, am I?
Chris