Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SPARQL Extensions

Owl Datatypes

Native support for the owl:real and owl:rational datatypes. This includes the support for comparison and arithmetic operations that involve these datatypes.

Trigonometric and exponential functions

We implement all Trigonometric and exponential functions from XPath and XQuery Functions and Operators 3.1. These functions accept input that are convertible to xsd:double. Following the XPath 3.1 specs, the output of these functions is always xsd:double.

The table below provides an overview of the trigonometric and exponential functions.

Function
Meaning
PI()Returns an approximation to the mathematical constant π.
EXP(?x)Returns the value of ex.
EXP10(?x)Returns the value of 10x.
LOG(?arg)Returns the natural logarithm of the argument.
LOG10(?arg)Returns the base-ten logarithm of the argument.
POW(?x, ?y)Returns the value of xy.
SQRT(?arg)Returns the non-negative square root of the argument.
SIN(?θ)Returns the sine of the argument. The argument is an angle in radians.
COS(?θ)Returns the cosine of the argument. The argument is an angle in radians.
TAN(?θ)Returns the tangent of the argument. The argument is an angle in radians.
ASIN(?arg)Returns the arc sine of the argument.
ACOS(?arg)Returns the arc cosine of the argument.
ATAN(?arg)Returns the arc tangent of the argument.
ATAN2(?y, ?x)Returns the angle in radians subtended at the origin by the point on a plane with coordinates (x, y) and the positive x-axis.

Extensions Of Operations

The SPARQL standard allows implementations to extend the capabilities of operations (e.g., <, + and =). As described here, these extensions lead to FILTER expressions potentially producing additional results.

Examples of operations that involve extended operations are provided below

Extended comparison operations

xsd:date > xsd:date => xsd:boolean
xsd:duration != xsd:duration => xsd:boolean
owl:real < owl:real => xsd:boolean

Extended arithmetic operations on date and time types

xsd:date - xsd:date => xsd:dayTimeDuration
xsd:dayTimeDuration / xsd:int => xsd:dayTimeDuration

The extended capabilities of the operators are detailed in the chapter Extensions of Operators.

Note: These extensions do not discard any of the expected results.

DESCRIBE Queries

Tentris implements two algorithms for the evaluation DESCRIBE queries.

  • DESCRIBE / DESCRIBE DIRECT
DESCRIBE <http://www.example.org/entity>
DESCRIBE DIRECT <http://www.example.org/entity>

Both queries provided above return the triples of the underlying knowledge graph that have <http://www.example.org/entity> as their subject.

  • DESCRIBE CBD
DESCRIBE CBD <http://www.example.org/entity>

The query provided above returns the Consise Bounded Description of <http://www.example.org/entity>.