Skip to content

Inventory of existing extensions to SPARQL 1.1

Andy Seaborne edited this page Apr 4, 2019 · 30 revisions

An inventory of existing extensions

Eclipse RDF4J

less strict datatype restrictions in comparison operators

Example:

FILTER("1999"^^xsd:gYear < "2009-01-01T20:20:20Z"^^xsd:dateTime) => true (strict semantics is type error)

extended mathematics operations on date/time/duration datatypes

Examples:

"2013-11"^^xsd:gYearMonth + "P1Y1M"^^xsd:yearMonthDuration => "P2Y1M"^^xsd:yearMonthDuration
"12"^^xsd:Integer * "P1Y"^^:xsd:yearMonthDuration => "P12Y"^^xsd:yearMonthDuration

GeoSPARQL operators

See GeSPARQL specs

full-text search extensions

Example:

?subj search:matches [
          search:query "search terms...";
          search:property my:property;
          search:score ?score;
          search:snippet ?snippet ] .

Apache Jena

Property Functions

Example:

?segment apf:strSplit (?s ", ")

This is covered by issue 6.

The list syntax is reused to become multiple arguments/results for the operation.

CONSTRUCT quads

https://jena.apache.org/documentation/query/construct-quad.html

CONSTRUCT {
    GRAPH :g { ?s :p ?o }
    :s ?p :o
} WHERE {  ... }

Generate JSON

https://jena.apache.org/documentation/query/generate-json-from-sparql.html

JSON {
  "author": ?author, 
  "title": ?title 
} WHERE { ... }

Dynamic function call

BIND(CALL(?x, ?y) AS ?z)

See issue #20

Statistics Aggregators

STDEV, STDEV_SAMP, STDEV_POP, ``VARIANCE, VAR_SAMP`, `VAR_POP` following the SQL operations.