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

Reply via email to