SPARQL/Extensions/Selecting Expressions

From W3C Wiki
Jump to: navigation, search

SQL allows for arbitrary expressions to be projected out of a query. These expressions can be simple values from source data or functions on both source data and constant values. The SPARQL specification does not allow this, but it is a commonly requested feature.

There is a bit of a discussion of approaches to selecting arbitrary expressions in both SELECT clauses and CONSTRUCT templates in the comments of Andy Seaborne's post on aggregates in ARQ. An article on RAP's new SPARQL engine contains a section (4.3) showing examples of arbitrary expressions in a SELECT clause.

Note that some implementations support selecting expressions limited to a particular set of aggregate functions. These implementation approaches are discussed on the SPARQL aggregates page.