0

I'm trying to use Sesame QueryBuilder to compose my queries in Java code. I had some success as can be seen in one of my answers related to this topic. The issue I'm facing right now is that the query builder seems to lack several useful functions, namely:

  • Aggregation functions in SELECTs (COUNT being an example)
  • HAVING clause

Given there isn't much documentation I might be just overlooking something. Any hints on how to build such queries would be much appreciated.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Jan Zyka
  • 17,460
  • 16
  • 70
  • 118

2 Answers2

2

The QueryBuilder in Sesame has not been updated to capture SPARQL 1.1 functionality, such as aggregates.

It's on the agenda, though we could use some additional hands. More generally, the QueryBuilder and QueryRenderer never really were developed beyond beta stage, which is why documentation is so sparse.

Of course, Sesame does support SPARQL 1.1 query and update, but for more advanced queries, you'll have to write the query string yourself - at least for now.

Jeen Broekstra
  • 21,642
  • 4
  • 51
  • 73
  • Ah, that's shame as I still didn't find some convenient way how to write queries in Java. The usual StringBuilder solution isn't nice :( Thanks for the update though – Jan Zyka Apr 26 '16 at 19:19
  • As said, if you want to help improve things, you'd be most welcome :) – Jeen Broekstra Apr 26 '16 at 22:26
  • @JanZyka not sure how I drop you a PM via StackOverflow but you can reach me via the [Sesame User group](https://groups.google.com/forum/?hl=en&fromgroups#!forum/sesame-users) :) – Jeen Broekstra Apr 28 '16 at 21:26
0

RDF4J, formerly Sesame, now includes a Sparql Builder, check out documentation here: http://docs.rdf4j.org/sparqlbuilder/

anqit
  • 780
  • 3
  • 12
  • try to highlight the keywords and be clear with the format it will help to reach out your answer for others While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. [how to answer](https://stackoverflow.com/help/how-to-answer) – Agilanbu Dec 07 '18 at 07:06