Re: adding an expression to a Query

2020-12-18 Thread Erich Bremer
Saw ExpreUtil.parse and stopped reading. Used the second part of your email and it worked fine. TGIF On Fri, Dec 18, 2020 at 2:17 PM Erich Bremer wrote: > Using this will throw a "Exception in thread "main" > org.apache.jena.query.QueryParseException: Line 1, column 2: Aggregate > expression n

Re: adding an expression to a Query

2020-12-18 Thread Erich Bremer
Using this will throw a "Exception in thread "main" org.apache.jena.query.QueryParseException: Line 1, column 2: Aggregate expression not legal at this point". So you may be right to use a query builder :-) On Fri, Dec 18, 2020 at 1:29 PM Andy Seaborne wrote: > > > On 18/12/2020 18:04, Erich Br

Re: adding an expression to a Query

2020-12-18 Thread Andy Seaborne
On 18/12/2020 18:04, Erich Bremer wrote: How would one create an Expr in order to add an expression like this: SPARQLParser p = SPARQLParser.createParser(Syntax.syntaxSPARQL_11); Query query = new Query(); p.parse(query, "select ?year where {?s :Year ?year; :Fruit ?fruit} group by ?year order

adding an expression to a Query

2020-12-18 Thread Erich Bremer
How would one create an Expr in order to add an expression like this: SPARQLParser p = SPARQLParser.createParser(Syntax.syntaxSPARQL_11); Query query = new Query(); p.parse(query, "select ?year where {?s :Year ?year; :Fruit ?fruit} group by ?year order by ?year"); query.addResultVar("fruits","(cou