W3C

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
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
strdt01.rq
data
data.ttl
result
strdt01.srx
strdt02: STRDT(STR())
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
strdt02.rq
data
data.ttl
result
strdt02.srx
strdt03-rdf11: STRDT() TypeErrors (updated for RDF 1.1)
type
mf:QueryEvaluationTest
approval
dawgt:Proposed
action
query
strdt03.rq
data
data.ttl
result
strdt03-rdf11.srx
strlang01: STRLANG()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
strlang01.rq
data
data.ttl
result
strlang01.srx
strlang02: STRLANG(STR())
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
strlang02.rq
data
data.ttl
result
strlang02.srx
strlang03-rdf11: STRLANG() TypeErrors (updated for RDF 1.1)
type
mf:QueryEvaluationTest
approval
dawgt:Proposed
action
query
strlang03.rq
data
data.ttl
result
strlang03-rdf11.srx
isnumeric01: isNumeric()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
isnumeric01.rq
data
data.ttl
result
isnumeric01.srx
abs01: ABS()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
abs01.rq
data
data.ttl
result
abs01.srx
ceil01: CEIL()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
ceil01.rq
data
data.ttl
result
ceil01.srx
floor01: FLOOR()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
floor01.rq
data
data.ttl
result
floor01.srx
round01: ROUND()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
round01.rq
data
data.ttl
result
round01.srx
concat01: CONCAT()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
concat01.rq
data
data.ttl
result
concat01.srx
concat02: CONCAT() 2
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
concat02.rq
data
data2.ttl
result
concat02.srx
concat-empty: CONCAT() without parameter
type
mf:QueryEvaluationTest
approval
action
query
concat-empty.rq
data
data.ttl
result
concat-empty.srx
concat-single: CONCAT() with a single parameter
type
mf:QueryEvaluationTest
approval
action
query
concat-single.rq
data
data.ttl
result
concat-single.srx
substring01: SUBSTR() (3-argument)
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
substring01.rq
data
data.ttl
result
substring01.srx
substring01-non-bmp: SUBSTR() (3-argument) on non-BMP unicode strings
type
mf:QueryEvaluationTest
approval
dawgt:Proposed
action
query
substring01.rq
data
data5.ttl
result
substring01-non-bmp.srx
substring02: SUBSTR() (2-argument)
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
substring02.rq
data
data.ttl
result
substring02.srx
substring02-non-bmp: SUBSTR() (2-argument) on non-BMP unicode strings
type
mf:QueryEvaluationTest
approval
dawgt:Proposed
action
query
substring02.rq
data
data5.ttl
result
substring02-non-bmp.srx
length01: STRLEN()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
length01.rq
data
data.ttl
result
length01.srx
length01-non-bmp: STRLEN() on non-BMP unicode strings
type
mf:QueryEvaluationTest
approval
dawgt:Proposed
action
query
length01.rq
data
data5.ttl
result
length01-non-bmp.srx
ucase01: UCASE()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
ucase01.rq
data
data.ttl
result
ucase01.srx
ucase01-non-bmp: UCASE() on non-BMP unicode strings
type
mf:QueryEvaluationTest
approval
dawgt:Proposed
action
query
ucase01.rq
data
data5.ttl
result
ucase01-non-bmp.srx
lcase01: LCASE()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
lcase01.rq
data
data.ttl
result
lcase01.srx
lcase01-non-bmp: LCASE() on non-BMP unicode strings
type
mf:QueryEvaluationTest
approval
dawgt:Proposed
action
query
lcase01.rq
data
data5.ttl
result
lcase01-non-bmp.srx
encode01: ENCODE_FOR_URI()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
encode01.rq
data
data.ttl
result
encode01.srx
encode01-non-bmp: ENCODE_FOR_URI() on non-BMP unicode strings
type
mf:QueryEvaluationTest
approval
dawgt:Proposed
action
query
encode01.rq
data
data5.ttl
result
encode01-non-bmp.srx
contains01: CONTAINS()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
contains01.rq
data
data.ttl
result
contains01.srx
starts01: STRSTARTS()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
starts01.rq
data
data.ttl
result
starts01.srx
ends01: STRENDS()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
ends01.rq
data
data.ttl
result
ends01.srx
plus-1-corrected: plus-1-corrected

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

