d2rq で生成された ttl ファイルからクエリを実行しようとしています。以下は私のコードスニペットです:
ModelD2RQ m = new ModelD2RQ("file:C:\\Users\\599782\\Downloads\\d2rq-0.8.1\\northwind.ttl");
String sparql =
"PREFIX vocab: <http://localhost:2020/resource/vocab/>" +
"select ?firstname ?lastname where{"+
"?x vocab:employees_Country 'USA'."+
"?x vocab:employees_FirstName ?firstname."+
"?x vocab:employees_LastName ?lastname."+
"}";
Query q = QueryFactory.create(sparql);
ResultSet rs = QueryExecutionFactory.create(q, m).execSelect();
ResultSetFormatter.out(System.out, rs, q);
m.close();
そして、それはこの例外を示しています:
Exception in thread "main" java.lang.IncompatibleClassChangeError: Class com.hp.hpl.jena.sparql.algebra.op.OpProject does not implement the requested interface org.openjena.atlas.io.Printable
at org.openjena.atlas.io.PrintUtils.toString(PrintUtils.java:28)
at de.fuberlin.wiwiss.d2rq.engine.QueryEngineD2RQ.translate(QueryEngineD2RQ.java:70)
at de.fuberlin.wiwiss.d2rq.engine.QueryEngineD2RQ.modifyOp(QueryEngineD2RQ.java:60)
at com.hp.hpl.jena.sparql.engine.QueryEngineBase.createPlan(QueryEngineBase.java:94)
at com.hp.hpl.jena.sparql.engine.QueryEngineBase.getPlan(QueryEngineBase.java:87)
at de.fuberlin.wiwiss.d2rq.engine.QueryEngineD2RQ$QueryEngineFactoryD2RQ.create(QueryEngineD2RQ.java:110)
at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.getPlan(QueryExecutionBase.java:513)
at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.startQueryIterator(QueryExecutionBase.java:490)
at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execResultSet(QueryExecutionBase.java:498)
at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:194)
at com.jenaproj.HelloJena.main(HelloJena.java:159)
何が起こっているのか誰でも知っています。