Hi all, I think this is a bug. The first three of the following triple
patterns are parsed successfully, but the fourth throws a runtime
exception.successfully. I'm using Jena-2.6.4 which includes with
ARQ-2.8.7. Can anyone confirm or deny this (or tell me that I'm using
an outdated version, or point me to the existing bug report that I
didn't find on JIRA, &c ;))? Thanks, //JT
[] a :c; :p :o .
[] a :c; ^:p :o .
[ a :c ] :p :o .
[ a :c ] ^:p :o .
Exception in thread "main" com.hp.hpl.jena.query.QueryParseException:
Encountered " "^" "^ "" at line 1, column 62.
Was expecting one of:
<IRIref> ...
<PNAME_NS> ...
<PNAME_LN> ...
<VAR1> ...
<VAR2> ...
"a" ...
"graph" ...
"optional" ...
"minus" ...
"bind" ...
"service" ...
"filter" ...
"{" ...
"}" ...
"." ...
at
com.hp.hpl.jena.sparql.lang.ParserSPARQL11.perform(ParserSPARQL11.java:87)
at
com.hp.hpl.jena.sparql.lang.ParserSPARQL11.parse(ParserSPARQL11.java:40)
at com.hp.hpl.jena.query.QueryFactory.parse(QueryFactory.java:132)
at com.hp.hpl.jena.query.QueryFactory.create(QueryFactory.java:69)
at com.hp.hpl.jena.query.QueryFactory.create(QueryFactory.java:40)
at com.hp.hpl.jena.query.QueryFactory.create(QueryFactory.java:28)
Code to reproduce:
import com.hp.hpl.jena.query.QueryFactory;
class QueryBug {
public static void main( String[] args ) {
String prologue = "PREFIX :
<http://www.example.com/> SELECT * WHERE ";
// 1--3 are fine, but 4 throws an exception.
QueryFactory.create( prologue + "{ [] a :c; :p
:o . }" );
QueryFactory.create( prologue + "{ [] a :c; ^:p
:o . }" );
QueryFactory.create( prologue + "{ [ a :c ] :p
:o . }" );
QueryFactory.create( prologue + "{ [ a :c ] ^:p
:o . }" );
}
}
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/