Oh good. I was hoping there was just something I wasn't seeing. I didn't know that SPARQL 1.1 required aggregates with no alias.
Thanks Damian!! ----- Original Message ----- > From: Damian Steer <[email protected]> > To: [email protected]; Tim Harsch <[email protected]> > Cc: > Sent: Friday, September 23, 2011 5:09 PM > Subject: Re: Syntax.SPARQL_11 doesn't recognize COUNT > > > On 24 Sep 2011, at 00:04, Tim Harsch wrote: > >> I'm trying to create some code that will tell me if a query is SPARQL > 1.1 or SPARQL 1.0 by first parsing with the 1.0 parser and failing that parse > with the 1.1 parser. But the following fails: >> >> >> QueryFactory.create("SELECT COUNT(*) {}",Syntax.syntaxSPARQL_11); >> >> com.hp.hpl.jena.query.QueryParseException: Encountered " > "count" "COUNT "" at line 1, column 8. >> Was expecting one of: >> <VAR1> ... >> <VAR2> ... >> "distinct" ... >> "reduced" ... >> "(" ... >> "*" ... >> >> at > com.hp.hpl.jena.sparql.lang.ParserSPARQL11.perform(ParserSPARQL11.java:87) >> <...SNIP...> >> > > Oops, I read your emails in the wrong order :-) > > You need (COUNT(*) AS ?count). > > Damian >