type
mf:QueryEvaluationTest
approval
dawgt:Proposed
action
query
plus-1-corrected.rq
data
data-builtin-3.ttl
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
dawgt:Proposed
action
query
plus-2-corrected.rq
data
data-builtin-3.ttl
result
plus-2.srx
md5-01: MD5()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
md5-01.rq
data
data.ttl
result
md5-01.srx
md5-02: MD5() over Unicode data
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
md5-02.rq
data
data.ttl
result
md5-02.srx
sha1-01: SHA1()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
sha1-01.rq
data
data.ttl
result
sha1-01.srx
sha1-02: SHA1() on Unicode data
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
sha1-02.rq
data
hash-unicode.ttl
result
sha1-02.srx
sha256-01: SHA256()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
sha256-01.rq
data
data.ttl
result
sha256-01.srx
sha256-02: SHA256() on Unicode data
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
sha256-02.rq
data
hash-unicode.ttl
result
sha256-02.srx
sha384-01: SHA384()
type
mf:QueryEvaluationTest
approval
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
sha384-01.rq
data
data.ttl
result
sha384-01.srx
sha384-02: SHA384() on Unicode data
type
mf:QueryEvaluationTest
approval
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
sha384-02.rq
data
hash-unicode.ttl
result
sha384-02.srx
sha512-01: SHA512()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
sha512-01.rq
data
data.ttl
result
sha512-01.srx
sha512-02: SHA512() on Unicode data
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
sha512-02.rq
data
hash-unicode.ttl
result
sha512-02.srx
minutes: MINUTES()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
minutes-01.rq
data
data.ttl
result
minutes-01.srx
seconds: SECONDS()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
seconds-01.rq
data
data.ttl
result
seconds-01.srx
hours: HOURS()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
hours-01.rq
data
data.ttl
result
hours-01.srx
month: MONTH()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
month-01.rq
data
data.ttl
result
month-01.srx
year: YEAR()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
year-01.rq
data
data.ttl
result
year-01.srx
day: DAY()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
day-01.rq
data
data.ttl
result
day-01.srx
timezone: TIMEZONE()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
timezone-01.rq
data
data.ttl
result
timezone-01.srx
tz: TZ()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
tz-01.rq
data
data.ttl
result
tz-01.srx
bnode01: BNODE(str)
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
bnode01.rq
data
data.ttl
result
bnode01.srx
bnode02: BNODE()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
bnode02.rq
data
data.ttl
result
bnode02.srx
in01: IN 1
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
in01.rq
data
data.ttl
result
in01.srx
in02: IN 2
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
in02.rq
data
data.ttl
result
in02.srx
notin01: NOT IN 1
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
notin01.rq
data
data.ttl
result
notin01.srx
notin02: NOT IN 2
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
notin02.rq
data
data.ttl
result
notin02.srx
now01: NOW()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
now01.rq
data
data.ttl
result
now01.srx
rand01: RAND()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
rand01.rq
data
data.ttl
result
rand01.srx
iri01: IRI()/URI()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
iri01.rq
data
data.ttl
result
iri01.srx
iri02: IRI()/URI() when the input is an IRI
type
mf:QueryEvaluationTest
approval
action
query
iri02.rq
data
data.ttl
result
iri02.srx
if01: IF()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
if01.rq
data
data2.ttl
result
if01.srx
if02: IF() error propogation
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
if02.rq
data
data2.ttl
result
if02.srx
coalesce01: COALESCE()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
coalesce01.rq
data
data-coalesce.ttl
result
coalesce01.srx
coalesce-empty: COALESCE() without arguments
type
mf:QueryEvaluationTest
approval
action
query
coalesce-empty.rq
data
data-coalesce.ttl
result
coalesce-empty.srx
strbefore01a: STRBEFORE()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-08-07#resolution_2
action
query
strbefore01.rq
data
data2.ttl
result
strbefore01a.srx
strbefore02: STRBEFORE() datatyping
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-08-07#resolution_2
action
query
strbefore02.rq
data
data4.ttl
result
strbefore02.srx
strafter01a: STRAFTER()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-08-07#resolution_2
action
query
strafter01.rq
data
data2.ttl
result
strafter01a.srx
strafter02: STRAFTER() datatyping
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-08-07#resolution_2
action
query
strafter02.rq
data
data4.ttl
result
strafter02.srx
replace01: REPLACE()
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
replace01.rq
data
data3.ttl
result
replace01.srx
replace02: REPLACE() with overlapping pattern
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
replace02.rq
data
data3.ttl
result
replace02.srx
replace03: REPLACE() with captured substring
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-01-31#resolution_3
action
query
replace03.rq
data
data3.ttl
result
replace03.srx
replace-case-insensitive: REPLACE() with the 'i' option
type
mf:QueryEvaluationTest
approval
action
query
replace-case-insensitive.rq
result
replace-case-insensitive.srx
uuid01: UUID() pattern match
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-08-07#resolution_2
action
query
uuid01.rq
data
data-empty.nt
result
uuid01.srx
uuid02: UUID() per binding

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

type
mf:QueryEvaluationTest
approval
dawgt:Proposed
action
query
uuid02.rq
data
data-empty.nt
result
uuid02.srx
struuid01: STRUUID() pattern match
type
mf:QueryEvaluationTest
approval
dawgt:Approved
approvedBy
http://www.w3.org/2009/sparql/meeting/2012-08-07#resolution_2
action
query
struuid01.rq
data
data-empty.nt
result
struuid01.srx