On Fri, Sep 20, 2013 at 1:09 PM, Andy Seaborne <[email protected]> wrote:
> On 20/09/13 17:55, Joshua TAYLOR wrote:
>>
>> According to arq --help, there's a --strict option:
>>
>> --strict Operate in strict SPARQL mode (no
>> extensions of any kind)
>>
>> However, ARQ doesn't complain about <p>{2}
>>
>> $ arq --strict --data empty.n3 "select * where { ?s <p>{2} ?o }"
>> ---------
>> | s | o |
>> =========
>> ---------
>
>
> Try the "sparql" command:
>
> sparql --strict --data empty.n3 "select * where { ?s <p>{2} ?o }"
>
> "arq" implies the extended language and "--strict" really refers to
> execution semantics. "arq --strict" could be made to be (strict) SPARQL
> 1.1.
sparql doesn't choke on <p>{2} either:
$ sparql --data empty.n3 "select * where { ?s <p>{2} ?o }"
---------
| s | o |
=========
---------
> Actually "sparql" and "arq" are trival front ends to a command called
> "query".
Yes, I was actually digging through the source looking for valid
arguments to pass as the --syntax argument, hoping that I might be
able to specify Syntax.syntaxSPARQL_11 and get strict SPARQL 1.1
parsing. Cf. the ARQ documentation [1] which mention "These features
require the query to be parsed with an explicit declaration of
Syntax.syntaxARQ" and the Syntax class [2] which has a member
syntaxARQ. However, passing Syntax.syntaxSPARQL_11 as a syntax doesn't
work:
$ arq --syntax Syntax.syntaxSPARQL_11 --data empty.n3 "select * where
{ ?s <p>{2} ?o }"
Unrecognized syntax: Syntax.syntaxSPARQL_11
I think there's enough here for a JIRA (which I'll open up sometime
today). In the meantime, though, is there any way to get arq or
sparql to reject the query using the elt{n} syntax that didn't make it
into the SPARQL 1.1 recommendation? There do seem to be ways to make
this happen, as this question [3] on answers.semanticweb.com found
that the validator at sparql.org (correctly) rejects dc:title{2}.
//JT
[1] http://jena.apache.org/documentation/query/
[2]
http://jena.apache.org/documentation/javadoc/arq/com/hp/hpl/jena/query/Syntax.html
[3]
http://answers.semanticweb.com/questions/17595/sparqler-query-validator-not-up-to-date
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/