I got the answer from Jena list - turns out I needed the following:

QueryFactory.create(sparql, Syntax.syntaxARQ);

since ARQ 2.7.0  had SPARQL 1.0 as default

On Fri, May 6, 2011 at 2:49 PM, Dmitriy Fradkin <[email protected]> wrote:
> Hello,
>
> I have a SPARQL query that works fine when I use it in SNORQL,
> but does not work when I try to send it via Java API. The error seems
> to suggest that SPARQL is somehow not correct.
> I have other (simpler) queries that run fin in both, so my setup seems ok.
> Below is the query and the error. Any ideas on how to resolve this?
>
> Thanks in advance,
> - Dmitriy
>
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> PREFIX db: <http://localhost:2020/resource/>
> PREFIX owl: <http://www.w3.org/2002/07/owl#>
> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
> PREFIX map: <file:/C:/home/projects/d2r-server-0.7/outfile.n3#>
> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX vocab: <http://localhost:2020/vocab/resource/>
>
>  select distinct ?A WHERE {
> { select ?A (count(?B) AS ?Var0) WHERE
>  { ?B vocab:Notification_machine ?A . } group by ?A }
>  FILTER (?Var0 > 3.0) }
>  LIMIT 10
>
> Exception in thread "main" com.hp.hpl.jena.query.QueryParseException:
> Encountered " "select" "select "" at line 10, column 3.
> Was expecting one of:
>    <IRIref> ...
>    <PNAME_NS> ...
>    <PNAME_LN> ...
>    <BLANK_NODE_LABEL> ...
>    <VAR1> ...
>    <VAR2> ...
>    "graph" ...
>    "optional" ...
>    "filter" ...
>    "true" ...
>    "false" ...
>    <INTEGER> ...
>    <DECIMAL> ...
>    <DOUBLE> ...
>    <INTEGER_POSITIVE> ...
>    <DECIMAL_POSITIVE> ...
>    <DOUBLE_POSITIVE> ...
>    <INTEGER_NEGATIVE> ...
>    <DECIMAL_NEGATIVE> ...
>    <DOUBLE_NEGATIVE> ...
>    <STRING_LITERAL1> ...
>    <STRING_LITERAL2> ...
>    <STRING_LITERAL_LONG1> ...
>    <STRING_LITERAL_LONG2> ...
>    "(" ...
>    <NIL> ...
>    "{" ...
>    "}" ...
>    "[" ...
>    <ANON> ...
>
>        at 
> com.hp.hpl.jena.sparql.lang.ParserSPARQL.perform(ParserSPARQL.java:86)
>        at com.hp.hpl.jena.sparql.lang.ParserSPARQL.parse(ParserSPARQL.java:39)
>        at com.hp.hpl.jena.query.QueryFactory.parse(QueryFactory.java:129)
>        at com.hp.hpl.jena.query.QueryFactory.create(QueryFactory.java:72)
>        at com.hp.hpl.jena.query.QueryFactory.create(QueryFactory.java:43)
>        at com.hp.hpl.jena.query.QueryFactory.create(QueryFactory.java:31)

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
d2rq-map-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to