Skip to content

Extending the lists of expected functions taken from new versions of XPath and XQuery

JervenBolleman edited this page Sep 25, 2019 · 22 revisions

The new functions in XPath 3.1 The issues in our issue tracker 55 and 32

Function SPARQL 1.1 Candidate Note
Accessors
fn:node-name x NO nodes are not a relevant concept
fn:func-nilled x NO closed is just a UNDEF value
fn:func-string STR? NO STR is the appropriate adaptation
fn:data x NO does not seem to apply
fn:base-uri x NO While there is a BASE in the query string there is no BASE concept for a Triple Store
fn:document-uri X NO
Errors and diagnostics
fn:error
fn:trace
Functions and operators on numerics
Arithmetic operators on numeric values ------------- -------------
op:numeric-add A+B
op:numeric-subtract A-B
op:numeric-multiply A*B
op:numeric-divide A/B numeric; but xsd:decimal if both operands are xsd:integer
op:numeric-integer-divide
op:numeric-mod X YES
op:numeric-unary-plus +A
op:numeric-unary-minus -+
Comparison operators on numeric values ------------- -------------
op:numeric-equal
op:numeric-less-than
op:numeric-greater-than
Functions on numeric values ------------- -------------
fn:abs
fn:ceiling
fn:floor
fn:round
fn:round-half-to-even
Parsing numbers values ------------- -------------
fn:number
Formatting integers ------------- -------------
Formatting numbers ------------- -------------
fn:format-number
Trigonometric and exponential functions
math:pi x YES See proto spec
math:exp x YES See proto spec
math:exp10 x YES See proto spec
math:log x YES See proto spec
math:log10 x YES See proto spec
math:pow x YES See proto spec
math:sqrt x YES See proto spec
math:sin x YES See proto spec
math:cos x YES See proto spec
math:tan x YES
math:asin x YES
math:acos x YES
math:atan x YES
math:atan2
Random Numbers
fn:random-number-generator
Functions on strings
fn:codepoints-to-string
fn:string-to-codepoints
fn:compare
fn:codepoint-equal
fn:collation-key
fn:contains-token
fn:concat CONCAT
fn:string-join GROUP_CONCAT Depends on multi return functions if this needs to be added elsewhere in some way.
fn:substring SUBSTR
fn:string-length STRLEN
fn:normalize-space x
fn:normalize-unicode x
fn:upper-case UCASE
fn:lower-case LCASE
fn:translate x
fn:contains CONTAINS
fn:starts-with STRSTARTS
fn:ends-with STRENDS
fn:substring-before STRBEFORE
fn:substring-after STRAFTER
fn:matches REGEX
fn:replace REPLACE
fn:tokenize x
fn:analyze-string x
Functions that manipulate URIs
fn:resolve-uri x YES
fn:encode-for-uri ENCODE_FOR_URI
fn:iri-to-uri x
fn:escape-html-uri x