# Built-in Functions

Copyright © 2010 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, and document use rules apply.

## Abstract

This page describes W3C SPARQL Working Group's SPARQL 1.1 test suite.

### Contributing Tests

The test manifests and entries are built automatically from manifest.ttl using a Rake task. Tests may be contributed via pull request to https://github.com/w3c/rdf-tests with suitable changes to the manifest.ttl and referenced files.

### Distribution

Distributed under both the W3C Test Suite License and the W3C 3-clause BSD License. To contribute to a W3C Test Suite, see the policies and contribution forms.

### Disclaimer

UNDER BOTH MUTUALLY EXCLUSIVE LICENSES, THIS DOCUMENT AND ALL DOCUMENTS, TESTS AND SOFTWARE THAT LINK THIS STATEMENT ARE PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.

## Test Descriptions

strdt01: STRDT()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    strdt01.srx
strdt02: STRDT(STR())
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    strdt02.srx
strdt03-rdf11: STRDT() TypeErrors (updated for RDF 1.1)
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    strdt03-rdf11.srx
strlang01: STRLANG()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    strlang01.srx
strlang02: STRLANG(STR())
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    strlang02.srx
strlang03-rdf11: STRLANG() TypeErrors (updated for RDF 1.1)
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    strlang03-rdf11.srx
isnumeric01: isNumeric()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    isnumeric01.srx
abs01: ABS()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    abs01.srx
ceil01: CEIL()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    ceil01.srx
floor01: FLOOR()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    floor01.srx
round01: ROUND()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    round01.srx
concat01: CONCAT()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    concat01.srx
concat02: CONCAT() 2
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    concat02.srx
concat-empty: CONCAT() without parameter
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    concat-empty.srx
concat-single: CONCAT() with a single parameter
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    concat-single.srx
substring01: SUBSTR() (3-argument)
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    substring01.srx
substring01-non-bmp: SUBSTR() (3-argument) on non-BMP unicode strings
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    substring01-non-bmp.srx
substring02: SUBSTR() (2-argument)
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    substring02.srx
substring02-non-bmp: SUBSTR() (2-argument) on non-BMP unicode strings
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    substring02-non-bmp.srx
length01: STRLEN()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    length01.srx
length01-non-bmp: STRLEN() on non-BMP unicode strings
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    length01-non-bmp.srx
ucase01: UCASE()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    ucase01.srx
ucase01-non-bmp: UCASE() on non-BMP unicode strings
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    ucase01-non-bmp.srx
lcase01: LCASE()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    lcase01.srx
lcase01-non-bmp: LCASE() on non-BMP unicode strings
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    lcase01-non-bmp.srx
encode01: ENCODE_FOR_URI()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    encode01.srx
encode01-non-bmp: ENCODE_FOR_URI() on non-BMP unicode strings
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    encode01-non-bmp.srx
contains01: CONTAINS()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    contains01.srx
starts01: STRSTARTS()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    starts01.srx
ends01: STRENDS()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    ends01.srx
plus-1-corrected: plus-1-corrected

  plus operator on ?x + ?y on string and numeric values

  type
    mf:QueryEvaluationTest
  approval
  action
  result
    plus-1.srx
plus-2-corrected: plus-2-corrected

  plus operator in combination with str(), i.e. str(?x) + str(?y), on string and numeric values

  type
    mf:QueryEvaluationTest
  approval
  action
  result
    plus-2.srx
md5-01: MD5()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    md5-01.srx
md5-02: MD5() over Unicode data
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    md5-02.srx
sha1-01: SHA1()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    sha1-01.srx
sha1-02: SHA1() on Unicode data
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    sha1-02.srx
sha256-01: SHA256()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    sha256-01.srx
sha256-02: SHA256() on Unicode data
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    sha256-02.srx
sha512-01: SHA512()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    sha512-01.srx
sha512-02: SHA512() on Unicode data
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    sha512-02.srx
minutes: MINUTES()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    minutes-01.srx
seconds: SECONDS()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    seconds-01.srx
hours: HOURS()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    hours-01.srx
month: MONTH()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    month-01.srx
year: YEAR()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    year-01.srx
day: DAY()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    day-01.srx
timezone: TIMEZONE()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    timezone-01.srx
tz: TZ()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    tz-01.srx
bnode01: BNODE(str)
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    bnode01.srx
bnode02: BNODE()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    bnode02.srx
in01: IN 1
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    in01.srx
in02: IN 2
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    in02.srx
notin01: NOT IN 1
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    notin01.srx
notin02: NOT IN 2
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    notin02.srx
now01: NOW()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    now01.srx
rand01: RAND()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    rand01.srx
iri01: IRI()/URI()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    iri01.srx
if01: IF()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    if01.srx
if02: IF() error propogation
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    if02.srx
coalesce01: COALESCE()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    coalesce01.srx
strbefore01a: STRBEFORE()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    strbefore01a.srx
strbefore02: STRBEFORE() datatyping
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    strbefore02.srx
strafter01a: STRAFTER()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    strafter01a.srx
strafter02: STRAFTER() datatyping
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    strafter02.srx
replace01: REPLACE()
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    replace01.srx
replace02: REPLACE() with overlapping pattern
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    replace02.srx
replace03: REPLACE() with captured substring
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    replace03.srx
uuid01: UUID() pattern match
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    uuid01.srx
uuid02: UUID() per binding

  UUID() calls generate results per invocation, not per query

  type
    mf:QueryEvaluationTest
  approval
  action
  result
    uuid02.srx
struuid01: STRUUID() pattern match
  type
    mf:QueryEvaluationTest
  approval
  action
  result
    struuid01.srx