eclipse-rdf4j / rdf4j

Eclipse RDF4J: scalable RDF for Java
https://rdf4j.org/
BSD 3-Clause "New" or "Revised" License
368 stars 164 forks source link

Advanced query builder #496

Closed abrokenjester closed 6 years ago

abrokenjester commented 8 years ago

(Migrated from https://openrdf.atlassian.net/browse/SES-1065)

Currently, (SPARQL) queries are creating by inputting a full SPARQL query string and parsing it to produce a query algebra expression. An alternative way to build queries programmatically would be useful, for example a fluent-style builder object where one can do things like this:

TupleQuery query = new QueryBuilder.addSelect("x") .addTriple(String s, String p, String o) .addFilter(); ...etc.

abrokenjester commented 7 years ago

A partial implementation of a QueryBuilder exists in RDF4J, but it is incomplete (only supporting SPARQL 1.0 features), and underdocumented and therefore somewhat hard to use. We could choose to either implement a new QueryBuilder from scratch, or extend/improve the existing builder to be easier to use and support more complex queries.

abrokenjester commented 6 years ago

Supersed by #979