SPARQL 1.1 Test Suite


ADD 1

Update evaluation test

Input Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

Update

add/add-01.ru
PREFIX : <http://example.org/>
ADD DEFAULT TO :g1

Result Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

ADD 2

Update evaluation test

Input Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

Update

add/add-01.ru
PREFIX : <http://example.org/>
ADD DEFAULT TO :g1

Result Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

ADD 3

Update evaluation test

Input Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g2

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :sue a foaf:Person . :sue foaf:givenName "Susan" . :sue foaf:mbox <mailto:sue@example.org> .

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

Update

add/add-03.ru
PREFIX : <http://example.org/>
ADD :g1 TO :g2

Result Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g2

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> . :sue a foaf:Person . :sue foaf:givenName "Susan" . :sue foaf:mbox <mailto:sue@example.org> .

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

ADD 4

Update evaluation test

Input Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

Update

add/add-03.ru
PREFIX : <http://example.org/>
ADD :g1 TO :g2

Result Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g2

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

ADD 5

Update evaluation test

Input Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

http://example.org/g3

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> . :john foaf:knows :sue .

Update

add/add-05.ru
PREFIX : <http://example.org/>
ADD :g1 TO :g3

Result Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

http://example.org/g3

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> . :john foaf:knows :sue .

ADD 6

Update evaluation test

Input Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

Update

add/add-06.ru
PREFIX : <http://example.org/>
ADD SILENT :g4 TO :g1

Result Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

ADD 7

Update evaluation test

Input Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

Update

add/add-07.ru
PREFIX : <http://example.org/>
ADD :g1 TO DEFAULT

Result Dataset:

Default Graph

add/add-01-post.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

ADD 8

Update evaluation test

Input Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

Update

add/add-08.ru
PREFIX : <http://example.org/>
ADD :g1 TO :g1

Result Dataset:

Default Graph

add/add-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :william a foaf:Person . :william foaf:givenName "William" . :william foaf:mbox <mailto:bill@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :john a foaf:Person . :john foaf:givenName "John" . :john foaf:mbox <mailto:johnny@example.org> .

AVG

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-numeric.ttl

@prefix : <http://www.example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :ints :int 1, 2, 3 . :decimals :dec 1.0, 2.2, 3.5 . :doubles :double 1.0E2, 2.0E3, 3.0E4 . :mixed1 :int 1 ; :dec 2.2 . :mixed2 :double 2E-1 ; :dec 2.2 .

Named Graphs

Query

aggregates/agg-avg-01.rq
PREFIX : <http://www.example.org/>
SELECT (AVG(?o) AS ?avg)
WHERE {
?s :dec ?o
}

Results

aggregates/agg-avg-01.srx


AVG with GROUP BY

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-numeric2.ttl

@prefix : <http://www.example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :ints :int 1, 2, 3 . :decimals :dec 1.0, 2.2, 3.5 . :doubles :double 1.0E2, 2.0E3, 3.0E4 . :mixed1 :int 1 ; :dec 2.2 . :mixed2 :double 2E-1 ; :dec 0.2 .

Named Graphs

Query

aggregates/agg-avg-02.rq
PREFIX : <http://www.example.org/>
SELECT ?s (AVG(?o) AS ?avg)
WHERE {
?s ?p ?o
}
GROUP BY ?s
HAVING (AVG(?o) <= 2.0)

Results

aggregates/agg-avg-02.srx


agg empty group

Query evaluation test

Input Dataset:

Default Graph

aggregates/empty.ttl

@prefix ex: <http://example.com/> .

Named Graphs

Query

aggregates/agg-empty-group.rq
PREFIX ex: <http://example.com/>
SELECT ?x (MAX(?value) AS ?max)
WHERE {
?x ex:p ?value
} GROUP BY ?x

Results

aggregates/agg-empty-group.srx


Error in AVG

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-err-01.ttl

@prefix : <http://example.com/data/#> . :x :p 1, 2, 3, 4 . :y :p 1, _:b2, 3, 4 . :z :p 1.0, 2.0, 3.0, 4 .

Named Graphs

Query

aggregates/agg-err-01.rq
PREFIX : <http://example.com/data/#>
SELECT ?g (AVG(?p) AS ?avg) ((MIN(?p) + MAX(?p)) / 2 AS ?c)
WHERE {
?g :p ?p .
}
GROUP BY ?g

Results

aggregates/agg-err-01.srx


Protect from error in AVG

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-err-02.ttl

@prefix : <http://example.com/data/#> . :x :p 1, "2", 3, 4 . :y :p 1, _:b2, 3, 4 . :z :p 2.5E0, "not a double" , 3.5, 4 .

Named Graphs

Query

aggregates/agg-err-02.rq
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX : <http://example.com/data/#>
SELECT ?g
(AVG(IF(isNumeric(?p), ?p, COALESCE(xsd:double(?p),0))) AS ?avg)
WHERE {
?g :p ?p .
}
GROUP BY ?g

Results

aggregates/agg-err-02.srx


GROUP_CONCAT 1

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-groupconcat-1.ttl

@prefix : <http://www.example.org/> . :s :p1 "1", "22" . :s :p2 "aaa", "bb", "c" .

Named Graphs

Query

aggregates/agg-groupconcat-1.rq
PREFIX : <http://www.example.org/>
ASK {
{SELECT (GROUP_CONCAT(?o) AS ?g) WHERE {
[] :p1 ?o
}}
FILTER(?g = "1 22" || ?g = "22 1")
}

Results

aggregates/agg-groupconcat-1.srx


GROUP_CONCAT 2

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-groupconcat-1.ttl

@prefix : <http://www.example.org/> . :s :p1 "1", "22" . :s :p2 "aaa", "bb", "c" .

Named Graphs

Query

aggregates/agg-groupconcat-2.rq
PREFIX : <http://www.example.org/>
SELECT (COUNT(*) AS ?c) {
{SELECT ?p (GROUP_CONCAT(?o) AS ?g) WHERE {
[] ?p ?o
} GROUP BY ?p}
FILTER(
(?p = :p1 && (?g = "1 22" || ?g = "22 1"))
|| (?p = :p2 && (?g = "aaa bb c" || ?g = "aaa c bb" || ?g = "bb aaa c" || ?g = "bb c aaa" || ?g = "c aaa bb" || ?g = "c bb aaa"))
)
}

Results

aggregates/agg-groupconcat-2.srx


GROUP_CONCAT with SEPARATOR

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-groupconcat-1.ttl

@prefix : <http://www.example.org/> . :s :p1 "1", "22" . :s :p2 "aaa", "bb", "c" .

Named Graphs

Query

aggregates/agg-groupconcat-3.rq
PREFIX : <http://www.example.org/>
ASK {
{SELECT (GROUP_CONCAT(?o;SEPARATOR=":") AS ?g) WHERE {
[] :p1 ?o
}}
FILTER(?g = "1:22" || ?g = "22:1")
}

Results

aggregates/agg-groupconcat-3.srx


MAX

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-numeric.ttl

@prefix : <http://www.example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :ints :int 1, 2, 3 . :decimals :dec 1.0, 2.2, 3.5 . :doubles :double 1.0E2, 2.0E3, 3.0E4 . :mixed1 :int 1 ; :dec 2.2 . :mixed2 :double 2E-1 ; :dec 2.2 .

Named Graphs

Query

aggregates/agg-max-01.rq
PREFIX : <http://www.example.org/>
SELECT (MAX(?o) AS ?max)
WHERE {
?s ?p ?o
}

Results

aggregates/agg-max-01.srx


MAX with GROUP BY

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-numeric.ttl

@prefix : <http://www.example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :ints :int 1, 2, 3 . :decimals :dec 1.0, 2.2, 3.5 . :doubles :double 1.0E2, 2.0E3, 3.0E4 . :mixed1 :int 1 ; :dec 2.2 . :mixed2 :double 2E-1 ; :dec 2.2 .

Named Graphs

Query

aggregates/agg-max-02.rq
PREFIX : <http://www.example.org/>
SELECT ?s (MAX(?o) AS ?max)
WHERE {
?s ?p ?o
}
GROUP BY ?s

Results

aggregates/agg-max-02.srx


MIN

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-numeric.ttl

@prefix : <http://www.example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :ints :int 1, 2, 3 . :decimals :dec 1.0, 2.2, 3.5 . :doubles :double 1.0E2, 2.0E3, 3.0E4 . :mixed1 :int 1 ; :dec 2.2 . :mixed2 :double 2E-1 ; :dec 2.2 .

Named Graphs

Query

aggregates/agg-min-01.rq
PREFIX : <http://www.example.org/>
SELECT (MIN(?o) AS ?min)
WHERE {
?s :dec ?o
}

Results

aggregates/agg-min-01.srx


MIN with GROUP BY

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-numeric.ttl

@prefix : <http://www.example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :ints :int 1, 2, 3 . :decimals :dec 1.0, 2.2, 3.5 . :doubles :double 1.0E2, 2.0E3, 3.0E4 . :mixed1 :int 1 ; :dec 2.2 . :mixed2 :double 2E-1 ; :dec 2.2 .

Named Graphs

Query

aggregates/agg-min-02.rq
PREFIX : <http://www.example.org/>
SELECT ?s (MIN(?o) AS ?min)
WHERE {
?s ?p ?o
}
GROUP BY ?s

Results

aggregates/agg-min-02.srx


SAMPLE

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-numeric.ttl

@prefix : <http://www.example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :ints :int 1, 2, 3 . :decimals :dec 1.0, 2.2, 3.5 . :doubles :double 1.0E2, 2.0E3, 3.0E4 . :mixed1 :int 1 ; :dec 2.2 . :mixed2 :double 2E-1 ; :dec 2.2 .

Named Graphs

Query

aggregates/agg-sample-01.rq
PREFIX : <http://www.example.org/>
ASK {
{
SELECT (SAMPLE(?o) AS ?sample)
WHERE {
?s :dec ?o
}
}
FILTER(?sample = 1.0 || ?sample = 2.2 || ?sample = 3.5)
}

Results

aggregates/agg-sample-01.srx


SUM

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-numeric.ttl

@prefix : <http://www.example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :ints :int 1, 2, 3 . :decimals :dec 1.0, 2.2, 3.5 . :doubles :double 1.0E2, 2.0E3, 3.0E4 . :mixed1 :int 1 ; :dec 2.2 . :mixed2 :double 2E-1 ; :dec 2.2 .

Named Graphs

Query

aggregates/agg-sum-01.rq
PREFIX : <http://www.example.org/>
SELECT (SUM(?o) AS ?sum)
WHERE {
?s :dec ?o
}

Results

aggregates/agg-sum-01.srx


SUM with GROUP BY

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg-numeric2.ttl

@prefix : <http://www.example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :ints :int 1, 2, 3 . :decimals :dec 1.0, 2.2, 3.5 . :doubles :double 1.0E2, 2.0E3, 3.0E4 . :mixed1 :int 1 ; :dec 2.2 . :mixed2 :double 2E-1 ; :dec 0.2 .

Named Graphs

Query

aggregates/agg-sum-02.rq
PREFIX : <http://www.example.org/>
SELECT ?s (SUM(?o) AS ?sum)
WHERE {
?s ?p ?o
}
GROUP BY ?s

Results

aggregates/agg-sum-02.srx


COUNT 1

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg01.ttl

@prefix : <http://www.example.org/> . :s :p1 :o1, :o2, :o3. :s :p2 :o1, :o2.

Named Graphs

Query

aggregates/agg01.rq
PREFIX : <http://www.example.org>

SELECT (COUNT(?O) AS ?C)
WHERE { ?S ?P ?O }

Results

aggregates/agg01.srx


COUNT 2

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg01.ttl

@prefix : <http://www.example.org/> . :s :p1 :o1, :o2, :o3. :s :p2 :o1, :o2.

Named Graphs

Query

aggregates/agg02.rq
PREFIX : <http://www.example.org>

SELECT ?P (COUNT(?O) AS ?C)
WHERE { ?S ?P ?O }
GROUP BY ?P

Results

aggregates/agg02.srx


COUNT 3

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg01.ttl

@prefix : <http://www.example.org/> . :s :p1 :o1, :o2, :o3. :s :p2 :o1, :o2.

Named Graphs

Query

aggregates/agg03.rq
PREFIX : <http://www.example.org>

SELECT ?P (COUNT(?O) AS ?C)
WHERE { ?S ?P ?O }
GROUP BY ?P
HAVING (COUNT(?O) > 2 )

Results

aggregates/agg03.srx


COUNT 4

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg01.ttl

@prefix : <http://www.example.org/> . :s :p1 :o1, :o2, :o3. :s :p2 :o1, :o2.

Named Graphs

Query

aggregates/agg04.rq
PREFIX : <http://www.example.org>

SELECT (COUNT(*) AS ?C)
WHERE { ?S ?P ?O }

Results

aggregates/agg04.srx


COUNT 5

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg01.ttl

@prefix : <http://www.example.org/> . :s :p1 :o1, :o2, :o3. :s :p2 :o1, :o2.

Named Graphs

Query

aggregates/agg05.rq
PREFIX : <http://www.example.org>

SELECT ?P (COUNT(*) AS ?C)
WHERE { ?S ?P ?O }
GROUP BY ?P

Results

aggregates/agg05.srx


COUNT 6

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg01.ttl

@prefix : <http://www.example.org/> . :s :p1 :o1, :o2, :o3. :s :p2 :o1, :o2.

Named Graphs

Query

aggregates/agg06.rq
PREFIX : <http://www.example.org>

SELECT (COUNT(*) AS ?C)
WHERE { ?S ?P ?O }
HAVING (COUNT(*) > 0 )

Results

aggregates/agg06.srx


COUNT 7

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg01.ttl

@prefix : <http://www.example.org/> . :s :p1 :o1, :o2, :o3. :s :p2 :o1, :o2.

Named Graphs

Query

aggregates/agg07.rq
PREFIX : <http://www.example.org>

SELECT ?P (COUNT(*) AS ?C)
WHERE { ?S ?P ?O }
GROUP BY ?P
HAVING ( COUNT(*) > 2 )

Results

aggregates/agg07.srx


COUNT 8

Negative syntax test

Query

aggregates/agg08.rq
PREFIX : <http://www.example.org/>

SELECT ((?O1 + ?O2) AS ?O12) (COUNT(?O1) AS ?C)
WHERE { ?S :p ?O1; :q ?O2 } GROUP BY (?O1 + ?O2)
ORDER BY ?O12

COUNT 8b

Query evaluation test

Input Dataset:

Default Graph

aggregates/agg08.ttl

@prefix : <http://www.example.org/> . :s :p 0,1,2 . :s :q 0,1,2 .

Named Graphs

Query

aggregates/agg08b.rq
PREFIX : <http://www.example.org/>

SELECT ?O12 (COUNT(?O1) AS ?C)
WHERE { ?S :p ?O1; :q ?O2 } GROUP BY ((?O1 + ?O2) AS ?O12)
ORDER BY ?O12

Results

aggregates/agg08b.srx


COUNT 9

Negative syntax test

Query

aggregates/agg09.rq
PREFIX : <http://www.example.org/>

SELECT ?P (COUNT(?O) AS ?C)
WHERE { ?S ?P ?O } GROUP BY ?S

COUNT 10

Negative syntax test

Query

aggregates/agg10.rq
PREFIX : <http://www.example.org/>

SELECT ?P (COUNT(?O) AS ?C)
WHERE { ?S ?P ?O }

COUNT 11

Negative syntax test

Query

aggregates/agg11.rq
PREFIX : <http://www.example.org/>

SELECT ((?O1 + ?O2) AS ?O12) (COUNT(?O1) AS ?C)
WHERE { ?S :p ?O1; :q ?O2 } GROUP BY (?S)

COUNT 12

Negative syntax test

Query

aggregates/agg12.rq
PREFIX : <http://www.example.org/>

SELECT ?O1 (COUNT(?O2) AS ?C)
WHERE { ?S :p ?O1; :q ?O2 } GROUP BY (?O1 + ?O2)

INSERT same bnode twice

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . _:b :p :o .

Update

basic-update/insert-05a.ru
PREFIX : <http://example.org/>

INSERT { GRAPH :g2 { ?S ?P ?O } }
WHERE { GRAPH :g1 { ?S ?P ?O } } ;

INSERT { GRAPH :g2 { ?S ?P ?O } }
WHERE { GRAPH :g1 { ?S ?P ?O } } ;

INSERT { GRAPH :g3 { :s :p ?count } }
WHERE {
SELECT (COUNT(*) AS ?count) WHERE {
GRAPH :g2 { ?s ?p ?o }
}
} ;
DROP GRAPH :g1 ;
DROP GRAPH :g2

Result Dataset:

Default Graph

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . :s :p 1 .

INSERTing the same bnode with INSERT DATA into two different Graphs is the same bnode

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

Update

basic-update/insert-data-same-bnode.ru
PREFIX : <http://example.org/>

# starting with an empty graph store,
# insert the same bnode in two different graphs...

INSERT DATA { GRAPH :g1 { _:b :p :o }
GRAPH :g2 { _:b :p :o } } ;

# ... then copy g1 to g2 ...

INSERT { GRAPH :g2 { ?S ?P ?O } }
WHERE { GRAPH :g1 { ?S ?P ?O } } ;

# ... by which the number of triples in
# g2 should not increase

INSERT { GRAPH :g3 { :s :p ?count } }
WHERE {
SELECT (COUNT(*) AS ?count) WHERE {
GRAPH :g2 { ?s ?p ?o }
}
} ;
DROP GRAPH :g1 ;
DROP GRAPH :g2

Result Dataset:

Default Graph

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . :s :p 1 .

Simple insert data named 1

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

Update

basic-update/insert-data-named1.ru
PREFIX : <http://example.org/ns#>

INSERT DATA { GRAPH <http://example.org/g1> { :s :p :o } }

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/ns#> . :s :p :o .

Simple insert data named 2

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/ns#> . :s :p :o .

Update

basic-update/insert-data-named2.ru
PREFIX : <http://example.org/ns#>

INSERT DATA { GRAPH <http://example.org/g1> { :s :p :o2 } }

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/ns#> . :s :p :o , :o2 .

Simple insert data named 3

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/ns#> . :s :p :o .

Update

basic-update/insert-data-named1.ru
PREFIX : <http://example.org/ns#>

INSERT DATA { GRAPH <http://example.org/g1> { :s :p :o } }

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/ns#> . :s :p :o .

Simple insert data 1

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

Update

basic-update/insert-data-spo1.ru
PREFIX : <http://example.org/ns#>

INSERT DATA { :s :p :o }

Result Dataset:

Default Graph

basic-update/spo.ttl

@prefix : <http://example.org/ns#> . :s :p :o .

Named Graphs


INSERT USING 01

Update evaluation test

Input Dataset:

Default Graph

basic-update/insert-using-01-pre.ttl

@prefix : <http://example.org/> . :a :b :c .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :g1 :p "y" .

http://example.org/g2

@prefix : <http://example.org/> . :g2 :p "z" .

Update

basic-update/insert-using-01.ru
PREFIX : <http://example.org/>

INSERT {
?s ?p "q"
}
USING :g1
USING :g2
WHERE {
?s ?p ?o
}

Result Dataset:

Default Graph

basic-update/insert-using-01-post.ttl

@prefix : <http://example.org/> . :a :b :c . :g1 :p "q" . :g2 :p "q" .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :g1 :p "y" .

http://example.org/g2

@prefix : <http://example.org/> . :g2 :p "z" .

INSERT 01

Update evaluation test

Input Dataset:

Default Graph

basic-update/insert-01-pre.ttl

<http://example.org/s> <http://example.org/p> "o" .

Named Graphs

Update

basic-update/insert-01.ru
PREFIX : <http://example.org/>

INSERT {
?s ?p "q"
} WHERE {
?s ?p ?o
}

Result Dataset:

Default Graph

basic-update/insert-01-post.ttl

<http://example.org/s> <http://example.org/p> "o", "q" .

Named Graphs


INSERT 02

Update evaluation test

Input Dataset:

Default Graph

basic-update/insert-02-pre.ttl

<http://example.org/s> <http://example.org/p> "o" .

Named Graphs

Update

basic-update/insert-02.ru
PREFIX : <http://example.org/>

INSERT {
GRAPH :g1 {
?s ?p "q"
}
} WHERE {
?s ?p ?o
}

Result Dataset:

Default Graph

basic-update/insert-02-post.ttl

<http://example.org/s> <http://example.org/p> "o" .

Named Graphs

http://example.org/g1

<http://example.org/s> <http://example.org/p> "q" .

INSERT 03

Update evaluation test

Input Dataset:

Default Graph

basic-update/insert-03-pre.ttl

@prefix : <http://example.org/> . :a :b :c .

Named Graphs

http://example.org/g1

<http://example.org/s> <http://example.org/p> "o" .

Update

basic-update/insert-03.ru
PREFIX : <http://example.org/>

WITH :g1
INSERT {
?s ?p "z"
} WHERE {
?s ?p ?o
}

Result Dataset:

Default Graph

basic-update/insert-03-post.ttl

@prefix : <http://example.org/> . :a :b :c .

Named Graphs

http://example.org/g1

<http://example.org/s> <http://example.org/p> "o", "z" .

INSERT 04

Update evaluation test

Input Dataset:

Default Graph

basic-update/insert-04-pre.ttl

@prefix : <http://example.org/> . :a :b :c .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :s :p "o" .

Update

basic-update/insert-04.ru
PREFIX : <http://example.org/>

INSERT {
?s ?p "q"
}
USING :g1
WHERE {
?s ?p ?o
}

Result Dataset:

Default Graph

basic-update/insert-04-post.ttl

@prefix : <http://example.org/> . :a :b :c . :s :p "q" .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :s :p "o" .

INSERTing the same bnode with two INSERT WHERE statement within one request is NOT the same bnode

Update evaluation test

Input Dataset:

Default Graph

basic-update/insert-where-same-bnode-pre.ttl

@prefix : <http://example.org/> . :s :p :o . :s :q :r .

Named Graphs

Update

basic-update/insert-where-same-bnode.ru
PREFIX : <http://example.org/>

# starting with an empty graph store,
# insert the same bnode in two different graphs...

INSERT { GRAPH :g1 { _:b :p :o } } WHERE { ?X :p :o };
INSERT { GRAPH :g2 { _:b :p :o } } WHERE { ?X :q :r };

# ... then copy g1 to g2 ...

INSERT { GRAPH :g2 { ?S ?P ?O } }
WHERE { GRAPH :g1 { ?S ?P ?O } } ;

# ... by which the number of triples in
# g2 should increase

INSERT { GRAPH :g3 { :s :p ?count } }
WHERE {
SELECT (COUNT(*) AS ?count) WHERE {
GRAPH :g2 { ?s ?p ?o }
}
} ;
DROP GRAPH :g1 ;
DROP GRAPH :g2

Result Dataset:

Default Graph

basic-update/insert-where-same-bnode-pre.ttl

@prefix : <http://example.org/> . :s :p :o . :s :q :r .

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . :s :p 2 .

INSERTing the same bnode with two INSERT WHERE statement within one request is NOT the same bnode even if both WHERE clauses have the empty solution mapping as the only solution.

Update evaluation test

Input Dataset:

Default Graph

basic-update/insert-where-same-bnode-pre.ttl

@prefix : <http://example.org/> . :s :p :o . :s :q :r .

Named Graphs

Update

basic-update/insert-where-same-bnode2.ru
PREFIX : <http://example.org/>

# starting with an empty graph store,
# insert the same bnode in two different graphs...

INSERT { GRAPH :g1 { _:b :p :o } } WHERE {};
INSERT { GRAPH :g2 { _:b :p :o } } WHERE {};

# ... then copy g1 to g2 ...

INSERT { GRAPH :g2 { ?S ?P ?O } }
WHERE { GRAPH :g1 { ?S ?P ?O } } ;

# ... by which the number of triples in
# g2 should increase

INSERT { GRAPH :g3 { :s :p ?count } }
WHERE {
SELECT (COUNT(*) AS ?count) WHERE {
GRAPH :g2 { ?s ?p ?o }
}
} ;
DROP GRAPH :g1 ;
DROP GRAPH :g2

Result Dataset:

Default Graph

basic-update/insert-where-same-bnode-pre.ttl

@prefix : <http://example.org/> . :s :p :o . :s :q :r .

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . :s :p 2 .

bind01 - BIND

Query evaluation test

Input Dataset:

Default Graph

bind/data.ttl

@prefix : <http://example.org/> . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

bind/bind01.rq
PREFIX : <http://example.org/>

SELECT ?z
{
?s ?p ?o .
BIND(?o+10 AS ?z)
}

Results

bind/bind01.srx


bind02 - BIND

Query evaluation test

Input Dataset:

Default Graph

bind/data.ttl

@prefix : <http://example.org/> . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

bind/bind02.rq
PREFIX : <http://example.org/>

SELECT ?o ?z ?z2
{
?s ?p ?o .
BIND(?o+10 AS ?z)
BIND(?o+100 AS ?z2)
}

Results

bind/bind02.srx


bind03 - BIND

Query evaluation test

Input Dataset:

Default Graph

bind/data.ttl

@prefix : <http://example.org/> . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

bind/bind03.rq
PREFIX : <http://example.org/>

SELECT ?z ?s1
{
?s ?p ?o .
BIND(?o+1 AS ?z)
?s1 ?p1 ?z
}

Results

bind/bind03.srx


bind04 - BIND

Query evaluation test

Input Dataset:

Default Graph

bind/data.ttl

@prefix : <http://example.org/> . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

bind/bind04.rq
PREFIX : <http://example.org/>

SELECT *
{
?s ?p ?o .
BIND(?nova AS ?z)
}

Results

bind/bind04.srx


bind05 - BIND

Query evaluation test

Input Dataset:

Default Graph

bind/data.ttl

@prefix : <http://example.org/> . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

bind/bind05.rq
PREFIX : <http://example.org/>

SELECT ?s ?p ?o ?z
{
?s ?p ?o .
BIND(?o+1 AS ?z)
FILTER(?z = 3 )
}

Results

bind/bind05.srx


bind06 - BIND

Query evaluation test

Input Dataset:

Default Graph

bind/data.ttl

@prefix : <http://example.org/> . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

bind/bind06.rq
PREFIX : <http://example.org/>

SELECT *
{
?s ?p ?o .
BIND(?o+10 AS ?z)
}

Results

bind/bind06.srx


bind07 - BIND

Query evaluation test

Input Dataset:

Default Graph

bind/data.ttl

@prefix : <http://example.org/> . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

bind/bind07.rq
PREFIX : <http://example.org/>

SELECT ?s ?p ?o ?z
{
?s ?p ?o .
{ BIND(?o+1 AS ?z) } UNION { BIND(?o+2 AS ?z) }
}

Results

bind/bind07.srx


bind08 - BIND

Query evaluation test

Input Dataset:

Default Graph

bind/data.ttl

@prefix : <http://example.org/> . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

bind/bind08.rq
PREFIX : <http://example.org/>

SELECT ?s ?p ?o ?z
{
?s ?p ?o .
FILTER(?z = 3 )
BIND(?o+1 AS ?z)
}

Results

bind/bind08.srx


bind10 - BIND scoping - Variable in filter not in scope

Query evaluation test

Input Dataset:

Default Graph

bind/data.ttl

@prefix : <http://example.org/> . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

bind/bind10.rq
PREFIX : <http://example.org/>

SELECT ?s ?v ?z
{
# See also bind11.rq
BIND(4 AS ?z)
{
# ?z is not in-scope at the time of filter execution.
?s :p ?v . FILTER(?v = ?z)
}
}

Results

bind/bind10.srx


bind11 - BIND scoping - Variable in filter in scope

Query evaluation test

Input Dataset:

Default Graph

bind/data.ttl

@prefix : <http://example.org/> . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

bind/bind11.rq
PREFIX : <http://example.org/>

SELECT ?s ?v ?z
{
# See also bind10.rq
BIND(4 AS ?z)
# ?z is in scope at the time of filter execution.
?s :p ?v .
FILTER(?v = ?z)
}

Results

bind/bind11.srx


Inline VALUES graph pattern

Query evaluation test

Input Dataset:

Default Graph

bindings/data01.ttl

@prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix : <http://example.org/book/> . @prefix ns: <http://example.org/ns#> . :book1 dc:title "SPARQL Tutorial" . :book1 ns:price 42 . :book2 dc:title "The Semantic Web" . :book2 ns:price 23 .

Named Graphs

Query

bindings/inline01.rq
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX : <http://example.org/book/>
PREFIX ns: <http://example.org/ns#>

SELECT ?book ?title ?price
{
VALUES ?book { :book1 }
?book dc:title ?title ;
ns:price ?price .
}

Results

bindings/inline01.srx


Post-subquery VALUES

Query evaluation test

Input Dataset:

Default Graph

bindings/data02.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Query

bindings/inline02.rq
# bindings with one element and one value in the object variable

PREFIX : <http://example.org/>

SELECT ?s ?o {
{
SELECT * WHERE {
?s ?p ?o .
}
VALUES (?o) { (:b) }
}
}

Results

bindings/inline02.srx


Post-query VALUES with subj-var, 1 row

Query evaluation test

Input Dataset:

Default Graph

bindings/data01.ttl

@prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix : <http://example.org/book/> . @prefix ns: <http://example.org/ns#> . :book1 dc:title "SPARQL Tutorial" . :book1 ns:price 42 . :book2 dc:title "The Semantic Web" . :book2 ns:price 23 .

Named Graphs

Query

bindings/values01.rq
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX : <http://example.org/book/>
PREFIX ns: <http://example.org/ns#>

SELECT ?book ?title ?price
{
?book dc:title ?title ;
ns:price ?price .
}
VALUES ?book {
:book1
}

Results

bindings/values01.srx


Post-query VALUES with obj-var, 1 row

Query evaluation test

Input Dataset:

Default Graph

bindings/data02.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Query

bindings/values02.rq
# bindings with one element and one value in the object variable

PREFIX : <http://example.org/>

SELECT ?s ?o
{
?s ?p ?o .
} VALUES ?o {
:b
}

Results

bindings/values02.srx


Post-query VALUES with 2 obj-vars, 1 row

Query evaluation test

Input Dataset:

Default Graph

bindings/data03.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Query

bindings/values03.rq
# bindings with two variables and one set of values

PREFIX : <http://example.org/>

SELECT ?s ?o1 ?o2
{
?s ?p1 ?o1 .
?s ?p2 ?o2 .
} VALUES (?o1 ?o2) {
("Alan" "alan@example.org")
}

Results

bindings/values03.srx


Post-query VALUES with 2 obj-vars, 1 row with UNDEF

Query evaluation test

Input Dataset:

Default Graph

bindings/data04.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Query

bindings/values04.rq
# bindings with one element UNDEF

PREFIX : <http://example.org/>

SELECT ?s ?o1 ?o2
{
?s ?p1 ?o1 .
?s ?p2 ?o2 .
} VALUES (?o1 ?o2) {
("Alan" UNDEF)
}

Results

bindings/values04.srx


Post-query VALUES with 2 obj-vars, 2 rows with UNDEF

Query evaluation test

Input Dataset:

Default Graph

bindings/data05.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Query

bindings/values05.rq
PREFIX : <http://example.org/>

SELECT ?s ?o1 ?o2
{
?s ?p1 ?o1 .
?s ?p2 ?o2 .
} VALUES (?o1 ?o2) {
(UNDEF "Alan")
(:b UNDEF)
}

Results

bindings/values05.srx


Post-query VALUES with pred-var, 1 row

Query evaluation test

Input Dataset:

Default Graph

bindings/data06.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Query

bindings/values06.rq
# bindings with two variables and two sets of values

PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?s ?p1 ?o1
{
?s ?p1 ?o1 .
} VALUES ?p1 {
foaf:knows
}

Results

bindings/values06.srx


Post-query VALUES with (OPTIONAL) obj-var, 1 row

Query evaluation test

Input Dataset:

Default Graph

bindings/data07.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Alice" . :c foaf:mbox "alice@example.org" . :a foaf:knows :b . :b foaf:knows :c .

Named Graphs

Query

bindings/values07.rq
# bindings with two variables and two sets of values

PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?s ?o1 ?o2
{
?s ?p1 ?o1
OPTIONAL { ?s foaf:knows ?o2 }
} VALUES (?o2) {
(:b)
}

Results

bindings/values07.srx


Post-query VALUES with subj/obj-vars, 2 rows with UNDEF

Query evaluation test

Input Dataset:

Default Graph

bindings/data08.ttl

@prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix : <http://example.org/book/> . @prefix ns: <http://example.org/ns#> . :book1 dc:title "SPARQL Tutorial" . :book1 ns:price 42 . :book2 dc:title "The Semantic Web" . :book2 ns:price 23 .

Named Graphs

Query

bindings/values08.rq
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX : <http://example.org/book/>
PREFIX ns: <http://example.org/ns#>

SELECT ?book ?title ?price
{
?book dc:title ?title ;
ns:price ?price .
}
VALUES (?book ?title) {
(UNDEF "SPARQL Tutorial")
(:book2 UNDEF)
}

Results

bindings/values08.srx


CLEAR ALL

Update evaluation test

Input Dataset:

Default Graph

clear/clear-default.ttl

@prefix : <http://example.org/> . <> :name "Default Graph" .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :g1 :name "G1" ; :description "Graph 1" ; .

http://example.org/g2

@prefix : <http://example.org/> . :g2 :name "G2" ; .

Update

clear/clear-all-01.ru
PREFIX : <http://example.org/>

CLEAR ALL

Result Dataset:

Default Graph

clear/empty.ttl

@prefix : <http://example.org/> .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> .

http://example.org/g1

@prefix : <http://example.org/> .

CLEAR DEFAULT

Update evaluation test

Input Dataset:

Default Graph

clear/clear-default.ttl

@prefix : <http://example.org/> . <> :name "Default Graph" .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :g1 :name "G1" ; :description "Graph 1" ; .

http://example.org/g2

@prefix : <http://example.org/> . :g2 :name "G2" ; .

Update

clear/clear-default-01.ru
PREFIX : <http://example.org/>

CLEAR DEFAULT

Result Dataset:

Default Graph

clear/empty.ttl

@prefix : <http://example.org/> .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :g1 :name "G1" ; :description "Graph 1" ; .

http://example.org/g2

@prefix : <http://example.org/> . :g2 :name "G2" ; .

CLEAR GRAPH

Update evaluation test

Input Dataset:

Default Graph

clear/clear-default.ttl

@prefix : <http://example.org/> . <> :name "Default Graph" .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :g1 :name "G1" ; :description "Graph 1" ; .

http://example.org/g2

@prefix : <http://example.org/> . :g2 :name "G2" ; .

Update

clear/clear-graph-01.ru
PREFIX : <http://example.org/>

CLEAR GRAPH :g1

Result Dataset:

Default Graph

clear/clear-default.ttl

@prefix : <http://example.org/> . <> :name "Default Graph" .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . :g2 :name "G2" ; .

http://example.org/g1

@prefix : <http://example.org/> .

CLEAR NAMED

Update evaluation test

Input Dataset:

Default Graph

clear/clear-default.ttl

@prefix : <http://example.org/> . <> :name "Default Graph" .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :g1 :name "G1" ; :description "Graph 1" ; .

http://example.org/g2

@prefix : <http://example.org/> . :g2 :name "G2" ; .

Update

clear/clear-named-01.ru
PREFIX : <http://example.org/>

CLEAR NAMED

Result Dataset:

Default Graph

clear/clear-default.ttl

@prefix : <http://example.org/> . <> :name "Default Graph" .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> .

http://example.org/g2

@prefix : <http://example.org/> .

constructwhere01 - CONSTRUCT WHERE

Query evaluation test

Input Dataset:

Default Graph

construct/data.ttl

@prefix : <http://example.org/> . :s1 :p :o1 . :s2 :p :o1 . :s2 :p :o2 . :s3 :p :o3 .

Named Graphs

Query

construct/constructwhere01.rq
PREFIX : <http://example.org/>

CONSTRUCT WHERE { ?s ?p ?o}

Results

construct/constructwhere01result.ttl


constructwhere02 - CONSTRUCT WHERE

Query evaluation test

Input Dataset:

Default Graph

construct/data.ttl

@prefix : <http://example.org/> . :s1 :p :o1 . :s2 :p :o1 . :s2 :p :o2 . :s3 :p :o3 .

Named Graphs

Query

construct/constructwhere02.rq
PREFIX : <http://example.org/>

CONSTRUCT WHERE { :s1 :p ?o . ?s2 :p ?o }

Results

construct/constructwhere02result.ttl


constructwhere03 - CONSTRUCT WHERE

Query evaluation test

Input Dataset:

Default Graph

construct/data.ttl

@prefix : <http://example.org/> . :s1 :p :o1 . :s2 :p :o1 . :s2 :p :o2 . :s3 :p :o3 .

Named Graphs

Query

construct/constructwhere03.rq
PREFIX : <http://example.org/>

CONSTRUCT WHERE { :s2 :p ?o1, ?o2 }

Results

construct/constructwhere03result.ttl


constructwhere04 - CONSTRUCT WHERE

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

Query

construct/constructwhere04.rq
PREFIX : <http://example.org/>

CONSTRUCT
FROM <data.ttl>
WHERE { ?s ?p ?o }

Results

construct/constructwhere04result.ttl


constructwhere05 - CONSTRUCT WHERE

Negative syntax test

Query

construct/constructwhere05.rq
PREFIX : <http://example.org/>

CONSTRUCT
WHERE { ?s ?p ?o FILTER ( ?o = :o1) }

constructwhere06 - CONSTRUCT WHERE

Negative syntax test

Query

construct/constructwhere06.rq
CONSTRUCT
WHERE { GRAPH <data.ttl> { ?s ?p ?o } }

COPY 1

Update evaluation test

Input Dataset:

Default Graph

copy/copy-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

Update

copy/copy-01.ru
PREFIX : <http://example.org/>
COPY DEFAULT TO :g1

Result Dataset:

Default Graph

copy/copy-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

COPY 2

Update evaluation test

Input Dataset:

Default Graph

copy/copy-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

Named Graphs

Update

copy/copy-01.ru
PREFIX : <http://example.org/>
COPY DEFAULT TO :g1

Result Dataset:

Default Graph

copy/copy-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

COPY 3

Update evaluation test

Input Dataset:

Default Graph

copy/copy-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

http://example.org/g2

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :mickey a foaf:Person . :mickey foaf:givenName "Mickey" . :mickey foaf:mbox <mailto:mickey@example.org> .

Update

copy/copy-03.ru
PREFIX : <http://example.org/>
COPY :g1 TO :g2

Result Dataset:

Default Graph

copy/copy-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

Named Graphs

http://example.org/g2

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

COPY 4

Update evaluation test

Input Dataset:

Default Graph

copy/copy-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

Update

copy/copy-03.ru
PREFIX : <http://example.org/>
COPY :g1 TO :g2

Result Dataset:

Default Graph

copy/copy-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

http://example.org/g2

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

COPY 6

Update evaluation test

Input Dataset:

Default Graph

copy/copy-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

Update

copy/copy-06.ru
PREFIX : <http://example.org/>
COPY :g1 TO DEFAULT

Result Dataset:

Default Graph

copy/copy-01.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

COPY 7

Update evaluation test

Input Dataset:

Default Graph

copy/copy-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

Update

copy/copy-07.ru
PREFIX : <http://example.org/>
COPY :g1 TO :g1

Result Dataset:

Default Graph

copy/copy-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :ron a foaf:Person . :ron foaf:givenName "Ronnie" . :ron foaf:mbox <mailto:ronnie@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

csv01 - CSV Result Format

Result format test

Input Dataset:

Default Graph

csv-tsv-res/data.ttl

@prefix : <http://example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :s1 :p1 :s2 . :s2 :p2 "foo" . :s3 :p3 "bar"^^xsd:string . :s4 :p4 4 . :s5 :p5 5.5 . :s6 :p6 _:o6 .

Named Graphs

Query

csv-tsv-res/csvtsv01.rq
PREFIX : <http://example.org/>

SELECT * WHERE { ?s ?p ?o} ORDER BY ?s ?p ?o

Results

csv-tsv-res/csvtsv01.csv


cvs02 - CSV Result Format

Result format test

Input Dataset:

Default Graph

csv-tsv-res/data.ttl

@prefix : <http://example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :s1 :p1 :s2 . :s2 :p2 "foo" . :s3 :p3 "bar"^^xsd:string . :s4 :p4 4 . :s5 :p5 5.5 . :s6 :p6 _:o6 .

Named Graphs

Query

csv-tsv-res/csvtsv02.rq
PREFIX : <http://example.org/>

SELECT * WHERE { ?s ?p ?o OPTIONAL {?o ?p2 ?o2 } } ORDER BY ?s ?p ?o ?p2 ?o2

Results

csv-tsv-res/csvtsv02.csv


csv03 - CSV Result Format

Result format test

Input Dataset:

Default Graph

csv-tsv-res/data2.ttl

@prefix : <http://example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :s1 :p1 "1"^^xsd:string . :s2 :p2 "2.2"^^xsd:decimal . :s3 :p3 "-3"^^xsd:negativeInteger . :s4 :p4 "4,4"^^xsd:string . :s5 :p5 "5,5"^^:myCustomDatatype . :s6 :p6 "1.0E6"^^xsd:double . :s7 :p7 "a7"^^xsd:hexBinary .

Named Graphs

Query

csv-tsv-res/csvtsv01.rq
PREFIX : <http://example.org/>

SELECT * WHERE { ?s ?p ?o} ORDER BY ?s ?p ?o

Results

csv-tsv-res/csvtsv03.csv


tsv01 - TSV Result Format

Query evaluation test

Input Dataset:

Default Graph

csv-tsv-res/data.ttl

@prefix : <http://example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :s1 :p1 :s2 . :s2 :p2 "foo" . :s3 :p3 "bar"^^xsd:string . :s4 :p4 4 . :s5 :p5 5.5 . :s6 :p6 _:o6 .

Named Graphs

Query

csv-tsv-res/csvtsv01.rq
PREFIX : <http://example.org/>

SELECT * WHERE { ?s ?p ?o} ORDER BY ?s ?p ?o

Results

csv-tsv-res/csvtsv01.tsv


tvs02 - TSV Result Format

Query evaluation test

Input Dataset:

Default Graph

csv-tsv-res/data.ttl

@prefix : <http://example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :s1 :p1 :s2 . :s2 :p2 "foo" . :s3 :p3 "bar"^^xsd:string . :s4 :p4 4 . :s5 :p5 5.5 . :s6 :p6 _:o6 .

Named Graphs

Query

csv-tsv-res/csvtsv02.rq
PREFIX : <http://example.org/>

SELECT * WHERE { ?s ?p ?o OPTIONAL {?o ?p2 ?o2 } } ORDER BY ?s ?p ?o ?p2 ?o2

Results

csv-tsv-res/csvtsv02.tsv


tsv03 - TSV Result Format

Query evaluation test

Input Dataset:

Default Graph

csv-tsv-res/data2.ttl

@prefix : <http://example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :s1 :p1 "1"^^xsd:string . :s2 :p2 "2.2"^^xsd:decimal . :s3 :p3 "-3"^^xsd:negativeInteger . :s4 :p4 "4,4"^^xsd:string . :s5 :p5 "5,5"^^:myCustomDatatype . :s6 :p6 "1.0E6"^^xsd:double . :s7 :p7 "a7"^^xsd:hexBinary .

Named Graphs

Query

csv-tsv-res/csvtsv01.rq
PREFIX : <http://example.org/>

SELECT * WHERE { ?s ?p ?o} ORDER BY ?s ?p ?o

Results

csv-tsv-res/csvtsv03.tsv


Simple DELETE DATA 1

Update evaluation test

Input Dataset:

Default Graph

delete-data/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Update

delete-data/delete-data-01.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE DATA
{
:a foaf:knows :b .
}

Result Dataset:

Default Graph

delete-data/delete-post-01s.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" .

Named Graphs


Simple DELETE DATA 2

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Update

delete-data/delete-data-02.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE DATA
{
GRAPH <http://example.org/g1> { :a foaf:knows :b }
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" .

Simple DELETE DATA 3

Update evaluation test

Input Dataset:

Default Graph

delete-data/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Update

delete-data/delete-data-03.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE DATA
{
:a foaf:knows :c .
}

Result Dataset:

Default Graph

delete-data/delete-post-01f.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs


Simple DELETE DATA 4

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Update

delete-data/delete-data-04.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE DATA
{
GRAPH <http://example.org/g1> { :a foaf:knows :c }
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Graph-specific DELETE DATA 1

Update evaluation test

Input Dataset:

Default Graph

delete-data/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Update

delete-data/delete-data-05.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE DATA
{
:a foaf:knows :b .
}

Result Dataset:

Default Graph

delete-data/delete-post-01s.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" .

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Graph-specific DELETE DATA 2

Update evaluation test

Input Dataset:

Default Graph

delete-data/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Update

delete-data/delete-data-06.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE DATA
{
GRAPH <http://example.org/g2> { :c foaf:name "Chris" }
}

Result Dataset:

Default Graph

delete-data/delete-post-01f.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

DELETE INSERT 1

Update evaluation test

Input Dataset:

Default Graph

delete-insert/delete-insert-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :a foaf:knows :b . :a foaf:knows :c . :b foaf:knows :c .

Named Graphs

Update

delete-insert/delete-insert-01.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows ?b .
}
INSERT
{
?b foaf:knows ?a .
}
WHERE
{
?a foaf:knows ?b .
}

Result Dataset:

Default Graph

delete-insert/delete-insert-post-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :b foaf:knows :a . :c foaf:knows :a . :c foaf:knows :b .

Named Graphs


DELETE INSERT 1b

Update evaluation test

Input Dataset:

Default Graph

delete-insert/delete-insert-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :a foaf:knows :b . :a foaf:knows :c . :b foaf:knows :c .

Named Graphs

Update

delete-insert/delete-insert-01b.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows ?b .
}
WHERE
{
?a foaf:knows ?b .
}
;
INSERT
{
?b foaf:knows ?a .
}
WHERE
{
?a foaf:knows ?b .
}

Result Dataset:

Default Graph

delete-insert/delete-insert-post-01b.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> .

Named Graphs


DELETE INSERT 1c

Update evaluation test

Input Dataset:

Default Graph

delete-insert/delete-insert-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :a foaf:knows :b . :a foaf:knows :c . :b foaf:knows :c .

Named Graphs

Update

delete-insert/delete-insert-01c.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

INSERT
{
?b foaf:knows ?a .
}
WHERE
{
?a foaf:knows ?b .
}
;
DELETE
{
?a foaf:knows ?b .
}
WHERE
{
?a foaf:knows ?b .
}

Result Dataset:

Default Graph

delete-insert/delete-insert-post-01b.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> .

Named Graphs


DELETE INSERT 2

Update evaluation test

Input Dataset:

Default Graph

delete-insert/delete-insert-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :a foaf:knows :b . :a foaf:knows :c . :b foaf:knows :c .

Named Graphs

Update

delete-insert/delete-insert-02.ru
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows ?b .
}
WHERE
{
?a foaf:name "Alan" . ?a foaf:knows ?b
}

Result Dataset:

Default Graph

delete-insert/delete-insert-post-02.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :b foaf:knows :c .

Named Graphs


DELETE INSERT 3

Negative syntax test

Query

delete-insert/delete-insert-03.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows [] .
}
WHERE
{
?a foaf:name "Alan" .
}

DELETE INSERT 3b

Negative syntax test

Query

delete-insert/delete-insert-03b.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows _:b .
}
WHERE
{
?a foaf:name "Alan" .
}

DELETE INSERT 4

Update evaluation test

Input Dataset:

Default Graph

delete-insert/delete-insert-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :a foaf:knows :b . :a foaf:knows :c . :b foaf:knows :c .

Named Graphs

Update

delete-insert/delete-insert-04.ru
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows ?Var_B .
}
WHERE
{
{ ?a foaf:name "Alan" }
{ SELECT DISTINCT ?Var_B
{ { ?Var_B ?Var_B1 ?Var_B2 } UNION
{ ?Var_B1 ?Var_B ?Var_B2 } UNION
{ ?Var_B1 ?Var_B2 ?Var_B } UNION
{ GRAPH ?Var_Bg {?Var_B ?Var_B1 ?Var_B2 } } UNION
{ GRAPH ?Var_Bg {?Var_B1 ?Var_B ?Var_B2 } } UNION
{ GRAPH ?Var_Bg {?Var_B1 ?Var_B2 ?Var_B } } } }
}

Result Dataset:

Default Graph

delete-insert/delete-insert-post-02.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :b foaf:knows :c .

Named Graphs


DELETE INSERT 4b

Update evaluation test

Input Dataset:

Default Graph

delete-insert/delete-insert-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :a foaf:knows :b . :a foaf:knows :c . :b foaf:knows :c .

Named Graphs

Update

delete-insert/delete-insert-04b.ru
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows ?Var_B .
}
WHERE
{
{ ?a foaf:name "Alan" }
{ ?a foaf:knows ?Var_B . }

}

Result Dataset:

Default Graph

delete-insert/delete-insert-post-02.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :b foaf:knows :c .

Named Graphs


DELETE INSERT 5

Negative syntax test

Query

delete-insert/delete-insert-05.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows [] .
}
INSERT
{
?a foaf:knows ?a .
}
WHERE
{
?a foaf:name "Alan" .
}

DELETE INSERT 5b

Update evaluation test

Input Dataset:

Default Graph

delete-insert/delete-insert-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :a foaf:knows :b . :a foaf:knows :c . :b foaf:knows :c .

Named Graphs

Update

delete-insert/delete-insert-05b.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows ?Var_B .
}
INSERT
{
?a foaf:knows ?a .
}
WHERE
{
{ ?a foaf:name "Alan" . }
{ ?a foaf:knows ?Var_B . }
}

Result Dataset:

Default Graph

delete-insert/delete-insert-post-05.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :b foaf:knows :c . :a foaf:knows :a .

Named Graphs


DELETE INSERT 6

Negative syntax test

Query

delete-insert/delete-insert-05.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows [] .
}
INSERT
{
?a foaf:knows ?a .
}
WHERE
{
?a foaf:name "Alan" .
}

DELETE INSERT 6b

Update evaluation test

Input Dataset:

Default Graph

delete-insert/delete-insert-pre-06.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :b foaf:knows :c .

Named Graphs

Update

delete-insert/delete-insert-05b.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows ?Var_B .
}
INSERT
{
?a foaf:knows ?a .
}
WHERE
{
{ ?a foaf:name "Alan" . }
{ ?a foaf:knows ?Var_B . }
}

Result Dataset:

Default Graph

delete-insert/delete-insert-pre-06.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox <mailto:alan@example.org> . :b foaf:name "Bob" . :b foaf:mbox <mailto:bob@example.org> . :c foaf:name "Claire" . :c foaf:mbox <mailto:claire@example.org> . :b foaf:knows :c .

Named Graphs


DELETE INSERT 7

Negative syntax test

Query

delete-insert/delete-insert-07.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows [] .
}
INSERT
{
?a foaf:knows [] .
}
WHERE
{
?a foaf:name "Alan" .
}

DELETE INSERT 7b

Negative syntax test

Query

delete-insert/delete-insert-07b.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?a foaf:knows [] .
}
INSERT
{
?a foaf:knows [] .
}
WHERE
{
?a foaf:name "Alan" . ?a foaf:knows [] .
}

DELETE INSERT 8

Negative syntax test

Query

delete-insert/delete-insert-08.ru
PREFIX : <http://example.org/>

DELETE
{ _:a :p 12 .
_:a :q ?o .
}
WHERE {?s :r ?q OPTIONAL { ?q :s ?o } }

DELETE INSERT 9

Negative syntax test

Query

delete-insert/delete-insert-09.ru
PREFIX : <http://example.org/>

DELETE
{ _:a :p 12 .
_:a :q _:b .
}
WHERE {}

Simple DELETE WHERE 1

Update evaluation test

Input Dataset:

Default Graph

delete-where/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Update

delete-where/delete-where-01.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE WHERE
{
:a foaf:knows ?b .
}

Result Dataset:

Default Graph

delete-where/delete-post-01s.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" .

Named Graphs


Simple DELETE WHERE 2

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Update

delete-where/delete-where-02.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE WHERE
{
GRAPH <http://example.org/g1> { :a foaf:knows ?b }
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" .

Simple DELETE WHERE 3

Update evaluation test

Input Dataset:

Default Graph

delete-where/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Update

delete-where/delete-where-03.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE WHERE
{
?a foaf:knows :c .
}

Result Dataset:

Default Graph

delete-where/delete-post-01f.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs


Simple DELETE WHERE 4

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Update

delete-where/delete-where-04.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE WHERE
{
GRAPH <http://example.org/g1> { ?a foaf:knows :c }
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Graph-specific DELETE WHERE 1

Update evaluation test

Input Dataset:

Default Graph

delete-where/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Update

delete-where/delete-where-05.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE WHERE
{
?a foaf:knows :b .
}

Result Dataset:

Default Graph

delete-where/delete-post-01s.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Graph-specific DELETE WHERE 2

Update evaluation test

Input Dataset:

Default Graph

delete-where/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Update

delete-where/delete-where-06.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE WHERE
{
GRAPH <http://example.org/g2> { ?c foaf:name "Chris" }
}

Result Dataset:

Default Graph

delete-where/delete-post-01f.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Simple DELETE 1

Update evaluation test

Input Dataset:

Default Graph

delete/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Update

delete/delete-01.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?s ?p ?o .
}
WHERE
{
:a foaf:knows ?s .
?s ?p ?o
}

Result Dataset:

Default Graph

delete/delete-post-01s.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :a foaf:knows :b .

Named Graphs


Simple DELETE 2

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Update

delete/delete-02.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
GRAPH <http://example.org/g1> { ?s ?p ?o }
}
WHERE
{
GRAPH <http://example.org/g1> { :a foaf:knows ?s .
?s ?p ?o }
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :a foaf:knows :b .

Simple DELETE 3

Update evaluation test

Input Dataset:

Default Graph

delete/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Update

delete/delete-03.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?s ?p ?o .
}
WHERE
{
?s foaf:knows :c .
?s ?p ?o
}

Result Dataset:

Default Graph

delete/delete-post-01f.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs


Simple DELETE 4

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Update

delete/delete-04.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
GRAPH <http://example.org/g1> { ?s ?p ?o }
}
WHERE
{
GRAPH <http://example.org/g1> { ?s foaf:knows :c .
?s ?p ?o }
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Graph-specific DELETE 1

Update evaluation test

Input Dataset:

Default Graph

delete/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Update

delete/delete-05.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?s ?p ?o .
}
WHERE
{
:a foaf:knows ?s .
?s ?p ?o
}

Result Dataset:

Default Graph

delete/delete-post-01s.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Graph-specific DELETE 2

Update evaluation test

Input Dataset:

Default Graph

delete/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Update

delete/delete-06.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
GRAPH <http://example.org/g2> { ?s ?p ?o }
}
WHERE
{
GRAPH <http://example.org/g2> { ?s foaf:name "Chris" .
?s ?p ?o }
}

Result Dataset:

Default Graph

delete/delete-post-01f.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Simple DELETE 7

Update evaluation test

Input Dataset:

Default Graph

delete/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

Update

delete/delete-07.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?s ?p ?o .
}
WHERE
{
:a foaf:knows ?s .
}

Result Dataset:

Default Graph

delete/delete-post-01f.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs


Simple DELETE 1 (USING)

Update evaluation test

Input Dataset:

Default Graph

delete/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Update

delete/delete-using-01.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?s ?p ?o .
}
USING <http://example.org/g2>
WHERE
{
:a foaf:knows ?s .
?s ?p ?o
}

Result Dataset:

Default Graph

delete/delete-post-01s.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Simple DELETE 2 (USING)

Update evaluation test

Input Dataset:

Default Graph

delete/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Update

delete/delete-using-02.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?s ?p ?o .
}
USING <http://example.org/g3>
WHERE
{
GRAPH <http://example.org/g2> { :a foaf:knows ?s .
?s ?p ?o }
}

Result Dataset:

Default Graph

delete/delete-post-01f.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Simple DELETE 3 (USING)

Update evaluation test

Input Dataset:

Default Graph

delete/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Update

delete/delete-using-03.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?s ?p ?o .
}
USING <http://example.org/g2>
WHERE
{
?s foaf:knows :d .
?s ?p ?o
}

Result Dataset:

Default Graph

delete/delete-post-01f.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Simple DELETE 4 (USING)

Update evaluation test

Input Dataset:

Default Graph

delete/delete-pre-03.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Update

delete/delete-using-04.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
?s ?p ?o .
}
USING <http://example.org/g3>
WHERE
{
GRAPH <http://example.org/g2> { ?s foaf:knows :d .
?s ?p ?o }
}

Result Dataset:

Default Graph

delete/delete-post-03f.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Graph-specific DELETE 1 (USING)

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Update

delete/delete-using-05.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
GRAPH <http://example.org/g1> { ?s ?p ?o }
}
USING <http://example.org/g1>
WHERE
{
?s foaf:knows :b .
?s ?p ?o
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Graph-specific DELETE 2 (USING)

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Update

delete/delete-using-06.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

DELETE
{
GRAPH <http://example.org/g2> { ?s ?p ?o }
}
USING <http://example.org/g3>
WHERE
{
GRAPH <http://example.org/g2> { ?s foaf:name "Chris" .
?s ?p ?o }
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Simple DELETE 1 (WITH)

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Update

delete/delete-with-01.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

WITH <http://example.org/g1>
DELETE
{
?s ?p ?o .
}
WHERE
{
:a foaf:knows ?s .
?s ?p ?o
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :a foaf:knows :b .

Simple DELETE 2 (WITH)

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Update

delete/delete-with-02.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

WITH <http://example.org/g2>
DELETE
{
GRAPH <http://example.org/g1> { ?s ?p ?o }
}
WHERE
{
GRAPH <http://example.org/g1> { :a foaf:knows ?s .
?s ?p ?o }
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :a foaf:knows :b .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Simple DELETE 3 (WITH)

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Update

delete/delete-with-03.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

WITH <http://example.org/g1>
DELETE
{
?s ?p ?o .
}
WHERE
{
?s foaf:knows :c .
?s ?p ?o
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Simple DELETE 4 (WITH)

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Update

delete/delete-with-04.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

WITH <http://example.org/g2>
DELETE
{
GRAPH <http://example.org/g1> { ?s ?p ?o }
}
WHERE
{
GRAPH <http://example.org/g1> { ?s foaf:knows :c .
?s ?p ?o }
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Graph-specific DELETE 1 (WITH)

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

Update

delete/delete-with-05.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

WITH <http://example.org/g1>
DELETE
{
?s ?p ?o .
}
WHERE
{
?s foaf:knows :b .
?s ?p ?o
}

Result Dataset:

Default Graph

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

http://example.org/g1

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" .

Graph-specific DELETE 2 (WITH)

Update evaluation test

Input Dataset:

Default Graph

delete/delete-pre-01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :b foaf:knows :c .

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

Update

delete/delete-with-06.ru
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

WITH <http://example.org/g3>
DELETE
{
GRAPH <http://example.org/g2> { ?s ?p ?o }
}
WHERE
{
GRAPH <http://example.org/g2> { ?s foaf:name "Chris" .
?s ?p ?o }
}

Result Dataset:

Default Graph

delete/delete-post-01f.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :a foaf:knows :b .

Named Graphs

http://example.org/g3

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :c foaf:name "Chris" . :c foaf:mbox "chris@example.org" . :d foaf:name "Dan" . :d foaf:mbox "dan@example.org" . :c foaf:knows :d .

http://example.org/g2

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :b foaf:knows :c .

DROP ALL

Update evaluation test

Input Dataset:

Default Graph

drop/drop-default.ttl

@prefix : <http://example.org/> . <> :name "Default Graph" .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . :g2 :name "G2" ; .

http://example.org/g1

@prefix : <http://example.org/> . :g1 :name "G1" ; :description "Graph 1" ; .

Update

drop/drop-all-01.ru
PREFIX : <http://example.org/>

DROP ALL

Result Dataset:

Default Graph

Named Graphs


DROP DEFAULT

Update evaluation test

Input Dataset:

Default Graph

drop/drop-default.ttl

@prefix : <http://example.org/> . <> :name "Default Graph" .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :g1 :name "G1" ; :description "Graph 1" ; .

http://example.org/g2

@prefix : <http://example.org/> . :g2 :name "G2" ; .

Update

drop/drop-default-01.ru
PREFIX : <http://example.org/>

DROP DEFAULT

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :g1 :name "G1" ; :description "Graph 1" ; .

http://example.org/g2

@prefix : <http://example.org/> . :g2 :name "G2" ; .

DROP GRAPH

Update evaluation test

Input Dataset:

Default Graph

drop/drop-default.ttl

@prefix : <http://example.org/> . <> :name "Default Graph" .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :g1 :name "G1" ; :description "Graph 1" ; .

http://example.org/g2

@prefix : <http://example.org/> . :g2 :name "G2" ; .

Update

drop/drop-graph-01.ru
PREFIX : <http://example.org/>

DROP GRAPH :g1

Result Dataset:

Default Graph

drop/drop-default.ttl

@prefix : <http://example.org/> . <> :name "Default Graph" .

Named Graphs

http://example.org/g2

@prefix : <http://example.org/> . :g2 :name "G2" ; .

DROP NAMED

Update evaluation test

Input Dataset:

Default Graph

drop/drop-default.ttl

@prefix : <http://example.org/> . <> :name "Default Graph" .

Named Graphs

http://example.org/g1

@prefix : <http://example.org/> . :g1 :name "G1" ; :description "Graph 1" ; .

http://example.org/g2

@prefix : <http://example.org/> . :g2 :name "G2" ; .

Update

drop/drop-named-01.ru
PREFIX : <http://example.org/>

DROP NAMED

Result Dataset:

Default Graph

drop/drop-default.ttl

@prefix : <http://example.org/> . <> :name "Default Graph" .

Named Graphs


bind01 - BIND fixed data for OWL DL

Query evaluation test

Input Dataset:

Default Graph

entailment/bind-data.ttl

@prefix : <http://example.org/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:1 a owl:Ontology . :p a owl:DatatypeProperty . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

entailment/bind01.rq
PREFIX : <http://example.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?z
{
?s ?p ?o .
?p a owl:DatatypeProperty .
BIND(?o+10 AS ?z)
}

Results

entailment/bind01.srx


bind02 - BIND fixed data for OWL DL

Query evaluation test

Input Dataset:

Default Graph

entailment/bind-data.ttl

@prefix : <http://example.org/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:1 a owl:Ontology . :p a owl:DatatypeProperty . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

entailment/bind02.rq
PREFIX : <http://example.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?o ?z ?z2
{
?s ?p ?o .
?p a owl:DatatypeProperty .
BIND(?o+10 AS ?z)
BIND(?o+100 AS ?z2)
}

Results

entailment/bind02.srx


bind03 - BIND fixed data for OWL DL

Query evaluation test

Input Dataset:

Default Graph

entailment/bind-data.ttl

@prefix : <http://example.org/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:1 a owl:Ontology . :p a owl:DatatypeProperty . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

entailment/bind03.rq
PREFIX : <http://example.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?z ?s1
{
?s ?p ?o .
?p a owl:DatatypeProperty .
BIND(?o+1 AS ?z)
?s1 ?p1 ?z .
?p1 a owl:DatatypeProperty .
}

Results

entailment/bind03.srx


bind04 - BIND fixed data for OWL DL

Query evaluation test

Input Dataset:

Default Graph

entailment/bind-data.ttl

@prefix : <http://example.org/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:1 a owl:Ontology . :p a owl:DatatypeProperty . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

entailment/bind04.rq
PREFIX : <http://example.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT *
{
?s ?p ?o .
?p a owl:DatatypeProperty .
BIND(?nova AS ?z)
}

Results

entailment/bind04.srx


bind05 - BIND fixed data for OWL DL

Query evaluation test

Input Dataset:

Default Graph

entailment/bind-data.ttl

@prefix : <http://example.org/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:1 a owl:Ontology . :p a owl:DatatypeProperty . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

entailment/bind05.rq
PREFIX : <http://example.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?s ?p ?o ?z
{
?s ?p ?o .
?p a owl:DatatypeProperty .
BIND(?o+1 AS ?z)
FILTER(?z = 3 )
}

Results

entailment/bind05.srx


bind06 - BIND fixed data for OWL DL

Query evaluation test

Input Dataset:

Default Graph

entailment/bind-data.ttl

@prefix : <http://example.org/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:1 a owl:Ontology . :p a owl:DatatypeProperty . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

entailment/bind06.rq
PREFIX : <http://example.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT *
{
?s ?p ?o .
?p a owl:DatatypeProperty .
BIND(?o+10 AS ?z)
}

Results

entailment/bind06.srx


bind07 - BIND fixed data for OWL DL

Query evaluation test

Input Dataset:

Default Graph

entailment/bind-data.ttl

@prefix : <http://example.org/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:1 a owl:Ontology . :p a owl:DatatypeProperty . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

entailment/bind07.rq
PREFIX : <http://example.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?s ?p ?o ?z
{
?s ?p ?o .
?p a owl:DatatypeProperty .
{ BIND(?o+1 AS ?z) } UNION { BIND(?o+2 AS ?z) }
}

Results

entailment/bind07.srx


bind08 - BIND fixed data for OWL DL

Query evaluation test

Input Dataset:

Default Graph

entailment/bind-data.ttl

@prefix : <http://example.org/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:1 a owl:Ontology . :p a owl:DatatypeProperty . :s1 :p 1 . :s2 :p 2 . :s3 :p 3 . :s4 :p 4 .

Named Graphs

Query

entailment/bind08.rq
PREFIX : <http://example.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?s ?p ?o ?z
{
?s ?p ?o .
?p a owl:DatatypeProperty .
FILTER(?z = 3 )
BIND(?o+1 AS ?z)
}

Results

entailment/bind08.srx


D-Entailment test to show that neither literals in subject position nor newly introduced surrogate blank nodes are to be returned in query answers

Query evaluation test

Input Dataset:

Default Graph

entailment/d-ent-01.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . ex:p a owl:DatatypeProperty . ex:s ex:p 1 .

Named Graphs

Query

entailment/d-ent-01.rq
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?L
WHERE {
?L a xsd:integer
}

Results

entailment/d-ent-01.srx


Literal with language tag test

Query evaluation test

Input Dataset:

Default Graph

entailment/lang.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/test#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:ont a owl:Ontology . foaf:name a owl:DatatypeProperty . :a foaf:name "name" . :b foaf:name "name"@en .

Named Graphs

Query

entailment/lang.rq
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?x
WHERE { ?x foaf:name "name"@en .
}

Results

entailment/lang.srx


bnodes are not existentials

Query evaluation test

Input Dataset:

Default Graph

entailment/owlds01.ttl

@prefix : <http://example.org/x/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:ont a owl:Ontology . :p rdf:type owl:ObjectProperty . :c rdf:type owl:Class . :d rdf:type owl:Class . :a rdf:type owl:NamedIndividual . :a rdf:type :c . :a rdf:type :d . :a rdf:type _:x . _:x rdf:type owl:Restriction. _:x owl:onProperty :p. _:x owl:someValuesFrom :c .

Named Graphs

Query

entailment/owlds01.rq
PREFIX ex: <http://example.org/x/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?x ?c
WHERE {
?x rdf:type ?c .
?c rdfs:subClassOf ex:c .
?x ex:p _:y .

}

Results

entailment/owlds01.srx


bnodes are not existentials with answer

Query evaluation test

Input Dataset:

Default Graph

entailment/owlds02.ttl

@prefix : <http://example.org/x/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:ont a owl:Ontology . :p rdf:type owl:ObjectProperty . :c rdf:type owl:Class . :x rdf:type owl:NamedIndividual . :y rdf:type owl:NamedIndividual . :x :p :y. :y rdf:type :c. :x :p _:y. _:y rdf:type :c. :z rdf:type _:x. _:x rdf:type owl:Restriction. _:x owl:onProperty :p. _:x owl:someValuesFrom :c .

Named Graphs

Query

entailment/owlds02.rq
PREFIX : <http://example.org/x/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?x ?y
WHERE {
?x :p ?y .
?y rdf:type :c .
}

Results

entailment/owlds02.srx


paper-sparqldl-Q1

Query evaluation test

Input Dataset:

Default Graph

entailment/paper-sparqldl-data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @base <http://example.org/> . _:SPARQLDAWGTestOntology rdf:type owl:Ontology . :hasPublication rdf:type owl:ObjectProperty . :publishedAt rdf:type owl:ObjectProperty . :name rdf:type owl:DatatypeProperty . :Conference rdf:type owl:Class ; owl:disjointWith :Workshop . :ConferencePaper rdf:type owl:Class ; rdfs:subClassOf [ rdf:type owl:Restriction ; owl:onProperty :publishedAt ; owl:someValuesFrom :Conference ] . :Employee rdf:type owl:Class . :GraduateAssistant rdf:type owl:Class ; rdfs:subClassOf :Employee , :Student . :Student rdf:type owl:Class . :Workshop rdf:type owl:Class . :Anite rdf:type :Student , owl:NamedIndividual . :George rdf:type :Employee , owl:NamedIndividual . :John rdf:type :GraduateAssistant , owl:NamedIndividual ; :name "Johnnie" ; :hasPublication :paper1 . :paper1 rdf:type :ConferencePaper , owl:NamedIndividual . :person1 rdf:type owl:NamedIndividual ; :hasPublication :paper1 .

Named Graphs

Query

entailment/paper-sparqldl-Q1.rq
PREFIX ex: <http://example.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?c
WHERE {
?c rdfs:subClassOf ex:Student .
}

Results

entailment/paper-sparqldl-Q1.srx


paper-sparqldl-Q1-rdfs

Query evaluation test

Input Dataset:

Default Graph

entailment/paper-sparqldl-data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @base <http://example.org/> . _:SPARQLDAWGTestOntology rdf:type owl:Ontology . :hasPublication rdf:type owl:ObjectProperty . :publishedAt rdf:type owl:ObjectProperty . :name rdf:type owl:DatatypeProperty . :Conference rdf:type owl:Class ; owl:disjointWith :Workshop . :ConferencePaper rdf:type owl:Class ; rdfs:subClassOf [ rdf:type owl:Restriction ; owl:onProperty :publishedAt ; owl:someValuesFrom :Conference ] . :Employee rdf:type owl:Class . :GraduateAssistant rdf:type owl:Class ; rdfs:subClassOf :Employee , :Student . :Student rdf:type owl:Class . :Workshop rdf:type owl:Class . :Anite rdf:type :Student , owl:NamedIndividual . :George rdf:type :Employee , owl:NamedIndividual . :John rdf:type :GraduateAssistant , owl:NamedIndividual ; :name "Johnnie" ; :hasPublication :paper1 . :paper1 rdf:type :ConferencePaper , owl:NamedIndividual . :person1 rdf:type owl:NamedIndividual ; :hasPublication :paper1 .

Named Graphs

Query

entailment/paper-sparqldl-Q1.rq
PREFIX ex: <http://example.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?c
WHERE {
?c rdfs:subClassOf ex:Student .
}

Results

entailment/paper-sparqldl-Q1-rdfs.srx


paper-sparqldl-Q2

Query evaluation test

Input Dataset:

Default Graph

entailment/paper-sparqldl-data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @base <http://example.org/> . _:SPARQLDAWGTestOntology rdf:type owl:Ontology . :hasPublication rdf:type owl:ObjectProperty . :publishedAt rdf:type owl:ObjectProperty . :name rdf:type owl:DatatypeProperty . :Conference rdf:type owl:Class ; owl:disjointWith :Workshop . :ConferencePaper rdf:type owl:Class ; rdfs:subClassOf [ rdf:type owl:Restriction ; owl:onProperty :publishedAt ; owl:someValuesFrom :Conference ] . :Employee rdf:type owl:Class . :GraduateAssistant rdf:type owl:Class ; rdfs:subClassOf :Employee , :Student . :Student rdf:type owl:Class . :Workshop rdf:type owl:Class . :Anite rdf:type :Student , owl:NamedIndividual . :George rdf:type :Employee , owl:NamedIndividual . :John rdf:type :GraduateAssistant , owl:NamedIndividual ; :name "Johnnie" ; :hasPublication :paper1 . :paper1 rdf:type :ConferencePaper , owl:NamedIndividual . :person1 rdf:type owl:NamedIndividual ; :hasPublication :paper1 .

Named Graphs

Query

entailment/paper-sparqldl-Q2.rq
PREFIX ex: <http://example.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?x ?y
WHERE {
?x rdf:type _:c .
_:c owl:intersectionOf ( ex:Student ex:Employee ) .
?x ex:name ?y .
}

Results

entailment/paper-sparqldl-Q2.srx


paper-sparqldl-Q3

Query evaluation test

Input Dataset:

Default Graph

entailment/paper-sparqldl-data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @base <http://example.org/> . _:SPARQLDAWGTestOntology rdf:type owl:Ontology . :hasPublication rdf:type owl:ObjectProperty . :publishedAt rdf:type owl:ObjectProperty . :name rdf:type owl:DatatypeProperty . :Conference rdf:type owl:Class ; owl:disjointWith :Workshop . :ConferencePaper rdf:type owl:Class ; rdfs:subClassOf [ rdf:type owl:Restriction ; owl:onProperty :publishedAt ; owl:someValuesFrom :Conference ] . :Employee rdf:type owl:Class . :GraduateAssistant rdf:type owl:Class ; rdfs:subClassOf :Employee , :Student . :Student rdf:type owl:Class . :Workshop rdf:type owl:Class . :Anite rdf:type :Student , owl:NamedIndividual . :George rdf:type :Employee , owl:NamedIndividual . :John rdf:type :GraduateAssistant , owl:NamedIndividual ; :name "Johnnie" ; :hasPublication :paper1 . :paper1 rdf:type :ConferencePaper , owl:NamedIndividual . :person1 rdf:type owl:NamedIndividual ; :hasPublication :paper1 .

Named Graphs

Query

entailment/paper-sparqldl-Q3.rq
PREFIX ex: <http://example.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?x
WHERE {
?x ex:hasPublication _:b0 .
_:b0 rdf:type [
owl:onProperty ex:publishedAt ;
rdf:type owl:Restriction ;
owl:someValuesFrom [
rdf:type owl:Class ;
owl:complementOf ex:Workshop ]
]
}

Results

entailment/paper-sparqldl-Q3.srx


paper-sparqldl-Q4

Query evaluation test

Input Dataset:

Default Graph

entailment/paper-sparqldl-data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @base <http://example.org/> . _:SPARQLDAWGTestOntology rdf:type owl:Ontology . :hasPublication rdf:type owl:ObjectProperty . :publishedAt rdf:type owl:ObjectProperty . :name rdf:type owl:DatatypeProperty . :Conference rdf:type owl:Class ; owl:disjointWith :Workshop . :ConferencePaper rdf:type owl:Class ; rdfs:subClassOf [ rdf:type owl:Restriction ; owl:onProperty :publishedAt ; owl:someValuesFrom :Conference ] . :Employee rdf:type owl:Class . :GraduateAssistant rdf:type owl:Class ; rdfs:subClassOf :Employee , :Student . :Student rdf:type owl:Class . :Workshop rdf:type owl:Class . :Anite rdf:type :Student , owl:NamedIndividual . :George rdf:type :Employee , owl:NamedIndividual . :John rdf:type :GraduateAssistant , owl:NamedIndividual ; :name "Johnnie" ; :hasPublication :paper1 . :paper1 rdf:type :ConferencePaper , owl:NamedIndividual . :person1 rdf:type owl:NamedIndividual ; :hasPublication :paper1 .

Named Graphs

Query

entailment/paper-sparqldl-Q4.rq
PREFIX ex: <http://example.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?x ?c
WHERE {
?x rdf:type ex:Student .
?x rdf:type ?c .
?c rdfs:subClassOf ex:Employee .
}

Results

entailment/paper-sparqldl-Q4.srx


paper-sparqldl-Q5

Query evaluation test

Input Dataset:

Default Graph

entailment/paper-sparqldl-data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @base <http://example.org/> . _:SPARQLDAWGTestOntology rdf:type owl:Ontology . :hasPublication rdf:type owl:ObjectProperty . :publishedAt rdf:type owl:ObjectProperty . :name rdf:type owl:DatatypeProperty . :Conference rdf:type owl:Class ; owl:disjointWith :Workshop . :ConferencePaper rdf:type owl:Class ; rdfs:subClassOf [ rdf:type owl:Restriction ; owl:onProperty :publishedAt ; owl:someValuesFrom :Conference ] . :Employee rdf:type owl:Class . :GraduateAssistant rdf:type owl:Class ; rdfs:subClassOf :Employee , :Student . :Student rdf:type owl:Class . :Workshop rdf:type owl:Class . :Anite rdf:type :Student , owl:NamedIndividual . :George rdf:type :Employee , owl:NamedIndividual . :John rdf:type :GraduateAssistant , owl:NamedIndividual ; :name "Johnnie" ; :hasPublication :paper1 . :paper1 rdf:type :ConferencePaper , owl:NamedIndividual . :person1 rdf:type owl:NamedIndividual ; :hasPublication :paper1 .

Named Graphs

Query

entailment/paper-sparqldl-Q5.rq
PREFIX ex: <http://example.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?p ?v
WHERE {
?p rdf:type owl:ObjectProperty .
ex:John ?p ?v .
}

Results

entailment/paper-sparqldl-Q5.srx


filtered subclass query with (hasChild some Thing) restriction

Query evaluation test

Input Dataset:

Default Graph

entailment/parent.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix : <http://example.org/test#> . @base <http://example.org/test#> . _:ont rdf:type owl:Ontology . :hasChild rdf:type owl:ObjectProperty . :Father rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Male :Parent ) ] . :Female rdf:type owl:Class . :Male rdf:type owl:Class . :Mother rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Female :Parent ) ] . :Parent rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:someValuesFrom owl:Thing ] . :Alice rdf:type :Female , :Parent , owl:NamedIndividual . :Bob rdf:type :Male , owl:NamedIndividual ; :hasChild :Charlie . :Charlie rdf:type owl:NamedIndividual . :Dudley rdf:type owl:NamedIndividual , [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:allValuesFrom [ rdf:type owl:Class ; owl:oneOf ( :Alice ) ] ] ; :hasChild :Alice .

Named Graphs

Query

entailment/parent10.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT *
WHERE { ?C rdfs:subClassOf _:b .
FILTER( ?C != owl:Nothing )
_:b a owl:Restriction ;
owl:onProperty :hasChild ;
owl:someValuesFrom owl:Thing .
}

Results

entailment/parent10.srx


parent query with distinguished variable

Query evaluation test

Input Dataset:

Default Graph

entailment/parent.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix : <http://example.org/test#> . @base <http://example.org/test#> . _:ont rdf:type owl:Ontology . :hasChild rdf:type owl:ObjectProperty . :Father rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Male :Parent ) ] . :Female rdf:type owl:Class . :Male rdf:type owl:Class . :Mother rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Female :Parent ) ] . :Parent rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:someValuesFrom owl:Thing ] . :Alice rdf:type :Female , :Parent , owl:NamedIndividual . :Bob rdf:type :Male , owl:NamedIndividual ; :hasChild :Charlie . :Charlie rdf:type owl:NamedIndividual . :Dudley rdf:type owl:NamedIndividual , [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:allValuesFrom [ rdf:type owl:Class ; owl:oneOf ( :Alice ) ] ] ; :hasChild :Alice .

Named Graphs

Query

entailment/parent2.rq
PREFIX : <http://example.org/test#>

SELECT ?parent
WHERE { ?parent :hasChild ?child }

Results

entailment/parent2.srx


parent query with (hasChild some Thing) restriction

Query evaluation test

Input Dataset:

Default Graph

entailment/parent.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix : <http://example.org/test#> . @base <http://example.org/test#> . _:ont rdf:type owl:Ontology . :hasChild rdf:type owl:ObjectProperty . :Father rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Male :Parent ) ] . :Female rdf:type owl:Class . :Male rdf:type owl:Class . :Mother rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Female :Parent ) ] . :Parent rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:someValuesFrom owl:Thing ] . :Alice rdf:type :Female , :Parent , owl:NamedIndividual . :Bob rdf:type :Male , owl:NamedIndividual ; :hasChild :Charlie . :Charlie rdf:type owl:NamedIndividual . :Dudley rdf:type owl:NamedIndividual , [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:allValuesFrom [ rdf:type owl:Class ; owl:oneOf ( :Alice ) ] ] ; :hasChild :Alice .

Named Graphs

Query

entailment/parent3.rq
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT *
WHERE { ?parent a [
a owl:Restriction ;
owl:onProperty :hasChild ;
owl:someValuesFrom owl:Thing ] . }

Results

entailment/parent3.srx


parent query with (hasChild min 1) restriction

Query evaluation test

Input Dataset:

Default Graph

entailment/parent.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix : <http://example.org/test#> . @base <http://example.org/test#> . _:ont rdf:type owl:Ontology . :hasChild rdf:type owl:ObjectProperty . :Father rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Male :Parent ) ] . :Female rdf:type owl:Class . :Male rdf:type owl:Class . :Mother rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Female :Parent ) ] . :Parent rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:someValuesFrom owl:Thing ] . :Alice rdf:type :Female , :Parent , owl:NamedIndividual . :Bob rdf:type :Male , owl:NamedIndividual ; :hasChild :Charlie . :Charlie rdf:type owl:NamedIndividual . :Dudley rdf:type owl:NamedIndividual , [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:allValuesFrom [ rdf:type owl:Class ; owl:oneOf ( :Alice ) ] ] ; :hasChild :Alice .

Named Graphs

Query

entailment/parent4.rq
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http://example.org/test#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT *
WHERE { ?parent rdf:type [
a owl:Restriction ;
owl:onProperty :hasChild ;
owl:minCardinality "1"^^xsd:nonNegativeInteger ] . }

Results

entailment/parent4.srx


parent query with (hasChild some Female) restriction

Query evaluation test

Input Dataset:

Default Graph

entailment/parent.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix : <http://example.org/test#> . @base <http://example.org/test#> . _:ont rdf:type owl:Ontology . :hasChild rdf:type owl:ObjectProperty . :Father rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Male :Parent ) ] . :Female rdf:type owl:Class . :Male rdf:type owl:Class . :Mother rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Female :Parent ) ] . :Parent rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:someValuesFrom owl:Thing ] . :Alice rdf:type :Female , :Parent , owl:NamedIndividual . :Bob rdf:type :Male , owl:NamedIndividual ; :hasChild :Charlie . :Charlie rdf:type owl:NamedIndividual . :Dudley rdf:type owl:NamedIndividual , [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:allValuesFrom [ rdf:type owl:Class ; owl:oneOf ( :Alice ) ] ] ; :hasChild :Alice .

Named Graphs

Query

entailment/parent5.rq
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT *
WHERE { ?parent a [
a owl:Restriction ;
owl:onProperty :hasChild ;
owl:someValuesFrom :Female ] . }

Results

entailment/parent5.srx


parent query with (hasChild min 1 Female) restriction

Query evaluation test

Input Dataset:

Default Graph

entailment/parent.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix : <http://example.org/test#> . @base <http://example.org/test#> . _:ont rdf:type owl:Ontology . :hasChild rdf:type owl:ObjectProperty . :Father rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Male :Parent ) ] . :Female rdf:type owl:Class . :Male rdf:type owl:Class . :Mother rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Female :Parent ) ] . :Parent rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:someValuesFrom owl:Thing ] . :Alice rdf:type :Female , :Parent , owl:NamedIndividual . :Bob rdf:type :Male , owl:NamedIndividual ; :hasChild :Charlie . :Charlie rdf:type owl:NamedIndividual . :Dudley rdf:type owl:NamedIndividual , [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:allValuesFrom [ rdf:type owl:Class ; owl:oneOf ( :Alice ) ] ] ; :hasChild :Alice .

Named Graphs

Query

entailment/parent6.rq
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT *
WHERE { ?parent a [
a owl:Restriction ;
owl:onProperty :hasChild ;
owl:minQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
owl:onClass :Female ] . }

Results

entailment/parent6.srx


parent query with (hasChild max 1 Female) restriction

Query evaluation test

Input Dataset:

Default Graph

entailment/parent.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix : <http://example.org/test#> . @base <http://example.org/test#> . _:ont rdf:type owl:Ontology . :hasChild rdf:type owl:ObjectProperty . :Father rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Male :Parent ) ] . :Female rdf:type owl:Class . :Male rdf:type owl:Class . :Mother rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Female :Parent ) ] . :Parent rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:someValuesFrom owl:Thing ] . :Alice rdf:type :Female , :Parent , owl:NamedIndividual . :Bob rdf:type :Male , owl:NamedIndividual ; :hasChild :Charlie . :Charlie rdf:type owl:NamedIndividual . :Dudley rdf:type owl:NamedIndividual , [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:allValuesFrom [ rdf:type owl:Class ; owl:oneOf ( :Alice ) ] ] ; :hasChild :Alice .

Named Graphs

Query

entailment/parent7.rq
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT *
WHERE { ?parent a [
a owl:Restriction ;
owl:onProperty :hasChild ;
owl:maxQualifiedCardinality "1"^^xsd:nonNegativeInteger ;
owl:onClass :Female ] . }

Results

entailment/parent7.srx


parent query with (hasChild exactly 1 Female) restriction

Query evaluation test

Input Dataset:

Default Graph

entailment/parent.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix : <http://example.org/test#> . @base <http://example.org/test#> . _:ont rdf:type owl:Ontology . :hasChild rdf:type owl:ObjectProperty . :Father rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Male :Parent ) ] . :Female rdf:type owl:Class . :Male rdf:type owl:Class . :Mother rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Female :Parent ) ] . :Parent rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:someValuesFrom owl:Thing ] . :Alice rdf:type :Female , :Parent , owl:NamedIndividual . :Bob rdf:type :Male , owl:NamedIndividual ; :hasChild :Charlie . :Charlie rdf:type owl:NamedIndividual . :Dudley rdf:type owl:NamedIndividual , [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:allValuesFrom [ rdf:type owl:Class ; owl:oneOf ( :Alice ) ] ] ; :hasChild :Alice .

Named Graphs

Query

entailment/parent8.rq
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT *
WHERE { ?parent a [
a owl:Restriction ;
owl:onProperty :hasChild ;
owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
owl:onClass :Female ] . }

Results

entailment/parent8.srx


subclass query with (hasChild some Thing) restriction

Query evaluation test

Input Dataset:

Default Graph

entailment/parent.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix : <http://example.org/test#> . @base <http://example.org/test#> . _:ont rdf:type owl:Ontology . :hasChild rdf:type owl:ObjectProperty . :Father rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Male :Parent ) ] . :Female rdf:type owl:Class . :Male rdf:type owl:Class . :Mother rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Class ; owl:intersectionOf ( :Female :Parent ) ] . :Parent rdf:type owl:Class ; owl:equivalentClass [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:someValuesFrom owl:Thing ] . :Alice rdf:type :Female , :Parent , owl:NamedIndividual . :Bob rdf:type :Male , owl:NamedIndividual ; :hasChild :Charlie . :Charlie rdf:type owl:NamedIndividual . :Dudley rdf:type owl:NamedIndividual , [ rdf:type owl:Restriction ; owl:onProperty :hasChild ; owl:allValuesFrom [ rdf:type owl:Class ; owl:oneOf ( :Alice ) ] ] ; :hasChild :Alice .

Named Graphs

Query

entailment/parent9.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT *
WHERE { ?C rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty :hasChild ;
owl:someValuesFrom owl:Thing ] .
}

Results

entailment/parent9.srx


Plain literals with language tag are not the same as the same literal without

Query evaluation test

Input Dataset:

Default Graph

entailment/plainLit.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/test#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:ont a owl:Ontology . foaf:name a owl:DatatypeProperty . :a foaf:name "name" . :b foaf:name "name"@en .

Named Graphs

Query

entailment/plainLit.rq
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?x
WHERE { ?x foaf:name "name"@en .
}

Results

entailment/plainLit.srx


RDF inference test

Query evaluation test

Input Dataset:

Default Graph

entailment/rdf01.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:ont a owl:Ontology . ex:b a owl:ObjectProperty . ex:a ex:b ex:c .

Named Graphs

Query

entailment/rdf01.rq
PREFIX ex: <http://example.org/ns#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?x
WHERE {
ex:b ?x rdf:Property .
}

Results

entailment/rdf01.srx


RDF inference test

Query evaluation test

Input Dataset:

Default Graph

entailment/rdf02.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . ex:myBanana a ex:banana .

Named Graphs

Query

entailment/rdf02.rq
PREFIX ex: <http://example.org/ns#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?x
WHERE {
?x rdf:type ex:banana .
}

Results

entailment/rdf02.srx


RDF test for blank node cardinalities

Query evaluation test

Input Dataset:

Default Graph

entailment/rdf03.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . ex:a1 ex:b1 _:c1 . ex:a1 ex:b1 _:c2 . ex:a1 ex:b2 _:c3 .

Named Graphs

Query

entailment/rdf03.rq
PREFIX ex: <http://example.org/ns#>
SELECT ?x
WHERE {
?x ex:b1 _:c .
}

Results

entailment/rdf03.srx


simple triple pattern match

Query evaluation test

Input Dataset:

Default Graph

entailment/rdf04.ttl

@prefix : <http://example.org/x/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:ont a owl:Ontology . :x a owl:NamedIndividual . :y a owl:NamedIndividual . :p a owl:ObjectProperty . :c a owl:Class . :x :p :y. :x rdf:type :c.

Named Graphs

Query

entailment/rdf04.rq
PREFIX : <http://example.org/x/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?x
WHERE { ?x rdf:type :c . }

Results

entailment/rdf04.srx


RDFS inference test rdfs:subPropertyOf

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs01.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:rdfs01 a owl:Ontology . ex:a a owl:NamedIndividual . ex:c a owl:NamedIndividual . ex:b1 a owl:ObjectProperty . ex:b2 a owl:ObjectProperty . ex:a ex:b1 ex:c . ex:b1 rdfs:subPropertyOf ex:b2 .

Named Graphs

Query

entailment/rdfs01.rq
PREFIX ex: <http://example.org/ns#>
SELECT ?x
WHERE {
ex:a ?x ex:c .
}

Results

entailment/rdfs01.srx


RDFS inference test rdfs:subPropertyOf

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs01.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:rdfs01 a owl:Ontology . ex:a a owl:NamedIndividual . ex:c a owl:NamedIndividual . ex:b1 a owl:ObjectProperty . ex:b2 a owl:ObjectProperty . ex:a ex:b1 ex:c . ex:b1 rdfs:subPropertyOf ex:b2 .

Named Graphs

Query

entailment/rdfs02.rq
PREFIX ex: <http://example.org/ns#>
SELECT ?x
WHERE {
?x ex:b2 ex:c .
}

Results

entailment/rdfs02.srx


RDFS inference test combining subPropertyOf and domain

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs03.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . ex:a ex:b1 ex:c1 . ex:b1 rdfs:subPropertyOf ex:b2 . ex:b2 rdfs:domain ex:c2 .

Named Graphs

Query

entailment/rdfs03.rq
PREFIX ex: <http://example.org/ns#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?x
WHERE {
?x rdf:type ex:c2 .
}

Results

entailment/rdfs03.srx


RDFS inference test subClassOf

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs04.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:rdfs04 a owl:Ontology . ex:a a owl:NamedIndividual . ex:c1 a owl:Class . ex:c2 a owl:Class . ex:a rdf:type ex:c1 . ex:c1 rdfs:subClassOf ex:c2 .

Named Graphs

Query

entailment/rdfs04.rq
PREFIX ex: <http://example.org/ns#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?x
WHERE {
?x rdf:type ex:c2 .
}

Results

entailment/rdfs04.srx


RDFS inference test subClassOf

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs05.ttl

@prefix : <http://example.org/x/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:rdfs05 a owl:Ontology . :x a owl:NamedIndividual . :y a owl:NamedIndividual . :p a owl:ObjectProperty . :c a owl:Class . :d a owl:Class . :x :p :y . :x rdf:type :c . :c rdfs:subClassOf :d .

Named Graphs

Query

entailment/rdfs05.rq
PREFIX : <http://example.org/x/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?x ?c
WHERE { ?x rdf:type ?c . ?c rdfs:subClassOf :d }

Results

entailment/rdfs05.srx


RDFS inference test domain

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs06.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:rdfs06 a owl:Ontology . ex:a a owl:NamedIndividual . ex:c a owl:NamedIndividual . ex:b a owl:ObjectProperty . ex:aType a owl:Class . ex:a ex:b ex:c . ex:b rdfs:domain ex:aType .

Named Graphs

Query

entailment/rdfs06.rq
PREFIX ex: <http://example.org/ns#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?x
WHERE {
?x rdf:type ex:aType .
}

Results

entailment/rdfs06.srx


RDFS inference test range

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs07.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:rdfs07 a owl:Ontology . ex:a a owl:NamedIndividual . ex:c a owl:NamedIndividual . ex:b a owl:ObjectProperty . ex:cType a owl:Class . ex:a ex:b ex:c . ex:b rdfs:range ex:cType .

Named Graphs

Query

entailment/rdfs07.rq
PREFIX ex: <http://example.org/ns#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?x
WHERE {
?x rdf:type ex:cType .
}

Results

entailment/rdfs07.srx


RDFS inference test rdf:XMLLiteral subclass of rdfs:Literal

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs08.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:rdfs08 a owl:Ontology . ex:d a owl:DatatypeProperty . ex:d rdfs:range rdf:XMLLiteral .

Named Graphs

Query

entailment/rdfs08.rq
PREFIX ex: <http://example.org/ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?x
WHERE {
ex:d rdfs:range ?x .
}

Results

entailment/rdfs08.srx


RDFS inference test transitivity of subClassOf

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs09.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:rdfs09 a owl:Ontology . ex:c a owl:Class . ex:d a owl:Class . ex:e a owl:Class . ex:f a owl:Class . ex:a a owl:NamedIndividual . ex:c rdfs:subClassOf ex:d . ex:d rdfs:subClassOf ex:e . ex:e rdfs:subClassOf ex:f . ex:a rdf:type ex:c .

Named Graphs

Query

entailment/rdfs09.rq
PREFIX ex: <http://example.org/ns#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?x
WHERE {
?x rdf:type ex:f .
}

Results

entailment/rdfs09.srx


RDFS inference test transitivity of subPropertyOf

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs10.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:rdfs01 a owl:Ontology . ex:a a owl:NamedIndividual . ex:b a owl:NamedIndividual . ex:c a owl:ObjectProperty . ex:d a owl:ObjectProperty . ex:e a owl:ObjectProperty . ex:f a owl:ObjectProperty . ex:c rdfs:subPropertyOf ex:d . ex:d rdfs:subPropertyOf ex:e . ex:e rdfs:subPropertyOf ex:f . ex:a ex:c ex:b .

Named Graphs

Query

entailment/rdfs10.rq
PREFIX ex: <http://example.org/ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?x
WHERE {
?x ex:f ?y .
}

Results

entailment/rdfs10.srx


RDFS inference test subProperty and instances

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs11.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:rdfs11 a owl:Ontology . ex:a a owl:NamedIndividual . ex:c a owl:NamedIndividual . ex:b a owl:ObjectProperty . ex:a ex:b ex:c . ex:b rdfs:subPropertyOf ex:p .

Named Graphs

Query

entailment/rdfs11.rq
PREFIX ex: <http://example.org/ns#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?x
WHERE {
ex:a ?x ex:c . ?x rdfs:subPropertyOf ex:p .
}

Results

entailment/rdfs11.srx


RDFS inference test containers

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs12.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . ex:favourite-fruit a rdf:Seq . ex:favourite-fruit rdf:_1 ex:banana . ex:favourite-fruit rdf:_2 ex:apple . ex:favourite-fruit rdf:_3 ex:pear .

Named Graphs

Query

entailment/rdfs12.rq
PREFIX ex: <http://example.org/ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?x ?c
WHERE {
ex:favourite-fruit ?x ?c .
}

Results

entailment/rdfs12.srx


RDFS inference test to show that neither literals in subject position nor newly introduced surrogate blank nodes are to be returned in query answers

Query evaluation test

Input Dataset:

Default Graph

entailment/rdfs13.ttl

@prefix ex: <http://example.org/ns#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:ont a owl:Ontology . ex:p a owl:DatatypeProperty . ex:s ex:p "foo" .

Named Graphs

Query

entailment/rdfs13.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?L
WHERE {
?L a rdfs:Literal
}

Results

entailment/rdfs13.srx


simple 1

Query evaluation test

Input Dataset:

Default Graph

entailment/simple.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/test#> . _:simple a owl:Ontology . :A a owl:Class . :B a owl:Class . :C a owl:Class . :p a owl:ObjectProperty , owl:FunctionalProperty . :a a :A , :B ; :p :b . :b a :B ; :p :c . :c a :C ; :p :d . :d a :A , :B , :C .

Named Graphs

Query

entailment/simple1.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT ?x
WHERE {
?x a [
owl:intersectionOf ( :A :B )
] .
}

Results

entailment/simple1.srx


simple 2

Query evaluation test

Input Dataset:

Default Graph

entailment/simple.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/test#> . _:simple a owl:Ontology . :A a owl:Class . :B a owl:Class . :C a owl:Class . :p a owl:ObjectProperty , owl:FunctionalProperty . :a a :A , :B ; :p :b . :b a :B ; :p :c . :c a :C ; :p :d . :d a :A , :B , :C .

Named Graphs

Query

entailment/simple2.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT ?x
WHERE {
?x a [
owl:intersectionOf (
:A
[
a owl:Restriction ;
owl:onProperty :p ;
owl:someValuesFrom :B
]
)
] .
}

Results

entailment/simple2.srx


simple 3

Query evaluation test

Input Dataset:

Default Graph

entailment/simple.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/test#> . _:simple a owl:Ontology . :A a owl:Class . :B a owl:Class . :C a owl:Class . :p a owl:ObjectProperty , owl:FunctionalProperty . :a a :A , :B ; :p :b . :b a :B ; :p :c . :c a :C ; :p :d . :d a :A , :B , :C .

Named Graphs

Query

entailment/simple3.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT ?x
WHERE {
?x a [
a owl:Restriction ;
owl:onProperty :p ;
owl:someValuesFrom [
owl:intersectionOf ( :A :B )
]
]
}

Results

entailment/simple3.srx


simple 4

Query evaluation test

Input Dataset:

Default Graph

entailment/simple.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/test#> . _:simple a owl:Ontology . :A a owl:Class . :B a owl:Class . :C a owl:Class . :p a owl:ObjectProperty , owl:FunctionalProperty . :a a :A , :B ; :p :b . :b a :B ; :p :c . :c a :C ; :p :d . :d a :A , :B , :C .

Named Graphs

Query

entailment/simple4.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT ?x
WHERE {
?x a [
a owl:Class ;
owl:unionOf ( :B :C )
] .
}

Results

entailment/simple4.srx


simple 5

Query evaluation test

Input Dataset:

Default Graph

entailment/simple.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/test#> . _:simple a owl:Ontology . :A a owl:Class . :B a owl:Class . :C a owl:Class . :p a owl:ObjectProperty , owl:FunctionalProperty . :a a :A , :B ; :p :b . :b a :B ; :p :c . :c a :C ; :p :d . :d a :A , :B , :C .

Named Graphs

Query

entailment/simple5.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT ?x
WHERE {
?x a [
a owl:Restriction ;
owl:onProperty :p ;
owl:someValuesFrom [
a owl:Class ;
owl:unionOf ( :A :B )
]
]
}

Results

entailment/simple5.srx


simple 6

Query evaluation test

Input Dataset:

Default Graph

entailment/simple.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/test#> . _:simple a owl:Ontology . :A a owl:Class . :B a owl:Class . :C a owl:Class . :p a owl:ObjectProperty , owl:FunctionalProperty . :a a :A , :B ; :p :b . :b a :B ; :p :c . :c a :C ; :p :d . :d a :A , :B , :C .

Named Graphs

Query

entailment/simple6.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT ?x
WHERE {
?x a [
a owl:Restriction ;
owl:onProperty :p ;
owl:allValuesFrom [
a owl:Class ;
owl:unionOf ( :A :B :C )
]
]
}

Results

entailment/simple6.srx


simple 7

Query evaluation test

Input Dataset:

Default Graph

entailment/simple.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/test#> . _:simple a owl:Ontology . :A a owl:Class . :B a owl:Class . :C a owl:Class . :p a owl:ObjectProperty , owl:FunctionalProperty . :a a :A , :B ; :p :b . :b a :B ; :p :c . :c a :C ; :p :d . :d a :A , :B , :C .

Named Graphs

Query

entailment/simple7.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT ?x
WHERE {
?x a [
a owl:Class ;
owl:intersectionOf (
:A
[
a owl:Class ;
owl:unionOf ( :B :C )
]
)
]
}

Results

entailment/simple7.srx


simple 8

Query evaluation test

Input Dataset:

Default Graph

entailment/simple.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix : <http://example.org/test#> . _:simple a owl:Ontology . :A a owl:Class . :B a owl:Class . :C a owl:Class . :p a owl:ObjectProperty , owl:FunctionalProperty . :a a :A , :B ; :p :b . :b a :B ; :p :c . :c a :C ; :p :d . :d a :A , :B , :C .

Named Graphs

Query

entailment/simple8.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT ?x
WHERE {
?x a [
a owl:Restriction ;
owl:onProperty :p ;
owl:someValuesFrom [
a owl:Restriction ;
owl:onProperty :p ;
owl:someValuesFrom :B
]
]
}

Results

entailment/simple8.srx


sparqldl-01.rq: triple pattern

Query evaluation test

Input Dataset:

Default Graph

entailment/data-01.ttl

@prefix : <http://example.org/x/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:ont a owl:Ontology . :p a owl:ObjectProperty . :c a owl:Class . :x :p :y. :x rdf:type :c.

Named Graphs

Query

entailment/sparqldl-01.rq
PREFIX : <http://example.org/x/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?x
WHERE { ?x rdf:type :c . }

Results

entailment/sparqldl-01.srx


sparqldl-02.rq: simple combined query

Query evaluation test

Input Dataset:

Default Graph

entailment/data-01.ttl

@prefix : <http://example.org/x/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:ont a owl:Ontology . :p a owl:ObjectProperty . :c a owl:Class . :x :p :y. :x rdf:type :c.

Named Graphs

Query

entailment/sparqldl-02.rq
PREFIX : <http://example.org/x/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?x ?c
WHERE { ?x rdf:type ?c . ?c rdfs:subClassOf :c }

Results

entailment/sparqldl-02.srx


sparqldl-03.rq: combined query with complex class description

Query evaluation test

Input Dataset:

Default Graph

entailment/data-02.ttl

@prefix : <http://example.org/x/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:sparql-dl a owl:Ontology . :x rdf:type owl:NamedIndividual . :a rdf:type owl:NamedIndividual . :c rdf:type owl:Class . :d rdf:type owl:Class . :p rdf:type owl:ObjectProperty . :x rdf:type :c. :x rdf:type :d. :x rdf:type _:x. _:x rdf:type owl:Restriction. _:x owl:onProperty :p. _:x owl:someValuesFrom :c . :x :p :a . :a rdf:type :c .

Named Graphs

Query

entailment/sparqldl-03.rq
PREFIX : <http://example.org/x/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?x ?c
WHERE {
?x rdf:type ?c .
?c rdfs:subClassOf :c .
?x :p _:y .
}

Results

entailment/sparqldl-03.srx


sparqldl-04.rq: bug fixing test

Query evaluation test

Input Dataset:

Default Graph

entailment/data-03.ttl

@prefix : <http://example.org/test#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:ont a owl:Ontology . :a rdf:type owl:NamedIndividual . :b rdf:type owl:NamedIndividual . :c rdf:type owl:NamedIndividual . :Person rdf:type owl:Class . :name rdf:type owl:DatatypeProperty . :nick rdf:type owl:DatatypeProperty . :a rdf:type :Person. :b rdf:type :Person. :c rdf:type :Person. :a :name "A". :a :nick "Anick". :b :name "B". :b :nick "Bnick".

Named Graphs

Query

entailment/sparqldl-04.rq
# Query4

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http://example.org/test#>

SELECT ?X ?Y1 ?Y2
WHERE
{?X rdf:type :Person .
?X :name ?Y1 .
?X :nick ?Y2 .}

Results

entailment/sparqldl-04.srx


sparqldl-05.rq: simple undistinguished variable test.

Query evaluation test

Input Dataset:

Default Graph

entailment/data-03.ttl

@prefix : <http://example.org/test#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:ont a owl:Ontology . :a rdf:type owl:NamedIndividual . :b rdf:type owl:NamedIndividual . :c rdf:type owl:NamedIndividual . :Person rdf:type owl:Class . :name rdf:type owl:DatatypeProperty . :nick rdf:type owl:DatatypeProperty . :a rdf:type :Person. :b rdf:type :Person. :c rdf:type :Person. :a :name "A". :a :nick "Anick". :b :name "B". :b :nick "Bnick".

Named Graphs

Query

entailment/sparqldl-05.rq
# Query5

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http://example.org/test#>

ASK
WHERE
{_:a rdf:type :Person .}

Results

entailment/sparqldl-05.srx


sparqldl-06.rq: cycle of undistinguished variables

Query evaluation test

Input Dataset:

Default Graph

entailment/data-06.ttl

@prefix : <http://example.org/test#> . _:sparql-dl a owl:Ontology . :p rdf:type owl:ObjectProperty . :t rdf:type owl:ObjectProperty . :s rdf:type owl:ObjectProperty . :r rdf:type owl:ObjectProperty . :a rdf:type owl:NamedIndividual . :aa rdf:type owl:NamedIndividual . :bb rdf:type owl:NamedIndividual . :cc rdf:type owl:NamedIndividual . :dd rdf:type owl:NamedIndividual . :ee rdf:type owl:NamedIndividual . :a :p :aa. :dd :t :bb. :bb :s :aa. :cc :r :dd. :aa :r :ee.

Named Graphs

Query

entailment/sparqldl-06.rq
# Query6 - cycle with undistinguished variables

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http://example.org/test#>

ASK
WHERE
{
:a :p _:aa.
_:aa :r _:dd.
_:dd :t _:bb.
_:bb :s :a.
}

Results

entailment/sparqldl-06.srx


sparqldl-07.rq: two distinguished variables + undist.

Query evaluation test

Input Dataset:

Default Graph

entailment/data-06.ttl

@prefix : <http://example.org/test#> . _:sparql-dl a owl:Ontology . :p rdf:type owl:ObjectProperty . :t rdf:type owl:ObjectProperty . :s rdf:type owl:ObjectProperty . :r rdf:type owl:ObjectProperty . :a rdf:type owl:NamedIndividual . :aa rdf:type owl:NamedIndividual . :bb rdf:type owl:NamedIndividual . :cc rdf:type owl:NamedIndividual . :dd rdf:type owl:NamedIndividual . :ee rdf:type owl:NamedIndividual . :a :p :aa. :dd :t :bb. :bb :s :aa. :cc :r :dd. :aa :r :ee.

Named Graphs

Query

entailment/sparqldl-07.rq
# Query6 - cycle with undistinguished variables

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http://example.org/test#>

SELECT *
WHERE
{:a :p _:aa.
?X :t ?Y.
?Y :s _:aa.
_:aa :r ?Z.}

Results

entailment/sparqldl-07.srx


sparqldl-08.rq: two distinguished variables + undist.

Query evaluation test

Input Dataset:

Default Graph

entailment/data-06.ttl

@prefix : <http://example.org/test#> . _:sparql-dl a owl:Ontology . :p rdf:type owl:ObjectProperty . :t rdf:type owl:ObjectProperty . :s rdf:type owl:ObjectProperty . :r rdf:type owl:ObjectProperty . :a rdf:type owl:NamedIndividual . :aa rdf:type owl:NamedIndividual . :bb rdf:type owl:NamedIndividual . :cc rdf:type owl:NamedIndividual . :dd rdf:type owl:NamedIndividual . :ee rdf:type owl:NamedIndividual . :a :p :aa. :dd :t :bb. :bb :s :aa. :cc :r :dd. :aa :r :ee.

Named Graphs

Query

entailment/sparqldl-08.rq
# Query6 - articulation simplification test

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http://example.org/test#>

SELECT *
WHERE
{?X :p _:a.
_:a :r ?Y.}

Results

entailment/sparqldl-08.srx


sparqldl-09.rq: undist vars test

Query evaluation test

Input Dataset:

Default Graph

entailment/data-07.ttl

@prefix : <http://example.org/test#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:sparql-dl-07 a owl:Ontology . :p rdf:type owl:ObjectProperty . :q rdf:type owl:ObjectProperty . :a rdf:type owl:NamedIndividual . :b rdf:type owl:NamedIndividual . :c rdf:type owl:NamedIndividual . :h rdf:type owl:NamedIndividual . :i rdf:type owl:NamedIndividual . :x rdf:type owl:NamedIndividual . :a :p :b. :b :q :c. :b :q :h. :b :q :i. :x :q :x . :a rdf:type owl:Thing. :b rdf:type owl:Thing. :c rdf:type owl:Thing. :h rdf:type owl:Thing. :i rdf:type owl:Thing. :x rdf:type owl:Thing.

Named Graphs

Query

entailment/sparqldl-09.rq
# Query6 - articulation simplification test

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT *
WHERE
{
?X :p _:a.
_:a :q ?Y.

# ?X :p ?Y.
# ?Y :q _:a.

# ?X :p ?Y.
# ?Y rdf:type _:a.
# _:a rdf:type owl:Restriction.
# _:a owl:onProperty :q.
# _:a owl:someValuesFrom owl:Thing.
}

Results

entailment/sparqldl-09.srx


sparqldl-10.rq: undist vars test

Query evaluation test

Input Dataset:

Default Graph

entailment/data-07.ttl

@prefix : <http://example.org/test#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:sparql-dl-07 a owl:Ontology . :p rdf:type owl:ObjectProperty . :q rdf:type owl:ObjectProperty . :a rdf:type owl:NamedIndividual . :b rdf:type owl:NamedIndividual . :c rdf:type owl:NamedIndividual . :h rdf:type owl:NamedIndividual . :i rdf:type owl:NamedIndividual . :x rdf:type owl:NamedIndividual . :a :p :b. :b :q :c. :b :q :h. :b :q :i. :x :q :x . :a rdf:type owl:Thing. :b rdf:type owl:Thing. :c rdf:type owl:Thing. :h rdf:type owl:Thing. :i rdf:type owl:Thing. :x rdf:type owl:Thing.

Named Graphs

Query

entailment/sparqldl-10.rq
# Query6 - articulation simplification test

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT ?X ?Y
WHERE
{
?X :p ?a.
?a owl:sameAs ?b.
?b owl:sameAs ?Y.
?Y :q ?c.
}

Results

entailment/sparqldl-10.srx


sparqldl-11.rq: domain test

Query evaluation test

Input Dataset:

Default Graph

entailment/data-11.ttl

@prefix owl: <http://www.w3.org/2002/07/owl#>. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @prefix : <foo://bla/names#>. :Person a owl:Class . :kate a owl:NamedIndividual; a :Person; :name "Kate"; :child :john. :john a owl:NamedIndividual; a :Person; :name "John"; :child :alice. :alice a owl:NamedIndividual; a :Person; :name "Alice". :child a owl:ObjectProperty; rdfs:domain :Parent; owl:inverseOf :parent. :parent a owl:ObjectProperty. :Parent a owl:Class; owl:equivalentClass [a owl:Restriction; owl:onProperty :child; owl:minCardinality 1].

Named Graphs

Query

entailment/sparqldl-11.rq
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix : <foo://bla/names#>
select ?C
where {:parent rdfs:range ?C}

Results

entailment/sparqldl-11.srx


sparqldl-12.rq: range test

Query evaluation test

Input Dataset:

Default Graph

entailment/data-11.ttl

@prefix owl: <http://www.w3.org/2002/07/owl#>. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @prefix : <foo://bla/names#>. :Person a owl:Class . :kate a owl:NamedIndividual; a :Person; :name "Kate"; :child :john. :john a owl:NamedIndividual; a :Person; :name "John"; :child :alice. :alice a owl:NamedIndividual; a :Person; :name "Alice". :child a owl:ObjectProperty; rdfs:domain :Parent; owl:inverseOf :parent. :parent a owl:ObjectProperty. :Parent a owl:Class; owl:equivalentClass [a owl:Restriction; owl:onProperty :child; owl:minCardinality 1].

Named Graphs

Query

entailment/sparqldl-12.rq
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix : <foo://bla/names#>
select ?C
where {:child rdfs:domain ?C}

Results

entailment/sparqldl-12.srx


sparqldl-13.rq: sameAs

Query evaluation test

Input Dataset:

Default Graph

entailment/data-08.ttl

@prefix : <http://example.org/test#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . _:sparql-dl-08 a owl:Ontology . :p rdf:type owl:ObjectProperty . :q rdf:type owl:ObjectProperty . :a rdf:type owl:NamedIndividual . :b rdf:type owl:NamedIndividual . :c rdf:type owl:NamedIndividual . :d rdf:type owl:NamedIndividual . :x rdf:type owl:NamedIndividual . :a :p :b. :b :q :c. :b :q :d. :x :q :x . :b owl:sameAs :x .

Named Graphs

Query

entailment/sparqldl-13.rq
# Query13 - sameAs test

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX : <http://example.org/test#>

SELECT ?a ?b ?x
WHERE
{
?a :p ?b.
?b owl:sameAs ?x.
?x :q ?x.
}

Results

entailment/sparqldl-13.srx


Exists with one constant

Query evaluation test

Input Dataset:

Default Graph

exists/exists01.ttl

@prefix : <http://www.example.org/> . :s :p :o, :o1, :o2. :t :p :o1, :o2.

Named Graphs

Query

exists/exists01.rq
prefix ex: <http://www.example.org/>

select * where {
?s ?p ?o
filter exists {?s ?p ex:o}
}

Results

exists/exists01.srx


Exists with ground triple

Query evaluation test

Input Dataset:

Default Graph

exists/exists01.ttl

@prefix : <http://www.example.org/> . :s :p :o, :o1, :o2. :t :p :o1, :o2.

Named Graphs

Query

exists/exists02.rq
prefix ex: <http://www.example.org/>

select * where {
?s ?p ex:o2
filter exists {ex:s ex:p ex:o}
}

Results

exists/exists02.srx


Exists within graph pattern

Query evaluation test

Input Dataset:

Default Graph

exists/exists01.ttl

@prefix : <http://www.example.org/> . :s :p :o, :o1, :o2. :t :p :o1, :o2.

Named Graphs

exists/exists02.ttl

@prefix : <http://www.example.org/> . :a :p :o1. :b :p :o1, :o2.

Query

exists/exists03.rq
prefix ex: <http://www.example.org/>

select * where {
graph <exists02.ttl> {
?s ?p ex:o1
filter exists { ?s ?p ex:o2 }
}

}

Results

exists/exists03.srx


Nested positive exists

Query evaluation test

Input Dataset:

Default Graph

exists/exists01.ttl

@prefix : <http://www.example.org/> . :s :p :o, :o1, :o2. :t :p :o1, :o2.

Named Graphs

Query

exists/exists04.rq
prefix ex: <http://www.example.org/>

select * where {
?s ?p ex:o
filter exists { ?s ?p ex:o1 filter exists { ?s ?p ex:o2 } }
}

Results

exists/exists04.srx


Nested negative exists in positive exists

Query evaluation test

Input Dataset:

Default Graph

exists/exists01.ttl

@prefix : <http://www.example.org/> . :s :p :o, :o1, :o2. :t :p :o1, :o2.

Named Graphs

Query

exists/exists05.rq
prefix ex: <http://www.example.org/>

select * where {
?s ?p ex:o
filter exists { ?s ?p ex:o1 filter not exists { ?s ?p ex:o2 } }
}

Results

exists/exists05.srx


ABS()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/abs01.rq
PREFIX : <http://example.org/>
SELECT * WHERE {
?s :num ?num
FILTER(ABS(?num) >= 2)
}

Results

functions/abs01.srx


BNODE(str)

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/bnode01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s1 ?s2
(BNODE(?s1) AS ?b1) (BNODE(?s2) AS ?b2)
WHERE {
?a :str ?s1 .
?b :str ?s2 .
FILTER (?a = :s1 || ?a = :s3)
FILTER (?b = :s1 || ?b = :s3)
}

Results

functions/bnode01.srx


BNODE()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/bnode02.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT (BNODE() AS ?b1) (BNODE() AS ?b2)
WHERE {}

Results

functions/bnode02.srx


CEIL()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/ceil01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s ?num (CEIL(?num) AS ?ceil) WHERE {
?s :num ?num
}

Results

functions/ceil01.srx


COALESCE()

Query evaluation test

Input Dataset:

Default Graph

functions/data-coalesce.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n0 :p 1 . :n1 :p 0 ; :q 0 . :n2 :p 0 ; :q 2 . :n3 :p 4 ; :q 2 .

Named Graphs

Query

functions/coalesce01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT
(COALESCE(?x, -1) AS ?cx) # error when ?x is unbound -> -1
(COALESCE(?o/?x, -2) AS ?div) # error when ?x is unbound or zero -> -2
(COALESCE(?z, -3) AS ?def) # always unbound -> -3
(COALESCE(?z) AS ?err) # always an error -> unbound
WHERE {
?s :p ?o .
OPTIONAL {
?s :q ?x
}
}

Results

functions/coalesce01.srx


CONCAT()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/concat01.rq
PREFIX : <http://example.org/>
SELECT (CONCAT(?str1,?str2) AS ?str) WHERE {
:s6 :str ?str1 .
:s7 :str ?str2 .
}

Results

functions/concat01.srx


CONCAT() 2

Query evaluation test

Input Dataset:

Default Graph

functions/data2.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . :s1 :str "123" . :s2 :str "日本語"@ja . :s3 :str "english"@en . :s4 :str "français"@fr . :s5 :str "abc"^^xsd:string . :s6 :str "def"^^xsd:string . :s7 :str 7 .

Named Graphs

Query

functions/concat02.rq
PREFIX : <http://example.org/>
SELECT (CONCAT(?str1,?str2) AS ?str) WHERE {
?s1 :str ?str1 .
?s2 :str ?str2 .
}

Results

functions/concat02.srx


CONTAINS()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/contains01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s ?str WHERE {
?s :str ?str
FILTER CONTAINS(?str, "a")
}

Results

functions/contains01.srx


DAY()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/day-01.rq
PREFIX : <http://example.org/>
SELECT ?s (DAY(?date) AS ?x) WHERE {
?s :date ?date
}

Results

functions/day-01.srx


ENCODE_FOR_URI()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/encode01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s ?str (ENCODE_FOR_URI(?str) AS ?encoded) WHERE {
?s :str ?str
}

Results

functions/encode01.srx


STRENDS()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/ends01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s ?str WHERE {
?s ?p ?str
FILTER STRENDS(?str, "bc")
}

Results

functions/ends01.srx


FLOOR()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/floor01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s ?num (FLOOR(?num) AS ?floor) WHERE {
?s :num ?num
}

Results

functions/floor01.srx


HOURS()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/hours-01.rq
PREFIX : <http://example.org/>
SELECT ?s (HOURS(?date) AS ?x) WHERE {
?s :date ?date
}

Results

functions/hours-01.srx


IF()

Query evaluation test

Input Dataset:

Default Graph

functions/data2.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . :s1 :str "123" . :s2 :str "日本語"@ja . :s3 :str "english"@en . :s4 :str "français"@fr . :s5 :str "abc"^^xsd:string . :s6 :str "def"^^xsd:string . :s7 :str 7 .

Named Graphs

Query

functions/if01.rq
BASE <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?o (IF(lang(?o) = "ja", true, false) AS ?integer)
WHERE {
?s ?p ?o
}

Results

functions/if01.srx


IF() error propogation

Query evaluation test

Input Dataset:

Default Graph

functions/data2.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . :s1 :str "123" . :s2 :str "日本語"@ja . :s3 :str "english"@en . :s4 :str "français"@fr . :s5 :str "abc"^^xsd:string . :s6 :str "def"^^xsd:string . :s7 :str 7 .

Named Graphs

Query

functions/if02.rq
SELECT (IF(1/0, false, true) AS ?error) WHERE {}

Results

functions/if02.srx


IN 1

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/in01.rq
ASK {
FILTER(2 IN (1, 2, 3))
}

Results

functions/in01.srx


IN 2

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/in02.rq
ASK {
FILTER(2 IN (1, 3))
}

Results

functions/in02.srx


IRI()/URI()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/iri01.rq
BASE <http://example.org/>
SELECT (URI("uri") AS ?uri) (IRI("iri") AS ?iri)
WHERE {}

Results

functions/iri01.srx


isNumeric()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/isnumeric01.rq
PREFIX : <http://example.org/>
SELECT ?s ?num WHERE {
?s ?p ?num
FILTER isNumeric(?num)
}

Results

functions/isnumeric01.srx


LCASE()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/lcase01.rq
PREFIX : <http://example.org/>
SELECT ?s (LCASE(?str) AS ?lstr) WHERE {
?s :str ?str
}

Results

functions/lcase01.srx


STRLEN()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/length01.rq
PREFIX : <http://example.org/>
SELECT ?str (STRLEN(?str) AS ?len) WHERE {
?s :str ?str
}

Results

functions/length01.srx


MD5()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/md5-01.rq
PREFIX : <http://example.org/>
SELECT (MD5(?l) AS ?hash) WHERE {
:s1 :str ?l
}

Results

functions/md5-01.srx


MD5() over Unicode data

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/md5-02.rq
PREFIX : <http://example.org/>
SELECT (MD5(?l) AS ?hash) WHERE {
:s4 :str ?l
}

Results

functions/md5-02.srx


MINUTES()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/minutes-01.rq
PREFIX : <http://example.org/>
SELECT ?s (MINUTES(?date) AS ?x) WHERE {
?s :date ?date
}

Results

functions/minutes-01.srx


MONTH()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/month-01.rq
PREFIX : <http://example.org/>
SELECT ?s (MONTH(?date) AS ?x) WHERE {
?s :date ?date
}

Results

functions/month-01.srx


NOT IN 1

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/notin01.rq
ASK {
FILTER(2 NOT IN ())
}

Results

functions/notin01.srx


NOT IN 2

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/notin02.rq
ASK {
FILTER(2 NOT IN (1/0, 2))
}

Results

functions/notin02.srx


NOW()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/now01.rq
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK {
BIND(NOW() AS ?n)
FILTER(DATATYPE(?n) = xsd:dateTime)
}

Results

functions/now01.srx


plus-1

Query evaluation test

Input Dataset:

Default Graph

functions/data-builtin-3.ttl

@prefix : <http://example/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :x1 :p "a" ; :q 1 . :x2 :p _:b ; :q "1". :x3 :p :a ; :q "1". :x4 :p 1 ; :q 2 . :x5 :p 1.0 ; :q 2 . :x6 :p "1" ; :q "2" . :x7 :p "1"^^xsd:string ; :q "2" . :x8 :p "1"^^xsd:string ; :q 2 .

Named Graphs

Query

functions/plus-1.rq
PREFIX : <http://example/>
SELECT ?x ?y ( ?x + ?y AS ?sum)
WHERE
{ ?s :p ?x ; :q ?y .
}
ORDER BY ?x ?y ?sum

Results

functions/plus-1.srx


plus-2

Query evaluation test

Input Dataset:

Default Graph

functions/data-builtin-3.ttl

@prefix : <http://example/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :x1 :p "a" ; :q 1 . :x2 :p _:b ; :q "1". :x3 :p :a ; :q "1". :x4 :p 1 ; :q 2 . :x5 :p 1.0 ; :q 2 . :x6 :p "1" ; :q "2" . :x7 :p "1"^^xsd:string ; :q "2" . :x8 :p "1"^^xsd:string ; :q 2 .

Named Graphs

Query

functions/plus-2.rq
PREFIX : <http://example/>

SELECT ?x ?y ( str(?x) + str(?y) AS ?sum)
WHERE
{ ?s :p ?x ; :q ?y .
}
ORDER BY ?x ?y ?sum

Results

functions/plus-2.srx


RAND()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/rand01.rq
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ASK {
BIND(RAND() AS ?r)
FILTER(DATATYPE(?r) = xsd:double && ?r >= 0.0 && ?r < 1.0)
}

Results

functions/rand01.srx


REPLACE()

Query evaluation test

Input Dataset:

Default Graph

functions/data3.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . :s1 :str "123" . :s2 :str "日本語"@ja . :s3 :str "English"@en . :s4 :str "Français"@fr . :s5 :str "abc"^^xsd:string . :s6 :str "def"^^xsd:string . :s7 :str 7 . :s8 :str "banana" . :s9 :str "abcd" .

Named Graphs

Query

functions/replace01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s (REPLACE(?str,"[^a-z0-9]", "-") AS ?new) WHERE {
?s :str ?str
}

Results

functions/replace01.srx


REPLACE() with overlapping pattern

Query evaluation test

Input Dataset:

Default Graph

functions/data3.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . :s1 :str "123" . :s2 :str "日本語"@ja . :s3 :str "English"@en . :s4 :str "Français"@fr . :s5 :str "abc"^^xsd:string . :s6 :str "def"^^xsd:string . :s7 :str 7 . :s8 :str "banana" . :s9 :str "abcd" .

Named Graphs

Query

functions/replace02.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT (REPLACE(?str,"ana", "*") AS ?new) WHERE {
:s8 :str ?str
}

Results

functions/replace02.srx


REPLACE() with captured substring

Query evaluation test

Input Dataset:

Default Graph

functions/data3.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . :s1 :str "123" . :s2 :str "日本語"@ja . :s3 :str "English"@en . :s4 :str "Français"@fr . :s5 :str "abc"^^xsd:string . :s6 :str "def"^^xsd:string . :s7 :str 7 . :s8 :str "banana" . :s9 :str "abcd" .

Named Graphs

Query

functions/replace03.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT (REPLACE(?str,"(ab)|(a)", "[1=$1][2=$2]") AS ?new) WHERE {
:s9 :str ?str
}

Results

functions/replace03.srx


ROUND()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/round01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s ?num (ROUND(?num) AS ?round) WHERE {
?s :num ?num
}

Results

functions/round01.srx


SECONDS()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/seconds-01.rq
PREFIX : <http://example.org/>
SELECT ?s (SECONDS(?date) AS ?x) WHERE {
?s :date ?date
}

Results

functions/seconds-01.srx


SHA1()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/sha1-01.rq
PREFIX : <http://example.org/>
SELECT (SHA1(?l) AS ?hash) WHERE {
:s1 :str ?l
}

Results

functions/sha1-01.srx


SHA1() on Unicode data

Query evaluation test

Input Dataset:

Default Graph

functions/hash-unicode.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # string data :s8 :str "\u98DF" .

Named Graphs

Query

functions/sha1-02.rq
PREFIX : <http://example.org/>
SELECT (SHA1(?l) AS ?hash) WHERE {
:s8 :str ?l
}

Results

functions/sha1-02.srx


SHA256()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/sha256-01.rq
PREFIX : <http://example.org/>
SELECT (SHA256(?l) AS ?hash) WHERE {
:s1 :str ?l
}

Results

functions/sha256-01.srx


SHA256() on Unicode data

Query evaluation test

Input Dataset:

Default Graph

functions/hash-unicode.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # string data :s8 :str "\u98DF" .

Named Graphs

Query

functions/sha256-02.rq
PREFIX : <http://example.org/>
SELECT (SHA256(?l) AS ?hash) WHERE {
:s8 :str ?l
}

Results

functions/sha256-02.srx


SHA512()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/sha512-01.rq
PREFIX : <http://example.org/>
SELECT (SHA512(?l) AS ?hash) WHERE {
:s1 :str ?l
}

Results

functions/sha512-01.srx


SHA512() on Unicode data

Query evaluation test

Input Dataset:

Default Graph

functions/hash-unicode.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # string data :s8 :str "\u98DF" .

Named Graphs

Query

functions/sha512-02.rq
PREFIX : <http://example.org/>
SELECT (SHA512(?l) AS ?hash) WHERE {
:s8 :str ?l
}

Results

functions/sha512-02.srx


STRSTARTS()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/starts01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s ?str WHERE {
?s ?p ?str
FILTER STRSTARTS(STR(?str), "1")
}

Results

functions/starts01.srx


STRAFTER()

Query evaluation test

Input Dataset:

Default Graph

functions/data2.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . :s1 :str "123" . :s2 :str "日本語"@ja . :s3 :str "english"@en . :s4 :str "français"@fr . :s5 :str "abc"^^xsd:string . :s6 :str "def"^^xsd:string . :s7 :str 7 .

Named Graphs

Query

functions/strafter01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s (STRAFTER(?str,"e") AS ?suffix) WHERE {
?s :str ?str
}

Results

functions/strafter01a.srx


STRAFTER() datatyping

Query evaluation test

Input Dataset:

Default Graph

functions/data4.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . :s1 :str "abc" . :s2 :str "abc"@en . :s3 :str "abc"^^xsd:string .

Named Graphs

Query

functions/strafter02.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT
?s
?str
(STRAFTER(?str,"b") AS ?ab)
(STRAFTER(?str,"ab") AS ?aab)
(STRAFTER(?str,"b"@cy) AS ?abcy)
(STRAFTER(?str,"") AS ?a)
(STRAFTER(?str,""@en) AS ?aen)
(STRAFTER(?str,"b"^^xsd:string) AS ?abx)
(STRAFTER(?str,"xyz"^^xsd:string) AS ?axyzx)
WHERE {
?s :str ?str
}

Results

functions/strafter02.srx


STRBEFORE()

Query evaluation test

Input Dataset:

Default Graph

functions/data2.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . :s1 :str "123" . :s2 :str "日本語"@ja . :s3 :str "english"@en . :s4 :str "français"@fr . :s5 :str "abc"^^xsd:string . :s6 :str "def"^^xsd:string . :s7 :str 7 .

Named Graphs

Query

functions/strbefore01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s (STRBEFORE(?str,"s") AS ?prefix) WHERE {
?s :str ?str
}

Results

functions/strbefore01a.srx


STRBEFORE() datatyping

Query evaluation test

Input Dataset:

Default Graph

functions/data4.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . :s1 :str "abc" . :s2 :str "abc"@en . :s3 :str "abc"^^xsd:string .

Named Graphs

Query

functions/strbefore02.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT
?s
?str
(STRBEFORE(?str,"b") AS ?bb)
(STRBEFORE(?str,"bc") AS ?bbc)
(STRBEFORE(?str,"b"@cy) AS ?bbcy)
(STRBEFORE(?str,"") AS ?b)
(STRBEFORE(?str,""@en) AS ?ben)
(STRBEFORE(?str,"b"^^xsd:string) AS ?bbx)
(STRBEFORE(?str,"xyz"^^xsd:string) AS ?bxyzx)
WHERE {
?s :str ?str
}

Results

functions/strbefore02.srx


STRDT()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/strdt01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s (STRDT(?str,xsd:string) AS ?str1) WHERE {
?s :str ?str
FILTER(LANGMATCHES(LANG(?str), "en"))
}

Results

functions/strdt01.srx


STRDT(STR())

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/strdt02.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s (STRDT(STR(?str),xsd:string) AS ?str1) WHERE {
?s :str ?str
FILTER(LANGMATCHES(LANG(?str), "en"))
}

Results

functions/strdt02.srx


STRDT() TypeErrors

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/strdt03.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?s (STRDT(?o,xsd:string) AS ?str1) WHERE {
?s ?p ?o
}

Results

functions/strdt03.srx


STRLANG()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/strlang01.rq
PREFIX : <http://example.org/>
SELECT ?s (STRLANG(?str,"en-US") AS ?s2) WHERE {
?s :str ?str
FILTER(LANGMATCHES(LANG(?str), "en"))
}

Results

functions/strlang01.srx


STRLANG(STR())

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/strlang02.rq
PREFIX : <http://example.org/>
SELECT ?s (STRLANG(STR(?str),"en-US") AS ?s2) WHERE {
?s :str ?str
FILTER(LANGMATCHES(LANG(?str), "en"))
}

Results

functions/strlang02.srx


STRLANG() TypeErrors

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/strlang03.rq
PREFIX : <http://example.org/>
SELECT ?s (STRLANG(?o,"en-US") AS ?str1) WHERE {
?s ?p ?o
}

Results

functions/strlang03.srx


STRUUID() pattern match

Query evaluation test

Input Dataset:

Default Graph

functions/data-empty.nt

Named Graphs

Query

functions/struuid01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT (STRLEN(?uuid) AS ?length)
WHERE {
BIND(STRUUID() AS ?uuid)
FILTER(ISLITERAL(?uuid) && REGEX(?uuid, "^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$", "i"))
}

Results

functions/struuid01.srx


SUBSTR() (3-argument)

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/substring01.rq
PREFIX : <http://example.org/>
SELECT ?s ?str (SUBSTR(?str,1,1) AS ?substr) WHERE {
?s :str ?str
}

Results

functions/substring01.srx


SUBSTR() (2-argument)

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/substring02.rq
PREFIX : <http://example.org/>
SELECT ?s ?str (SUBSTR(?str,2) AS ?substr) WHERE {
?s :str ?str
}

Results

functions/substring02.srx


TIMEZONE()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/timezone-01.rq
PREFIX : <http://example.org/>
SELECT ?s (TIMEZONE(?date) AS ?x) WHERE {
?s :date ?date
}

Results

functions/timezone-01.srx


TZ()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/tz-01.rq
PREFIX : <http://example.org/>
SELECT ?s (TZ(?date) AS ?x) WHERE {
?s :date ?date
}

Results

functions/tz-01.srx


UCASE()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/ucase01.rq
PREFIX : <http://example.org/>
SELECT ?s (UCASE(?str) AS ?ustr) WHERE {
?s :str ?str
}

Results

functions/ucase01.srx


UUID() pattern match

Query evaluation test

Input Dataset:

Default Graph

functions/data-empty.nt

Named Graphs

Query

functions/uuid01.rq
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT (STRLEN(STR(?uuid)) AS ?length)
WHERE {
BIND(UUID() AS ?uuid)
FILTER(ISIRI(?uuid) && REGEX(STR(?uuid), "^urn:uuid:[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$", "i"))
}

Results

functions/uuid01.srx


YEAR()

Query evaluation test

Input Dataset:

Default Graph

functions/data.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix : <http://example.org/> . # numeric data :n4 :num -2 . :n1 :num -1 . :n2 :num -1.6 . :n3 :num 1.1 . :n5 :num 2.5 . # string data :s1 :str "foo" . :s2 :str "bar"@en . :s3 :str "BAZ" . :s4 :str "食べ物" . :s5 :str "100%" . :s6 :str "abc"^^xsd:string . :s7 :str "DEF"^^xsd:string . # date data :d1 :date "2010-06-21T11:28:01Z"^^xsd:dateTime . :d2 :date "2010-12-21T15:38:02-08:00"^^xsd:dateTime . :d3 :date "2008-06-20T23:59:00Z"^^xsd:dateTime . :d4 :date "2011-02-01T01:02:03"^^xsd:dateTime .

Named Graphs

Query

functions/year-01.rq
PREFIX : <http://example.org/>
SELECT ?s (YEAR(?date) AS ?x) WHERE {
?s :date ?date
}

Results

functions/year-01.srx


Group-1

Query evaluation test

Input Dataset:

Default Graph

grouping/group-data-1.ttl

@prefix : <http://example/> . :s1 :p 1 . :s1 :q 9 . :s2 :p 2 .

Named Graphs

Query

grouping/group01.rq
PREFIX : <http://example/>

SELECT ?s
{
?s :p ?v .
}
GROUP BY ?s

Results

grouping/group01.srx


Group-3

Query evaluation test

Input Dataset:

Default Graph

grouping/group-data-1.ttl

@prefix : <http://example/> . :s1 :p 1 . :s1 :q 9 . :s2 :p 2 .

Named Graphs

Query

grouping/group03.rq
PREFIX : <http://example/>

SELECT ?w (SAMPLE(?v) AS ?S)
{
?s :p ?v .
OPTIONAL { ?s :q ?w }
}
GROUP BY ?w

Results

grouping/group03.srx


Group-4

Query evaluation test

Input Dataset:

Default Graph

grouping/group-data-1.ttl

@prefix : <http://example/> . :s1 :p 1 . :s1 :q 9 . :s2 :p 2 .

Named Graphs

Query

grouping/group04.rq
PREFIX : <http://example/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT ?X (SAMPLE(?v) AS ?S)
{
?s :p ?v .
OPTIONAL { ?s :q ?w }
}
GROUP BY (COALESCE(?w, "1605-11-05"^^xsd:date) AS ?X)

Results

grouping/group04.srx


Group-5

Query evaluation test

Input Dataset:

Default Graph

grouping/group-data-2.ttl

@prefix : <http://example/> . :s1 :p 1 . :s3 :p 1 . :s1 :q 9 . :s2 :p 2 .

Named Graphs

Query

grouping/group05.rq
PREFIX : <http://example/>

SELECT ?s ?w
{
?s :p ?v .
OPTIONAL { ?s :q ?w }
}
GROUP BY ?s ?w

Results

grouping/group05.srx


Group-6

Negative syntax test

Query

grouping/group06.rq
PREFIX : <http://example/>

SELECT ?s ?v
{
?s :p ?v .
}
GROUP BY ?s

Group-7

Negative syntax test

Query

grouping/group07.rq
prefix lode: <http://linkedevents.org/ontology/>
prefix dc: <http://purl.org/dc/elements/1.1/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>

select ?event ?eventName ?venue ?photo
where {
?photo lode:illustrate ?event .
{
select ?event ?eventName ?venue
where {
?event dc:title ?eventName .
?event lode:atPlace ?venue .
?venue rdfs:label "Live Music Hall" .
}
}
}
GROUP BY ?event

jsonres01 - JSON Result Format

Query evaluation test

Input Dataset:

Default Graph

json-res/data.ttl

@prefix : <http://example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :s1 :p1 :s2 . :s2 :p2 "foo" . :s3 :p2 "bar"^^xsd:string . :s4 :p4 4 . :s5 :p5 "5"^^xsd:decimal. :s6 :p6 _:o6.

Named Graphs

Query

json-res/jsonres01.rq
PREFIX : <http://example.org/>

SELECT * WHERE { ?s ?p ?o} ORDER BY ?s ?p ?o

Results

json-res/jsonres01.srj


jsonres02 - JSON Result Format

Query evaluation test

Input Dataset:

Default Graph

json-res/data.ttl

@prefix : <http://example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :s1 :p1 :s2 . :s2 :p2 "foo" . :s3 :p2 "bar"^^xsd:string . :s4 :p4 4 . :s5 :p5 "5"^^xsd:decimal. :s6 :p6 _:o6.

Named Graphs

Query

json-res/jsonres02.rq
PREFIX : <http://example.org/>

SELECT * WHERE { ?s ?p ?o OPTIONAL {?o ?p2 ?o2 } } ORDER BY ?s ?p ?o ?p2 ?o2

Results

json-res/jsonres02.srj


jsonres03 - JSON Result Format

Query evaluation test

Input Dataset:

Default Graph

json-res/data.ttl

@prefix : <http://example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :s1 :p1 :s2 . :s2 :p2 "foo" . :s3 :p2 "bar"^^xsd:string . :s4 :p4 4 . :s5 :p5 "5"^^xsd:decimal. :s6 :p6 _:o6.

Named Graphs

Query

json-res/jsonres03.rq
PREFIX : <http://example.org/>

ASK WHERE { :s1 :p1 :s2 }

Results

json-res/jsonres03.srj


jsonres04 - JSON Result Format

Query evaluation test

Input Dataset:

Default Graph

json-res/data.ttl

@prefix : <http://example.org/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . :s1 :p1 :s2 . :s2 :p2 "foo" . :s3 :p2 "bar"^^xsd:string . :s4 :p4 4 . :s5 :p5 "5"^^xsd:decimal. :s6 :p6 _:o6.

Named Graphs

Query

json-res/jsonres04.rq
PREFIX : <http://example.org/>

ASK WHERE { :s1 :p1 :o1 }

Results

json-res/jsonres04.srj


MOVE 1

Update evaluation test

Input Dataset:

Default Graph

move/move-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :tom a foaf:Person . :tom foaf:givenName "Tom" . :tom foaf:mbox <mailto:tom@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

Update

move/move-01.ru
PREFIX : <http://example.org/>
MOVE DEFAULT TO :g1

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :tom a foaf:Person . :tom foaf:givenName "Tom" . :tom foaf:mbox <mailto:tom@example.org> .

MOVE 2

Update evaluation test

Input Dataset:

Default Graph

move/move-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :tom a foaf:Person . :tom foaf:givenName "Tom" . :tom foaf:mbox <mailto:tom@example.org> .

Named Graphs

Update

move/move-01.ru
PREFIX : <http://example.org/>
MOVE DEFAULT TO :g1

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :tom a foaf:Person . :tom foaf:givenName "Tom" . :tom foaf:mbox <mailto:tom@example.org> .

MOVE 3

Update evaluation test

Input Dataset:

Default Graph

move/move-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :tom a foaf:Person . :tom foaf:givenName "Tom" . :tom foaf:mbox <mailto:tom@example.org> .

Named Graphs

http://example.org/g2

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :mickey a foaf:Person . :mickey foaf:givenName "Mickey" . :mickey foaf:mbox <mailto:mickey@example.org> .

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

Update

move/move-03.ru
PREFIX : <http://example.org/>
MOVE :g1 TO :g2

Result Dataset:

Default Graph

move/move-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :tom a foaf:Person . :tom foaf:givenName "Tom" . :tom foaf:mbox <mailto:tom@example.org> .

Named Graphs

http://example.org/g2

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

MOVE 4

Update evaluation test

Input Dataset:

Default Graph

move/move-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :tom a foaf:Person . :tom foaf:givenName "Tom" . :tom foaf:mbox <mailto:tom@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

Update

move/move-03.ru
PREFIX : <http://example.org/>
MOVE :g1 TO :g2

Result Dataset:

Default Graph

move/move-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :tom a foaf:Person . :tom foaf:givenName "Tom" . :tom foaf:mbox <mailto:tom@example.org> .

Named Graphs

http://example.org/g2

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

MOVE 6

Update evaluation test

Input Dataset:

Default Graph

move/move-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :tom a foaf:Person . :tom foaf:givenName "Tom" . :tom foaf:mbox <mailto:tom@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

Update

move/move-06.ru
PREFIX : <http://example.org/>
MOVE :g1 TO DEFAULT

Result Dataset:

Default Graph

move/move-01.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

Named Graphs


MOVE 7

Update evaluation test

Input Dataset:

Default Graph

move/move-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :tom a foaf:Person . :tom foaf:givenName "Tom" . :tom foaf:mbox <mailto:tom@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

Update

move/move-07.ru
PREFIX : <http://example.org/>
MOVE :g1 TO :g1

Result Dataset:

Default Graph

move/move-default.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :tom a foaf:Person . :tom foaf:givenName "Tom" . :tom foaf:mbox <mailto:tom@example.org> .

Named Graphs

http://example.org/g1

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/> . :jerry a foaf:Person . :jerry foaf:givenName "Jerry" . :jerry foaf:mbox <mailto:jerry@example.org> .

Positive EXISTS 1

Query evaluation test

Input Dataset:

Default Graph

negation/set-data.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix : <http://example/> . :a rdf:type :Set . :a :member 1 . :a :member 2 . :a :member 3 . :b rdf:type :Set . :b :member 1 . :b :member 9 . :c rdf:type :Set . :c :member 1 . :c :member 2 . :d rdf:type :Set . :d :member 1 . :d :member 9 . :e rdf:type :Set . :e :member 1 . :e :member 2 . :empty rdf:type :Set .

Named Graphs

Query

negation/exists-01.rq
PREFIX : <http://example/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
# SPARQL 1.1
SELECT *
WHERE
{
?set a :Set .
FILTER EXISTS {
?set :member 9
}
}

Results

negation/exists-01.srx


Positive EXISTS 2

Query evaluation test

Input Dataset:

Default Graph

negation/set-data.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix : <http://example/> . :a rdf:type :Set . :a :member 1 . :a :member 2 . :a :member 3 . :b rdf:type :Set . :b :member 1 . :b :member 9 . :c rdf:type :Set . :c :member 1 . :c :member 2 . :d rdf:type :Set . :d :member 1 . :d :member 9 . :e rdf:type :Set . :e :member 1 . :e :member 2 . :empty rdf:type :Set .

Named Graphs

Query

negation/exists-02.rq
PREFIX : <http://example/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
# SPARQL 1.1
SELECT *
WHERE
{
?set a :Set .
FILTER EXISTS {
?set :member 7
}
}

Results

negation/exists-02.srx


Subtraction with MINUS from a fully bound minuend

Query evaluation test

Input Dataset:

Default Graph

negation/full-minuend.ttl

@prefix : <http://example/> . :a0 :p1 :b0 ; :p2 :c0 . :a1 :p1 :b1 ; :p2 :c1 . :a2 :p1 :b2 ; :p2 :c2 . :a3 :p1 :b3 ; :p2 :c3 . :d0 a :Sub . :d1 a :Sub ; :q1 :b1 ; :q2 :c1 . :d2 a :Sub ; :q1 :b2 . :d3 a :Sub ; :q1 :b3 ; :q2 :cx .

Named Graphs

Query

negation/full-minuend.rq
prefix : <http://example/>

select ?a ?b ?c {
?a :p1 ?b; :p2 ?c
MINUS {
?d a :Sub
OPTIONAL { ?d :q1 ?b }
OPTIONAL { ?d :q2 ?c }
}
}
order by ?a

Results

negation/full-minuend.srx


Subtraction with MINUS from a partially bound minuend

Query evaluation test

Input Dataset:

Default Graph

negation/part-minuend.ttl

@prefix : <http://example/> . :a1 a :Min ; :p1 :b1 . :a2 a :Min ; :p1 :b2 . :a3 a :Min ; :p1 :b3 . :a4 a :Min . :d1 a :Sub ; :q1 :b1 . :d3 a :Sub ; :q1 :b3 ; :q2 :c3 . :d4 a :Sub ; :q1 :b4 ; :q2 :c4 . :d5 a :Sub .

Named Graphs

Query

negation/part-minuend.rq
prefix : <http://example/>

select ?a ?b ?c {
?a a :Min
OPTIONAL { ?a :p1 ?b }
OPTIONAL { ?a :p2 ?c }
MINUS {
?d a :Sub
OPTIONAL { ?d :q1 ?b }
OPTIONAL { ?d :q2 ?c }
}
}
order by ?a

Results

negation/part-minuend.srx


Calculate which sets have the same elements

Query evaluation test

Input Dataset:

Default Graph

negation/set-data.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix : <http://example/> . :a rdf:type :Set . :a :member 1 . :a :member 2 . :a :member 3 . :b rdf:type :Set . :b :member 1 . :b :member 9 . :c rdf:type :Set . :c :member 1 . :c :member 2 . :d rdf:type :Set . :d :member 1 . :d :member 9 . :e rdf:type :Set . :e :member 1 . :e :member 2 . :empty rdf:type :Set .

Named Graphs

Query

negation/set-equals-1.rq
PREFIX : <http://example/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

# Find sets that have exactly the same members.
# Find all (s1,s2) such that (s1 subset of s) and (s2 subset of s1).

SELECT DISTINCT ?s1 ?s2
WHERE
{
# All pairs of sets (no duplicates, not reveres pairs)
?s2 rdf:type :Set .
?s1 rdf:type :Set .
FILTER(str(?s1) < str(?s2))
MINUS
{
?s1 rdf:type :Set .
?s2 rdf:type :Set .
?s1 :member ?x .
FILTER NOT EXISTS { ?s2 :member ?x . }
}
MINUS
{
?s1 rdf:type :Set .
?s2 rdf:type :Set .
?s2 :member ?x .
FILTER NOT EXISTS { ?s1 :member ?x . }
}
}

Results

negation/set-equals-1.srx


Calculate which sets are subsets of others (include A subsetOf A)

Query evaluation test

Input Dataset:

Default Graph

negation/set-data.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix : <http://example/> . :a rdf:type :Set . :a :member 1 . :a :member 2 . :a :member 3 . :b rdf:type :Set . :b :member 1 . :b :member 9 . :c rdf:type :Set . :c :member 1 . :c :member 2 . :d rdf:type :Set . :d :member 1 . :d :member 9 . :e rdf:type :Set . :e :member 1 . :e :member 2 . :empty rdf:type :Set .

Named Graphs

Query

negation/subset-01.rq
PREFIX : <http://example/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
# SPARQL 1.1
SELECT (?s1 AS ?subset) (?s2 AS ?superset)
WHERE
{
# All pairs of sets except (S,S)
?s2 rdf:type :Set .
?s1 rdf:type :Set .
FILTER(?s1 != ?s2)
MINUS
{
# The MINUS RHS is (?s1, ?s2) where
# ?s1 has a member not in ?s2
?s1 rdf:type :Set .
?s2 rdf:type :Set .
FILTER(?s1 != ?s2)

?s1 :member ?x .
FILTER NOT EXISTS { ?s2 :member ?x . }
}
}

Results

negation/subset-01.srx


Calculate which sets are subsets of others (exclude A subsetOf A)

Query evaluation test

Input Dataset:

Default Graph

negation/set-data.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix : <http://example/> . :a rdf:type :Set . :a :member 1 . :a :member 2 . :a :member 3 . :b rdf:type :Set . :b :member 1 . :b :member 9 . :c rdf:type :Set . :c :member 1 . :c :member 2 . :d rdf:type :Set . :d :member 1 . :d :member 9 . :e rdf:type :Set . :e :member 1 . :e :member 2 . :empty rdf:type :Set .

Named Graphs

Query

negation/subset-02.rq
PREFIX : <http://example/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT (?s1 AS ?subset) (?s2 AS ?superset)
WHERE
{
# All pairs of sets
?s2 rdf:type :Set .
?s1 rdf:type :Set .

MINUS {
?s1 rdf:type :Set .
?s2 rdf:type :Set .
# Assumes ?s1 has at least one member
?s1 :member ?x .
# If we want to exclude A as a subset of A.
# This is not perfect as "?s1 = ?s2" is not a
# contents based comparison.
FILTER ( ?s1 = ?s2 || NOT EXISTS { ?s2 :member ?x . } )
}
MINUS {
# If we don't want the empty set being a subset of itself.
?s1 rdf:type :Set .
?s2 rdf:type :Set .
# Choose the pair (empty set, empty set)
FILTER ( NOT EXISTS { ?s1 :member ?y . } )
FILTER ( NOT EXISTS { ?s2 :member ?y . } )
}
}

Results

negation/subset-02.srx


Calculate proper subset

Query evaluation test

Input Dataset:

Default Graph

negation/set-data.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix : <http://example/> . :a rdf:type :Set . :a :member 1 . :a :member 2 . :a :member 3 . :b rdf:type :Set . :b :member 1 . :b :member 9 . :c rdf:type :Set . :c :member 1 . :c :member 2 . :d rdf:type :Set . :d :member 1 . :d :member 9 . :e rdf:type :Set . :e :member 1 . :e :member 2 . :empty rdf:type :Set .

Named Graphs

Query

negation/subset-03.rq
PREFIX : <http://example/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT (?s1 AS ?subset) (?s2 AS ?superset)
WHERE
{
# All pairs of sets except (S,S)
?s2 rdf:type :Set .
?s1 rdf:type :Set .
MINUS {
# See subset-01 ...
?s1 rdf:type :Set .
?s2 rdf:type :Set .
?s1 :member ?x .
FILTER ( NOT EXISTS { ?s2 :member ?x . } )
}
# Remove those that are the pairs with the same elements.
# See set-equals-1
MINUS {
?s2 rdf:type :Set .
?s1 rdf:type :Set .
MINUS
{
?s1 rdf:type :Set .
?s2 rdf:type :Set .
?s1 :member ?x .
FILTER NOT EXISTS { ?s2 :member ?x . }
}
MINUS
{
?s1 rdf:type :Set .
?s2 rdf:type :Set .
?s2 :member ?x .
FILTER NOT EXISTS { ?s1 :member ?x . }
}
}
}

Results

negation/subset-03.srx


Subsets by exclusion (MINUS)

Query evaluation test

Input Dataset:

Default Graph

negation/subsetByExcl.ttl

@prefix ex: <http://www.w3.org/2009/sparql/docs/tests/data-sparql11/negation#> . ex:lifeForm1 a ex:Mammal, ex:Animal . ex:lifeForm2 a ex:Reptile, ex:Animal . ex:lifeForm3 a ex:Insect, ex:Animal .

Named Graphs

Query

negation/subsetByExcl02.rq
PREFIX ex: <http://www.w3.org/2009/sparql/docs/tests/data-sparql11/negation#>
SELECT ?animal {
?animal a ex:Animal MINUS {
?animal a ?type
FILTER(?type = ex:Reptile || ?type = ex:Insect)
}
}

Results

negation/subsetByExcl02.srx


Subsets by exclusion (NOT EXISTS)

Query evaluation test

Input Dataset:

Default Graph

negation/subsetByExcl.ttl

@prefix ex: <http://www.w3.org/2009/sparql/docs/tests/data-sparql11/negation#> . ex:lifeForm1 a ex:Mammal, ex:Animal . ex:lifeForm2 a ex:Reptile, ex:Animal . ex:lifeForm3 a ex:Insect, ex:Animal .

Named Graphs

Query

negation/subsetByExcl01.rq
PREFIX ex: <http://www.w3.org/2009/sparql/docs/tests/data-sparql11/negation#>
SELECT ?animal {
?animal a ex:Animal
FILTER NOT EXISTS { ?animal a ex:Insect }
}

Results

negation/subsetByExcl01.srx


Medical, temporal proximity by exclusion (NOT EXISTS)

Query evaluation test

Input Dataset:

Default Graph

negation/temporalProximity01.ttl

@prefix ex: <http://www.w3.org/2009/sparql/docs/tests/data-sparql11/negation#> . @prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . ex:examination1 a ex:PhysicalExamination; dc:date "2010-01-10"^^xsd:date ; ex:precedes ex:operation1 ; ex:follows ex:examination2 . ex:operation1 a ex:SurgicalProcedure; dc:date "2010-01-15"^^xsd:date; ex:follows ex:examination1, ex:examination2 . ex:examination2 a ex:PhysicalExamination; dc:date "2010-01-02"^^xsd:date; ex:precedes ex:operation1, ex:examination1 .

Named Graphs

Query

negation/temporalProximity01.rq
PREFIX ex: <http://www.w3.org/2009/sparql/docs/tests/data-sparql11/negation#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>

# The closest pre-operative physical examination
SELECT ?exam ?date {
?exam a ex:PhysicalExamination;
dc:date ?date;
ex:precedes ex:operation1 .
?op a ex:SurgicalProcedure; dc:date ?opDT .
FILTER NOT EXISTS {
?otherExam a ex:PhysicalExamination;
ex:follows ?exam;
ex:precedes ex:operation1
}
}

Results

negation/temporalProximity01.srx


Expression is equality

Query evaluation test

Input Dataset:

Default Graph

project-expression/projexp01.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p 1 . in:a ex:q 1 . in:a ex:q 2 .

Named Graphs

Query

project-expression/projexp01.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x ?y ?z ((?y = ?z) as ?eq) where {
?x ex:p ?y .
?x ex:q ?z
}

Results

project-expression/projexp01.srx


Expression raise an error

Query evaluation test

Input Dataset:

Default Graph

project-expression/projexp02.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p 1 . in:a ex:q 1 . in:a ex:q "foobar" .

Named Graphs

Query

project-expression/projexp02.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x ?y ?z ((?y + ?z) as ?sum) where {
?x ex:p ?y .
?x ex:q ?z
}

Results

project-expression/projexp02.srx


Reuse a project expression variable in select

Query evaluation test

Input Dataset:

Default Graph

project-expression/projexp03.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p 1 . in:a ex:q 2 .

Named Graphs

Query

project-expression/projexp03.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x ?y ?z
((?y + ?z) as ?sum)
((2 * ?sum) as ?twice)
where {
?x ex:p ?y .
?x ex:q ?z
}

Results

project-expression/projexp03.srx


Reuse a project expression variable in order by

Query evaluation test

Input Dataset:

Default Graph

project-expression/projexp04.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p 1 . in:a ex:p 2 .

Named Graphs

Query

project-expression/projexp04.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x ?y
((?y + ?y) as ?sum)
where {
?x ex:p ?y
}
order by ?sum

Results

project-expression/projexp04.srx


Expression may return no value

Query evaluation test

Input Dataset:

Default Graph

project-expression/projexp05.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p 1 . in:a ex:p ex:a .

Named Graphs

Query

project-expression/projexp05.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x ?l (datatype(?l) as ?dt) where {
?x ex:p ?l
}

Results

project-expression/projexp05.srx


Expression has undefined variable

Query evaluation test

Input Dataset:

Default Graph

project-expression/projexp06.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p 1 .

Named Graphs

Query

project-expression/projexp06.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x ?l (datatype(?m) as ?dt) where {
?x ex:p ?l
}

Results

project-expression/projexp06.srx


Expression has variable that may be unbound

Query evaluation test

Input Dataset:

Default Graph

project-expression/projexp07.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p 1 . in:a ex:q 2 . in:b ex:p 3 .

Named Graphs

Query

project-expression/projexp07.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x (datatype(?l) as ?dt) where {
?x ex:p ?y .
optional {?x ex:q ?l}
}

Results

project-expression/projexp07.srx


(pp01) Simple path

Query evaluation test

Input Dataset:

Default Graph

property-path/pp01.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p1 in:b . in:b ex:p2 in:a . in:a ex:p3 in:c .

Named Graphs

Query

property-path/pp01.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select * where {
in:a ex:p1/ex:p2/ex:p3 ?x
}

Results

property-path/pp01.srx


(pp02) Star path

Query evaluation test

Input Dataset:

Default Graph

property-path/pp01.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p1 in:b . in:b ex:p2 in:a . in:a ex:p3 in:c .

Named Graphs

Query

property-path/pp02.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select * where {
in:a (ex:p1/ex:p2/ex:p3)* ?x
}

Results

property-path/pp02.srx


(pp03) Simple path with loop

Query evaluation test

Input Dataset:

Default Graph

property-path/pp03.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p1 in:b . in:b ex:p2 in:a . in:a ex:p3 in:b . in:b ex:p4 in:a .

Named Graphs

Query

property-path/pp03.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select * where {
in:a ex:p1/ex:p2/ex:p3/ex:p4 ?x
}

Results

property-path/pp03.srx


(pp06) Path with two graphs

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

property-path/pp062.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:b ex:p2 in:c .

property-path/pp061.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p1 in:b .

Query

property-path/pp06.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x where {
graph ?g {in:a ex:p1/ex:p2 ?x}
}

Results

property-path/pp06.srx


(pp07) Path with one graph

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

property-path/pp07.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p1 in:b . in:b ex:p2 in:c .

Query

property-path/pp06.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x where {
graph ?g {in:a ex:p1/ex:p2 ?x}
}

Results

property-path/pp07.srx


(pp08) Reverse path

Query evaluation test

Input Dataset:

Default Graph

property-path/pp08.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p in:b .

Named Graphs

Query

property-path/pp08.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

ask {
in:b ^ex:p in:a
}

Results

property-path/pp08.srx


(pp09) Reverse sequence path

Query evaluation test

Input Dataset:

Default Graph

property-path/pp09.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p1 in:b . in:b ex:p2 in:c .

Named Graphs

Query

property-path/pp09.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select * where {
in:c ^(ex:p1/ex:p2) ?x
}

Results

property-path/pp09.srx


(pp10) Path with negation

Query evaluation test

Input Dataset:

Default Graph

property-path/pp10.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p1 in:b . in:a ex:p2 in:c . in:a ex:p3 in:d .

Named Graphs

Query

property-path/pp10.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select * where {
in:a !(ex:p1|ex:p2) ?x
}

Results

property-path/pp10.srx


(pp11) Simple path and two paths to same target node

Query evaluation test

Input Dataset:

Default Graph

property-path/pp11.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p1 in:b . in:b ex:p2 in:c . in:a ex:p1 in:d . in:d ex:p2 in:c .

Named Graphs

Query

property-path/pp11.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select * where {
in:a ex:p1/ex:p2 ?x
}

Results

property-path/pp11.srx


(pp12) Variable length path and two paths to same target node

Query evaluation test

Input Dataset:

Default Graph

property-path/pp11.ttl

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix ex: <http://www.example.org/schema#>. @prefix in: <http://www.example.org/instance#>. in:a ex:p1 in:b . in:b ex:p2 in:c . in:a ex:p1 in:d . in:d ex:p2 in:c .

Named Graphs

Query

property-path/pp12.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select * where {
in:a (ex:p1/ex:p2)+ ?x
}

Results

property-path/pp12.srx


(pp14) Star path over foaf:knows

Query evaluation test

Input Dataset:

Default Graph

property-path/pp14.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:knows :c .

Named Graphs

Query

property-path/pp14.rq
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT *
WHERE { ?X foaf:knows* ?Y }
ORDER BY ?X ?Y


Results

property-path/pp14.srx


(pp16) Duplicate paths and cycles through foaf:knows*

Query evaluation test

Input Dataset:

Default Graph

property-path/pp16.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:knows :c . :a foaf:knows :c . :d foaf:knows :e . :e foaf:knows :f . :f foaf:knows :e . :f foaf:name "test" . :a foaf:homepage :h .

Named Graphs

Query

property-path/pp14.rq
PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT *
WHERE { ?X foaf:knows* ?Y }
ORDER BY ?X ?Y


Results

property-path/pp16.srx


(pp21) Diamond -- :p+

Query evaluation test

Input Dataset:

Default Graph

property-path/data-diamond.ttl

@prefix : <http://example/> . :a :p :b . :b :p :z . :a :p :c . :c :p :z .

Named Graphs

Query

property-path/path-2-2.rq
prefix : <http://example/>

select * where {
:a :p+ ?z
}

Results

property-path/diamond-2.srx


(pp23) Diamond, with tail -- :p+

Query evaluation test

Input Dataset:

Default Graph

property-path/data-diamond-tail.ttl

@prefix : <http://example/> . :a :p :b . :b :p :z . :a :p :c . :c :p :z . :z :p :X .

Named Graphs

Query

property-path/path-2-2.rq
prefix : <http://example/>

select * where {
:a :p+ ?z
}

Results

property-path/diamond-tail-2.srx


(pp25) Diamond, with loop -- :p+

Query evaluation test

Input Dataset:

Default Graph

property-path/data-diamond-loop.ttl

@prefix : <http://example/> . :a :p :b . :b :p :z . :a :p :c . :c :p :z . :c :p :c .

Named Graphs

Query

property-path/path-2-2.rq
prefix : <http://example/>

select * where {
:a :p+ ?z
}

Results

property-path/diamond-loop-2.srx


(pp28a) Diamond, with loop -- (:p/:p)?

Query evaluation test

Input Dataset:

Default Graph

property-path/data-diamond-loop.ttl

@prefix : <http://example/> . :a :p :b . :b :p :z . :a :p :c . :c :p :z . :c :p :c .

Named Graphs

Query

property-path/path-3-3.rq
prefix : <http://example/>

select * where {
:a (:p/:p)? ?t
}

Results

property-path/diamond-loop-5a.srx


(pp30) Operator precedence 1

Query evaluation test

Input Dataset:

Default Graph

property-path/path-p1.ttl

@prefix : <http://www.example.org/> . :a :p1 :b . :b :p4 :c . :a :p2 :d . :d :p3 :c . :a :p1 :e .

Named Graphs

Query

property-path/path-p1.rq
prefix : <http://www.example.org/>
select ?t
where {
:a :p1|:p2/:p3|:p4 ?t
}

Results

property-path/path-p1.srx


(pp31) Operator precedence 2

Query evaluation test

Input Dataset:

Default Graph

property-path/path-p1.ttl

@prefix : <http://www.example.org/> . :a :p1 :b . :b :p4 :c . :a :p2 :d . :d :p3 :c . :a :p1 :e .

Named Graphs

Query

property-path/path-p2.rq
prefix : <http://www.example.org/>
select ?t
where {
:a (:p1|:p2)/(:p3|:p4) ?t
}

Results

property-path/path-p2.srx


(pp32) Operator precedence 3

Query evaluation test

Input Dataset:

Default Graph

property-path/path-p3.ttl

@prefix : <http://www.example.org/> . :a :p0 :c . :a :p3 :b . :d :p1 :a . :d :p2 :e . :c :p2 :f . :c :p3 :g .

Named Graphs

Query

property-path/path-p3.rq
prefix : <http://www.example.org/>
select ?t
where {
:a :p0|^:p1/:p2|:p3 ?t
}

Results

property-path/path-p3.srx


(pp33) Operator precedence 4

Query evaluation test

Input Dataset:

Default Graph

property-path/path-p3.ttl

@prefix : <http://www.example.org/> . :a :p0 :c . :a :p3 :b . :d :p1 :a . :d :p2 :e . :c :p2 :f . :c :p3 :g .

Named Graphs

Query

property-path/path-p4.rq
prefix : <http://www.example.org/>
select ?t
where {
:a (:p0|^:p1)/:p2|:p3 ?t
}

Results

property-path/path-p4.srx


(pp34) Named Graph 1

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

property-path/ng-03.ttl

@prefix : <http://www.example.org/> . :a :p1 :d .

property-path/ng-02.ttl

@prefix : <http://www.example.org/> . :a :p1 :c .

property-path/ng-01.ttl

@prefix : <http://www.example.org/> . :a :p1 :b .

Query

property-path/path-ng-01.rq
prefix : <http://www.example.org/>
select ?t
where {
GRAPH <ng-01.ttl> {
?s :p1* ?t }
}

Results

property-path/path-ng-01.srx


(pp35) Named Graph 2

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

property-path/ng-03.ttl

@prefix : <http://www.example.org/> . :a :p1 :d .

property-path/ng-02.ttl

@prefix : <http://www.example.org/> . :a :p1 :c .

property-path/ng-01.ttl

@prefix : <http://www.example.org/> . :a :p1 :b .

Query

property-path/path-ng-02.rq
prefix : <http://www.example.org/>
select ?t
where {
GRAPH ?g {
?s :p1* ?t }
FILTER (?g = <ng-01.ttl>)
}

Results

property-path/path-ng-01.srx


(pp36) Arbitrary path with bound endpoints

Query evaluation test

Input Dataset:

Default Graph

property-path/clique3.ttl

@prefix : <http://example.org/> . :a0 :p :a1, :a2 . :a1 :p :a0, :a2 . :a2 :p :a0, :a1 .

Named Graphs

Query

property-path/pp36.rq
PREFIX : <http://example.org/>
SELECT * WHERE { :a0 (:p)* :a1 }

Results

property-path/pp36.srx


(pp37) Nested (*)*

Query evaluation test

Input Dataset:

Default Graph

property-path/pp37.ttl

@prefix : <http://example.org/> . :A0 :P :A1, :A2 . :A1 :P :A0, :A2 . :A2 :P :A0, :A1 .

Named Graphs

Query

property-path/pp37.rq
prefix : <http://example.org/>
select ?X where { :A0 ((:P)*)* ?X }
order by ?X

Results

property-path/pp37.srx


invoke query operation with more than one query string

Protocol test

invoke update operation with more than one update string

Protocol test

invoke query operation with a method other than GET or POST

Protocol test

invoke query operation with SPARQL body, but without application/sparql-query media type

Protocol test

invoke query operation with url-encoded body, but without application/x-www-url-form-urlencoded media type

Protocol test

invoke query operation with direct POST, but with a non-UTF8 encoding (UTF-16)

Protocol test

invoke query operation with invalid query syntax (4XX result)

Protocol test

invoke query operation with a POST with media type that's not url-encoded or application/sparql-query

Protocol test

invoke update with both using-graph-uri/using-named-graph-uri parameter and USING/WITH clause

Protocol test

invoke update operation with GET

Protocol test

invoke update operation with url-encoded body, but without application/x-www-url-form-urlencoded media type

Protocol test

invoke update operation with direct POST, but with a non-UTF8 encoding

Protocol test

invoke update operation with invalid update syntax

Protocol test

invoke update operation with a POST with media type that's not url-encoded or application/sparql-update

Protocol test

query appropriate content type (expect one of: XML, JSON)

Protocol test

query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa)

Protocol test

query appropriate content type (expect one of: RDF/XML, Turtle, N-Triples, RDFa)

Protocol test

query appropriate content type (expect one of: XML, JSON, CSV, TSV)

Protocol test

GET query with protocol-specified default graph

Protocol test

POST query with protocol-specified default graphs

Protocol test

query with protocol-specified dataset (both named and default graphs)

Protocol test

GET query with protocol-specified named graphs

Protocol test

POST query with protocol-specified named graphs

Protocol test

query via GET

Protocol test

query specifying dataset in both query string and protocol; test for use of protocol-specified dataset

Protocol test

query via POST directly

Protocol test

query via URL-encoded POST

Protocol test

test for service-defined BASE URI ("which MAY be the service endpoint")

Protocol test

update with protocol-specified default graph

Protocol test

update with protocol-specified default graphs

Protocol test

update with protocol-specified dataset (both named and default graphs)

Protocol test

update with protocol-specified named graphs

Protocol test

update via POST directly

Protocol test

update via URL-encoded POST

Protocol test

Service description conforms to schema

Service description test

Service description contains a matching sd:endpoint triple

Service description test

GET on endpoint returns RDF

Service description test

SERVICE test 1

Query evaluation test

Input Dataset:

Default Graph

service/data01.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :b foaf:name "Bob" .

Named Graphs

Remote Endpoint: http://example.org/sparql

Default Graph

service/data01endpoint.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:interest "SPARQL 1.1 Basic Federated Query" . :b foaf:interest "SPARQL 1.1 Query" .
Named Graphs

Query

service/service01.rq
# SERVICE join with pattern in the default graph

PREFIX : <http://example.org/>

SELECT ?s ?o1 ?o2
{
?s ?p1 ?o1 .
SERVICE <http://example.org/sparql> {
?s ?p2 ?o2
}
}

Results

service/service01.srx


SERVICE test 2

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

Remote Endpoint: http://example2.org/sparql

Default Graph

service/data02endpoint2.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:interest "SPARQL 1.1 Basic Federated Query" .
Named Graphs

Remote Endpoint: http://example1.org/sparql

Default Graph

service/data02endpoint1.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :b foaf:name "Bob" .
Named Graphs

Query

service/service02.rq
# SERVICE and OPTIONAL

PREFIX : <http://example.org/>

SELECT ?s ?o1 ?o2
{
SERVICE <http://example1.org/sparql> {
?s ?p ?o1 . }
OPTIONAL {
SERVICE <http://example2.org/sparql> {
?s ?p2 ?o2 }
}
}

Results

service/service02.srx


SERVICE test 3

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

Remote Endpoint: http://example1.org/sparql

Default Graph

service/data03endpoint1.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :b foaf:name "Bob" .
Named Graphs

Remote Endpoint: http://example2.org/sparql

Default Graph

service/data03endpoint2.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:interest "SPARQL 1.1 Basic Federated Query" .
Named Graphs

Query

service/service03.rq
# SERVICE with one optional and a nested SERVICE. This query depends in the capabilities of the example1.org endpoint

PREFIX : <http://example.org/>

SELECT ?s ?o1 ?o2
{
SERVICE <http://example1.org/sparql> {
?s ?p ?o1 .
OPTIONAL {
SERVICE <http://example2.org/sparql> {
?s ?p2 ?o2 }
}
}
}

Results

service/service03.srx


SERVICE test 4a with VALUES clause

Query evaluation test

Input Dataset:

Default Graph

service/data04.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :a foaf:mbox "alan@example.org" . :b foaf:name "Bob" . :b foaf:mbox "bob@example.org" . :c foaf:name "Alice" . :c foaf:mbox "alice@example.org" .

Named Graphs

Remote Endpoint: http://example.org/sparql

Default Graph

service/data04endpoint.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:knows :b . :b foaf:knows :c . :a foaf:interest "SPARQL 1.1 Basic Federated Query" . :b foaf:interest "SPARQL 1.1 Query" .
Named Graphs

Query

service/service04a.rq
# bindings with two variables and two sets of values

PREFIX : <http://example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?s ?o1 ?o2
{
?s ?p1 ?o1
OPTIONAL { SERVICE <http://example.org/sparql> {?s foaf:knows ?o2 }}
} VALUES (?o2) {
(:b)
}

Results

service/service04.srx


SERVICE test 5

Query evaluation test

Input Dataset:

Default Graph

service/data05.ttl

@prefix void: <http://rdfs.org/ns/void#> . @prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix doap: <http://usefulinc.com/ns/doap#> . [] dc:subject "Query remote RDF Data" ; void:sparqlEndpoint <http://example1.org/sparql> . [] dc:subject "Update remote RDF Data" ; void:sparqlEndpoint <http://example2.org/sparql> . [] dc:subject "Query RDF" ; void:sparqlEndpoint <http://example3.org/sparql> .

Named Graphs

Remote Endpoint: http://example1.org/sparql

Default Graph

service/data05endpoint1.ttl

@prefix doap: <http://usefulinc.com/ns/doap#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . _:project1 doap:name "Query remote RDF Data" . _:project1 doap:created "2011-02-12"^^xsd:date . _:project2 doap:name "Query multiple SPARQL endpoints" . _:project2 doap:created "2011-02-13"^^xsd:date .
Named Graphs

Remote Endpoint: http://example2.org/sparql

Default Graph

service/data05endpoint2.ttl

@prefix doap: <http://usefulinc.com/ns/doap#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . _:project3 doap:name "Update remote RDF Data" . _:project3 doap:created "2011-02-14"^^xsd:date .
Named Graphs

Query

service/service05.rq
PREFIX void: <http://rdfs.org/ns/void#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX doap: <http://usefulinc.com/ns/doap#>

SELECT ?service ?title
WHERE {
{
# Find the service with subject "remote".
# Inner block to fix the FILTER not be over
# just this local pattern.
?p dc:subject ?projectSubject ;
void:sparqlEndpoint ?service
FILTER regex(?projectSubject, "remote")
}

# Query that service projects.

SERVICE ?service {
?project doap:name ?title . }
}

Results

service/service05.srx


SERVICE test 6

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

Remote Endpoint: http://example1.org/sparql

Default Graph

service/data06endpoint1.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :b foaf:name "Bob" .
Named Graphs

Query

service/service06.rq
# SERVICE with one optional and a nested SERVICE. This query depends in the capabilities of the example1.org endpoint

PREFIX : <http://example.org/>

SELECT ?s ?o1 ?o2
{
SERVICE <http://example1.org/sparql> {
?s ?p ?o1 .
OPTIONAL {
SERVICE SILENT <http://invalid.endpoint.org/sparql> {
?s ?p2 ?o2 }
}
}
}

Results

service/service06.srx


SERVICE test 7

Query evaluation test

Input Dataset:

Default Graph

service/data07.ttl

@prefix : <http://example.org/> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . :a foaf:name "Alan" . :b foaf:name "Bob" .

Named Graphs

Query

service/service07.rq
# invalid URI for a SERVICE with SILENT

PREFIX : <http://example.org/>

SELECT ?s ?o1 ?o2
{
?s ?p ?o1 .
SERVICE SILENT <http://invalid.endpoint.org/sparql> {
?s ?p2 ?o2 }
}

Results

service/service07.srx


sq01 - Subquery within graph pattern

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

subquery/sq01.rdf

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:in="http://www.example.org/instance#" xmlns:ex="http://www.example.org/schema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:Description rdf:about="http://www.example.org/instance#a"> <ex:p rdf:resource="http://www.example.org/instance#b"/> </rdf:Description> <rdf:Description rdf:about="http://www.example.org/instance#c"> <ex:p rdf:resource=""/> </rdf:Description> </rdf:RDF>

Query

subquery/sq01.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x ?p where {
graph ?g {
{select * where {?x ?p ?y}}
}
}

Results

subquery/sq01.srx


sq02 - Subquery within graph pattern, graph variable is bound

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

subquery/sq01.rdf

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:in="http://www.example.org/instance#" xmlns:ex="http://www.example.org/schema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:Description rdf:about="http://www.example.org/instance#a"> <ex:p rdf:resource="http://www.example.org/instance#b"/> </rdf:Description> <rdf:Description rdf:about="http://www.example.org/instance#c"> <ex:p rdf:resource=""/> </rdf:Description> </rdf:RDF>

Query

subquery/sq02.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x ?p where {
graph ?g {
{select * where {?x ?p ?g}}
}
}

Results

subquery/sq02.srx


sq03 - Subquery within graph pattern, graph variable is not bound

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

subquery/sq01.rdf

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:in="http://www.example.org/instance#" xmlns:ex="http://www.example.org/schema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:Description rdf:about="http://www.example.org/instance#a"> <ex:p rdf:resource="http://www.example.org/instance#b"/> </rdf:Description> <rdf:Description rdf:about="http://www.example.org/instance#c"> <ex:p rdf:resource=""/> </rdf:Description> </rdf:RDF>

Query

subquery/sq03.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x where {
graph ?g {
{select ?x where {?x ?p ?g}}
}
}

Results

subquery/sq03.srx


sq04 - Subquery within graph pattern, default graph does not apply

Query evaluation test

Input Dataset:

Default Graph

subquery/sq04.rdf

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:in="http://www.example.org/instance#" xmlns:ex="http://www.example.org/schema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:Description rdf:about="http://www.example.org/instance#no"> <ex:p rdf:resource="http://www.example.org/instance#no"/> </rdf:Description> </rdf:RDF>

Named Graphs

subquery/sq01.rdf

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:in="http://www.example.org/instance#" xmlns:ex="http://www.example.org/schema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:Description rdf:about="http://www.example.org/instance#a"> <ex:p rdf:resource="http://www.example.org/instance#b"/> </rdf:Description> <rdf:Description rdf:about="http://www.example.org/instance#c"> <ex:p rdf:resource=""/> </rdf:Description> </rdf:RDF>

Query

subquery/sq04.rq
select ?x
where {
graph ?g {
{select * where {?x ?p ?y}}
}
}

Results

subquery/sq04.srx


sq05 - Subquery within graph pattern, from named applies

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

subquery/sq05.rdf

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:in="http://www.example.org/instance#" xmlns:ex="http://www.example.org/schema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:Description rdf:about="http://www.example.org/instance#a"> <ex:p rdf:resource="http://www.example.org/instance#b"/> </rdf:Description> <rdf:Description rdf:about="http://www.example.org/instance#c"> <ex:p rdf:resource=""/> </rdf:Description> </rdf:RDF>

Query

subquery/sq05.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x
where {
graph ?g {
{select * where {?x ?p ?y}}
}
}

Results

subquery/sq05.srx


sq06 - Subquery with graph pattern, from named applies

Query evaluation test

Input Dataset:

Default Graph

subquery/sq05.rdf

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:in="http://www.example.org/instance#" xmlns:ex="http://www.example.org/schema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:Description rdf:about="http://www.example.org/instance#a"> <ex:p rdf:resource="http://www.example.org/instance#b"/> </rdf:Description> <rdf:Description rdf:about="http://www.example.org/instance#c"> <ex:p rdf:resource=""/> </rdf:Description> </rdf:RDF>

Named Graphs

Query

subquery/sq06.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x
where {
{select * where {?x ?p ?y}}
}

Results

subquery/sq06.srx


sq07 - Subquery with from

Query evaluation test

Input Dataset:

Default Graph

Named Graphs

subquery/sq05.rdf

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:in="http://www.example.org/instance#" xmlns:ex="http://www.example.org/schema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:Description rdf:about="http://www.example.org/instance#a"> <ex:p rdf:resource="http://www.example.org/instance#b"/> </rdf:Description> <rdf:Description rdf:about="http://www.example.org/instance#c"> <ex:p rdf:resource=""/> </rdf:Description> </rdf:RDF>

Query

subquery/sq07.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x
where {
{select * where {graph ?g {?x ?p ?y}}}
}

Results

subquery/sq07.srx


sq08 - Subquery with aggregate

Query evaluation test

Input Dataset:

Default Graph

subquery/sq08.rdf

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:in="http://www.example.org/instance#" xmlns:ex="http://www.example.org/schema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:Description rdf:about="http://www.example.org/instance#a"> <ex:p rdf:datatype='http://www.w3.org/2001/XMLSchema#integer'>1</ex:p> <ex:p rdf:datatype='http://www.w3.org/2001/XMLSchema#integer'>2</ex:p> </rdf:Description> <rdf:Description rdf:about="http://www.example.org/instance#b"> <ex:p rdf:datatype='http://www.w3.org/2001/XMLSchema#integer'>3</ex:p> </rdf:Description> </rdf:RDF>

Named Graphs

Query

subquery/sq08.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x ?max where {
{select (max(?y) as ?max) where {?x ex:p ?y} }
?x ex:p ?max
}

Results

subquery/sq08.srx


sq09 - Nested Subqueries

Query evaluation test

Input Dataset:

Default Graph

subquery/sq09.rdf

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:in="http://www.example.org/instance#" xmlns:ex="http://www.example.org/schema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:Description rdf:about="http://www.example.org/instance#a"> <ex:p rdf:resource="http://www.example.org/instance#b"/> <ex:q rdf:resource="http://www.example.org/instance#c"/> </rdf:Description> <rdf:Description rdf:about="http://www.example.org/instance#d"> <ex:p rdf:resource="http://www.example.org/instance#e"/> </rdf:Description> </rdf:RDF>

Named Graphs

Query

subquery/sq09.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select * where {

{select * where {
{select ?x where {?x ex:q ?t}}
}}

?x ex:p ?y
}

Results

subquery/sq09.srx


sq10 - Subquery with exists

Query evaluation test

Input Dataset:

Default Graph

subquery/sq10.rdf

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:in="http://www.example.org/instance#" xmlns:ex="http://www.example.org/schema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > <rdf:Description rdf:about="http://www.example.org/instance#a"> <ex:p rdf:resource="http://www.example.org/instance#b"/> <ex:q rdf:resource="http://www.example.org/instance#c"/> </rdf:Description> </rdf:RDF>

Named Graphs

Query

subquery/sq10.rq
prefix ex: <http://www.example.org/schema#>
prefix in: <http://www.example.org/instance#>

select ?x where {
{select * where {?x ex:p ?y}}
filter(exists {?x ex:q ?y})
}

Results

subquery/sq10.srx


sq11 - Subquery limit per resource

Query evaluation test

Input Dataset:

Default Graph

subquery/sq11.ttl

@prefix : <http://www.example.org> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . :order1 a :Order; :hasItem [ :amount 2 ; rdfs:label "Ice Cream" ; :price 4 ], [ :amount 2 ; rdfs:label "Pizza" ; :price 10 ], [ :amount 1 ; rdfs:label "Wine" ; :price 8 ]. :order2 a :Order; :hasItem [ :amount 3 ; rdfs:label "Ice Cream" ; :price 4 ], [ :amount 2 ; rdfs:label "Pasta" ; :price 8 ], [ :amount 3 ; rdfs:label "Soft Drink" ; :price 6 ]. :order3 a :Order; :hasItem [ :amount 1 ; rdfs:label "Sandwich" ; :price 3 ], [ :amount 1 ; rdfs:label "Soft Drink" ; :price 2 ]. :order4 a :Order; :hasItem [ :amount 1 ; rdfs:label "Bagel" ; :price 3.5 ], [ :amount 1 ; rdfs:label "Soft Drink" ; :price 2 ].

Named Graphs

Query

subquery/sq11.rq
# return labels of items for the first 2 orders

PREFIX : <http://www.example.org>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?L
WHERE {
?O :hasItem [ rdfs:label ?L ] .
{
SELECT DISTINCT ?O
WHERE { ?O a :Order }
ORDER BY ?O
LIMIT 2
}
} ORDER BY ?L

Results

subquery/sq11.srx


sq12 - Subquery in CONSTRUCT with built-ins

Query evaluation test

Input Dataset:

Default Graph

subquery/sq12.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . <http://p1> foaf:firstName "John" ; foaf:lastName "Doe".

Named Graphs

Query

subquery/sq12.rq
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

CONSTRUCT{ ?P foaf:name ?FullName }
WHERE {
SELECT ?P ( CONCAT(?F, " ", ?L) AS ?FullName )
WHERE { ?P foaf:firstName ?F ; foaf:lastName ?L. }
}

Results

subquery/sq12_out.ttl


sq13 - Subqueries don't inject bindings

Query evaluation test

Input Dataset:

Default Graph

subquery/sq11.ttl

@prefix : <http://www.example.org> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . :order1 a :Order; :hasItem [ :amount 2 ; rdfs:label "Ice Cream" ; :price 4 ], [ :amount 2 ; rdfs:label "Pizza" ; :price 10 ], [ :amount 1 ; rdfs:label "Wine" ; :price 8 ]. :order2 a :Order; :hasItem [ :amount 3 ; rdfs:label "Ice Cream" ; :price 4 ], [ :amount 2 ; rdfs:label "Pasta" ; :price 8 ], [ :amount 3 ; rdfs:label "Soft Drink" ; :price 6 ]. :order3 a :Order; :hasItem [ :amount 1 ; rdfs:label "Sandwich" ; :price 3 ], [ :amount 1 ; rdfs:label "Soft Drink" ; :price 2 ]. :order4 a :Order; :hasItem [ :amount 1 ; rdfs:label "Bagel" ; :price 3.5 ], [ :amount 1 ; rdfs:label "Soft Drink" ; :price 2 ].

Named Graphs

Query

subquery/sq11.rq
# return labels of items for the first 2 orders

PREFIX : <http://www.example.org>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?L
WHERE {
?O :hasItem [ rdfs:label ?L ] .
{
SELECT DISTINCT ?O
WHERE { ?O a :Order }
ORDER BY ?O
LIMIT 2
}
} ORDER BY ?L

Results

subquery/sq11.srx


sq14 - limit by resource

Query evaluation test

Input Dataset:

Default Graph

subquery/sq14.ttl

@prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix : <http://example.org/ns#> . :a a foaf:Person; foaf:homepage <http://example.org/alan>; foaf:name "Alan" . :b a foaf:Person; foaf:mbox <mailto:ben@example.org>; foaf:homepage <http://example.org/ben>, <http://example.com/ben>; foaf:name "Ben" . :c a foaf:Person; foaf:name "Chris" ; foaf:homepage <http://example.org/chris> . :d a foaf:Person; foaf:homepage <http://example.org/dan>; foaf:name "Dan" . :e a foaf:Person; foaf:mbox <mailto:eve@example.org>; foaf:name "Eve" .

Named Graphs

Query

subquery/sq14.rq
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
CONSTRUCT {
?person a foaf:Person ;
foaf:name ?name ;
foaf:homepage ?homepage ;
foaf:mbox ?mbox .
} WHERE {
{
SELECT ?person ?name WHERE {
?person a foaf:Person ;
foaf:name ?name .
} ORDER BY ?name LIMIT 3
}
?person foaf:homepage ?homepage .
OPTIONAL { ?person foaf:mbox ?mbox . }
}

Results

subquery/sq14-out.ttl


syntax-service-01.rq

Syntax test

Query

syntax-fed/syntax-service-01.rq
SELECT * { SERVICE <g> { ?s ?p ?o } }

syntax-service-02.rq

Syntax test

Query

syntax-fed/syntax-service-02.rq
SELECT * { ?s ?p ?o SERVICE <g> { ?s ?p ?o } ?s ?p ?o }

syntax-service-03.rq

Syntax test

Query

syntax-fed/syntax-service-03.rq
SELECT * { ?s ?p ?o SERVICE SILENT <g> { ?s ?p ?o } ?s ?p ?o }

syntax-select-expr-01.rq

Syntax test

Query

syntax-query/syntax-select-expr-01.rq
SELECT (?x +?y AS ?z) {}

syntax-aggregate-05.rq

Syntax test

Query

syntax-query/syntax-aggregate-05.rq
SELECT (SUM(?x) AS ?y) {}

syntax-aggregate-06.rq

Syntax test

Query

syntax-query/syntax-aggregate-06.rq
SELECT (SUM(DISTINCT ?x) AS ?y) {}

syntax-aggregate-07.rq

Syntax test

Query

syntax-query/syntax-aggregate-07.rq
SELECT (MIN(?x) AS ?y) {}

syntax-aggregate-08.rq

Syntax test

Query

syntax-query/syntax-aggregate-08.rq
SELECT (MIN(DISTINCT ?x) AS ?y) {}

syntax-aggregate-09.rq

Syntax test

Query

syntax-query/syntax-aggregate-09.rq
SELECT (MAX(?x) AS ?y) {}

syntax-aggregate-10.rq

Syntax test

Query

syntax-query/syntax-aggregate-10.rq
SELECT (MAX(DISTINCT ?x) AS ?y) {}

syntax-aggregate-11.rq

Syntax test

Query

syntax-query/syntax-aggregate-11.rq
SELECT (AVG(?x) AS ?y) {}

syntax-aggregate-12.rq

Syntax test

Query

syntax-query/syntax-aggregate-12.rq
SELECT (AVG(DISTINCT ?x) AS ?y) {}

syntax-aggregate-13.rq

Syntax test

Query

syntax-query/syntax-aggregate-13.rq
SELECT (GROUP_CONCAT(?x) AS ?y) {}

syntax-aggregate-14.rq

Syntax test

Query

syntax-query/syntax-aggregate-14.rq
SELECT (GROUP_CONCAT(DISTINCT ?x) AS ?y) {}

syntax-select-expr-02.rq

Syntax test

Query

syntax-query/syntax-select-expr-02.rq
SELECT ?x ?y (?x +?y AS ?z) {}

syntax-aggregate-15.rq

Syntax test

Query

syntax-query/syntax-aggregate-15.rq
SELECT (GROUP_CONCAT(?x; SEPARATOR=';') AS ?y) {}

syntax-subquery-01.rq

Syntax test

Query

syntax-query/syntax-subquery-01.rq
SELECT * { SELECT * { ?s ?p ?o } }

syntax-subquery-02.rq

Syntax test

Query

syntax-query/syntax-subquery-02.rq
SELECT * {
{}
{SELECT * { ?s ?p ?o } }
}

syntax-subquery-03.rq

Syntax test

Query

syntax-query/syntax-subquery-03.rq
SELECT * { {} OPTIONAL {SELECT * { ?s ?p ?o }} }

syntax-not-exists-01.rq

Syntax test

Query

syntax-query/syntax-not-exists-01.rq
SELECT * { ?s ?p ?o FILTER(NOT EXISTS{?s ?p ?o}) }

syntax-not-exists-02.rq

Syntax test

Query

syntax-query/syntax-not-exists-02.rq
SELECT * { ?s ?p ?o FILTER NOT EXISTS{?s ?p ?o} }

syntax-not-exists-03.rq

Syntax test

Query

syntax-query/syntax-not-exists-03.rq
SELECT * { ?s ?p ?o FILTER(true && NOT EXISTS{?s ?p ?o}) }

syntax-exists-01.rq

Syntax test

Query

syntax-query/syntax-exists-01.rq
SELECT * { ?s ?p ?o FILTER(EXISTS{?s ?p ?o}) }

syntax-exists-02.rq

Syntax test

Query

syntax-query/syntax-exists-02.rq
SELECT * { ?s ?p ?o FILTER EXISTS{?s ?p ?o} }

syntax-exists-03.rq

Syntax test

Query

syntax-query/syntax-exists-03.rq
SELECT * { ?s ?p ?o FILTER(! EXISTS{?s ?p ?o}) }

syntax-select-expr-03.rq

Syntax test

Query

syntax-query/syntax-select-expr-03.rq
SELECT (datatype(?x +?y) AS ?z) {}

syntax-minus-01.rq

Syntax test

Query

syntax-query/syntax-minus-01.rq
SELECT * { ?s ?p ?o MINUS { ?s ?q ?v } }

syntax-oneof-01.rq

Syntax test

Query

syntax-query/syntax-oneof-01.rq
SELECT * { ?s ?p ?o FILTER(?o NOT IN(1,2,?s+57)) }

syntax-oneof-02.rq

Syntax test

Query

syntax-query/syntax-oneof-02.rq
SELECT * { ?s ?p ?o FILTER(?o NOT IN()) }

syntax-oneof-03.rq

Syntax test

Query

syntax-query/syntax-oneof-03.rq
SELECT * { ?s ?p ?o FILTER(?o IN(1,<x>)) }

syntax-bindingBINDscopes-01.rq

Syntax test

Query

syntax-query/syntax-bindings-01.rq
SELECT ?Z { ?s ?p ?o . BIND(?o+1 AS ?Z) }

syntax-bindings-02a.rq with VALUES clause

Syntax test

Query

syntax-query/syntax-bindings-02a.rq
SELECT * { } VALUES () { }

syntax-bindings-03a.rq with VALUES clause

Syntax test

Query

syntax-query/syntax-bindings-03a.rq
SELECT * { } VALUES () { () }

syntax-bindings-05a.rq with VALUES clause

Syntax test

Query

syntax-query/syntax-bindings-05a.rq
SELECT * { } VALUES (?x ?y) { (1 2) }

syntax-select-expr-04.rq

Syntax test

Query

syntax-query/syntax-select-expr-04.rq
PREFIX : <http://example/>
SELECT (:function(?x +?y) AS ?F) ?z {}

syntax-bind-02.rq

Syntax test

Query

syntax-query/syntax-bind-02.rq
SELECT ?Z { ?s ?p ?o . BIND(?o+1 AS ?Z) BIND(?Z/2 AS ?Zby2) }

syntax-construct-where-01.rq

Syntax test

Query

syntax-query/syntax-construct-where-01.rq
CONSTRUCT WHERE { ?s ?p 1816 }

syntax-construct-where-02.rq

Syntax test

Query

syntax-query/syntax-construct-where-02.rq
CONSTRUCT
FROM <file>
WHERE { ?s ?p 1816 }

syn-bad-01.rq

Negative syntax test

Query

syntax-query/syn-bad-01.rq
# Not allowed with GROUP BY
SELECT * { ?s ?p ?o } GROUP BY ?s

syn-bad-02.rq

Negative syntax test

Query

syntax-query/syn-bad-02.rq
# required syntax error : out of scope variable in SELECT from group
SELECT ?o { ?s ?p ?o } GROUP BY ?s

syn-bad-03.rq

Negative syntax test

Query

syntax-query/syn-bad-03.rq
SELECT (1 AS ?X) (1 AS ?X) {}

syn-bad-04.rq

Negative syntax test

Query

syntax-query/syn-bad-04.rq
SELECT (?x +?y) {}

syn-bad-05.rq

Negative syntax test

Query

syntax-query/syn-bad-05.rq
SELECT COUNT(*) {}

syn-bad-06.rq

Negative syntax test

Query

syntax-query/syn-bad-06.rq
SELECT (SUM(?x,?y) AS ?S) {}

syn-bad-07.rq

Negative syntax test

Query

syntax-query/syn-bad-07.rq
SELECT * { {} SELECT * { ?s ?p ?o } }

syntax-select-expr-05.rq

Syntax test

Query

syntax-query/syntax-select-expr-05.rq
PREFIX : <http://example/>
SELECT (COUNT(*) AS ?count) {}

syn-bad-08.rq

Negative syntax test

Query

syntax-query/syn-bad-08.rq
SELECT * { ?s ?p ?o UNION ?s ?p ?o }

syntax-bindings-09.rq

Negative syntax test

Query

syntax-query/syntax-bindings-09.rq
SELECT * { } BINDINGS ?x ?y { (1 2) (3) }

PrefixName with hex-encoded colons

Syntax test

Query

syntax-query/qname-escape-02.rq
PREFIX og: <http://ogp.me/ns#>
SELECT * WHERE {
?page og:audio%3Atitle ?title
}

PrefixName with unescaped colons

Syntax test

Query

syntax-query/qname-escape-03.rq
PREFIX og: <http://ogp.me/ns#>
SELECT * WHERE {
?page og:audio:title ?title
}

syntax-BINDscope1.rq

Syntax test

Query

syntax-query/syntax-BINDscope1.rq
PREFIX : <http://www.example.org>
SELECT *
WHERE {
:s :p ?o .
BIND((1+?o) AS ?o1)
:s :q ?o1
}

syntax-BINDscope2.rq

Syntax test

Query

syntax-query/syntax-BINDscope2.rq
PREFIX : <http://www.example.org>
SELECT *
WHERE {
:s :p ?o .
:s :q ?o1
{ BIND((1+?o) AS ?o1) }
}

syntax-BINDscope3.rq

Syntax test

Query

syntax-query/syntax-BINDscope3.rq
PREFIX : <http://www.example.org>
SELECT *
WHERE {
{
:s :p ?o .
:s :q ?o1
}
{ BIND((1+?o) AS ?o1) }
}

syntax-BINDscope4.rq

Syntax test

Query

syntax-query/syntax-BINDscope4.rq
PREFIX : <http://www.example.org>
SELECT *
{
{ BIND (1 AS ?Y) }
UNION
{ :s :p ?Y }
}

syntax-BINDscope5.rq

Syntax test

Query

syntax-query/syntax-BINDscope5.rq
PREFIX : <http://www.example.org>
SELECT *
{
{ :s :p ?Y }
UNION
{ BIND (1 AS ?Y) }
}

syntax-aggregate-01.rq

Syntax test

Query

syntax-query/syntax-aggregate-01.rq
SELECT (COUNT(*) AS ?count) {}

syntax-BINDscope6.rq

Negative syntax test

Query

syntax-query/syntax-BINDscope6.rq
PREFIX : <http://www.example.org>
SELECT *
WHERE {
:s :p ?o .
:s :q ?o1 .
BIND((1+?o) AS ?o1)
}

syntax-BINDscope7.rq

Negative syntax test

Query

syntax-query/syntax-BINDscope7.rq
PREFIX : <http://www.example.org>
SELECT *
WHERE {
{
:s :p ?o .
:s :q ?o1 .
}
BIND((1+?o) AS ?o1)
}

syntax-BINDscope8.rq

Negative syntax test

Query

syntax-query/syntax-BINDscope8.rq
PREFIX : <http://www.example.org>
SELECT *
{
{
{ :s :p ?Y }
UNION
{ :s :p ?Z }
}
BIND (1 AS ?Y)
}

syntax-propertyPaths-01.rq

Syntax test

Query

syntax-query/syntax-propertyPaths-01.rq
PREFIX : <http://www.example.org/>

SELECT ?X WHERE
{
[ :p|:q|:r ?X ]
}


syntax-SELECTscope1.rq

Syntax test

Query

syntax-query/syntax-SELECTscope1.rq
SELECT *
WHERE {
{SELECT (1 AS ?X ) {}
}
UNION
{SELECT (2 AS ?X ) {}
}
}

syntax-SELECTscope2

Negative syntax test

Query

syntax-query/syntax-SELECTscope2.rq
SELECT (1 AS ?X )
{
SELECT (2 AS ?X ) {}
}

syntax-SELECTscope3.rq

Syntax test

Query

syntax-query/syntax-SELECTscope3.rq
SELECT *
WHERE {
{SELECT (1 AS ?X ) {}
}
{SELECT (1 AS ?X ) {}
}
}

syntax-aggregate-02.rq

Syntax test

Query

syntax-query/syntax-aggregate-02.rq
SELECT (COUNT(DISTINCT *) AS ?count) {}

syntax-aggregate-03.rq

Syntax test

Query

syntax-query/syntax-aggregate-03.rq
SELECT (COUNT(?x) AS ?count) {}

syntax-aggregate-04.rq

Syntax test

Query

syntax-query/syntax-aggregate-04.rq
SELECT (COUNT(DISTINCT ?x) AS ?count) {}

syn-pname-01

Syntax test

Query

syntax-query/syn-pname-01.rq
PREFIX : <http://example/>
ASK{}

syn-pname-02

Syntax test

Query

syntax-query/syn-pname-02.rq
PREFIX ex: <http://example/>
ASK{}

syn-pname-03

Syntax test

Query

syntax-query/syn-pname-03.rq
PREFIX : <http://example/>
SELECT *
{
:a :b :c .
}

syn-pname-04

Syntax test

Query

syntax-query/syn-pname-04.rq
PREFIX : <http://example/>
SELECT *
{
:a :b :c:d .
}

syn-pname-05

Syntax test

Query

syntax-query/syn-pname-05.rq
PREFIX : <http://example/>
SELECT *
{
:a :b :c:d\? .
}

syn-pname-06

Syntax test

Query

syntax-query/syn-pname-06.rq
PREFIX : <http://example/>
SELECT *
{
:a :b :c\~z\. .
}

syn-pname-07

Syntax test

Query

syntax-query/syn-pname-07.rq
PREFIX : <http://example/>
SELECT *
{
:a :b%3D :c\~z\. .
}

syn-pname-08

Syntax test

Query

syntax-query/syn-pname-08.rq
PREFIX z: <http://example/>
SELECT *
{
_:a z:b _:1_2_3_
}

syn-pname-09

Syntax test

Query

syntax-query/syn-pname-09.rq
PREFIX z: <http://example/z#>
PREFIX : <http://example/>

SELECT *
{
:a :123 :12.3 .
:: z:: :_12.3_ .
}

syn-bad-pname-01

Negative syntax test

Query

syntax-query/syn-bad-pname-01.rq
# Bad declaration.
PREFIX ex:ex: <http://example/>

ASK{}

syn-bad-pname-02

Negative syntax test

Query

syntax-query/syn-bad-pname-02.rq
# Bad declaration.
PREFIX ex:ex:ex <http://example/>

ASK{}

syn-bad-pname-03

Negative syntax test

Query

syntax-query/syn-bad-pname-03.rq
# Bad declaration
PREFIX :: <http://example/>

ASK{}

syn-bad-pname-04

Negative syntax test

Query

syntax-query/syn-bad-pname-04.rq
# Bad declaration
PREFIX :a: <http://example/>

ASK{}

syn-bad-pname-05

Negative syntax test

Query

syntax-query/syn-bad-pname-05.rq
PREFIX 1: <http://example/>

ASK{}

syn-bad-pname-06

Negative syntax test

Query

syntax-query/syn-bad-pname-06.rq
PREFIX : <http://example/>
SELECT *
{
:a :b :c\:z .
}

syn-bad-pname-07

Negative syntax test

Query

syntax-query/syn-bad-pname-07.rq
PREFIX 1: <http://example/>

ASK{}

syn-bad-pname-08

Negative syntax test

Query

syntax-query/syn-bad-pname-08.rq
PREFIX : <http://example/>
SELECT *
{
:a:b:c .
}

syn-bad-pname-09

Negative syntax test

Query

syntax-query/syn-bad-pname-09.rq
PREFIX x: <http://example/>
SELECT *
{
x:a:b:c .
}

syn-bad-pname-10

Negative syntax test

Query

syntax-query/syn-bad-pname-10.rq
PREFIX : <http://example/>
SELECT *
{
?x:a :b :c .
}

syn-bad-pname-11

Negative syntax test

Query

syntax-query/syn-bad-pname-11.rq
PREFIX : <http://example/>
SELECT *
{
:a ?x:b :c .
}

syn-bad-pname-12

Negative syntax test

Query

syntax-query/syn-bad-pname-12.rq
PREFIX z: <http://example/>
SELECT *
{
z:a z:b ?x:c .
}

syn-bad-pname-13

Negative syntax test

Query

syntax-query/syn-bad-pname-13.rq
PREFIX z: <http://example/>
SELECT *
{
_:az:b <p> <q> .
}

syn-pp-in-collection

Syntax test

Query

syntax-query/syn-pp-in-collection.rq
PREFIX : <http://example.org/>
SELECT * WHERE {
?s ?p ( [:p*/:q 123 ] [ ^:r "hello"] )
}

syntax-update-01.ru

Update syntax test

Query

syntax-update-1/syntax-update-01.ru
BASE <http://example/base#>
PREFIX : <http://example/>
LOAD <http://example.org/faraway>

syntax-update-10.ru

Update syntax test

Query

syntax-update-1/syntax-update-10.ru
DROP SILENT DEFAULT

syntax-update-11.ru

Update syntax test

Query

syntax-update-1/syntax-update-11.ru
DROP SILENT ALL

syntax-update-12.ru

Update syntax test

Query

syntax-update-1/syntax-update-12.ru
DROP SILENT GRAPH <graph>

syntax-update-13.ru

Update syntax test

Query

syntax-update-1/syntax-update-13.ru
CREATE GRAPH <graph>

syntax-update-14.ru

Update syntax test

Query

syntax-update-1/syntax-update-14.ru
CREATE SILENT GRAPH <graph>

syntax-update-15.ru

Update syntax test

Query

syntax-update-1/syntax-update-15.ru
CLEAR NAMED

syntax-update-16.ru

Update syntax test

Query

syntax-update-1/syntax-update-16.ru
CLEAR DEFAULT

syntax-update-17.ru

Update syntax test

Query

syntax-update-1/syntax-update-17.ru
CLEAR ALL

syntax-update-18.ru

Update syntax test

Query

syntax-update-1/syntax-update-18.ru
CLEAR GRAPH <graph>

syntax-update-19.ru

Update syntax test

Query

syntax-update-1/syntax-update-19.ru
CLEAR SILENT NAMED

syntax-update-02.ru

Update syntax test

Query

syntax-update-1/syntax-update-02.ru
# Comment
BASE <http://example/base#>
# Comment
PREFIX : <http://example/>
# Comment
LOAD <http://example.org/faraway>
# Comment

syntax-update-20.ru

Update syntax test

Query

syntax-update-1/syntax-update-20.ru
CLEAR SILENT DEFAULT

syntax-update-21.ru

Update syntax test

Query

syntax-update-1/syntax-update-21.ru
CLEAR SILENT ALL

syntax-update-22.ru

Update syntax test

Query

syntax-update-1/syntax-update-22.ru
CLEAR SILENT GRAPH <graph>

syntax-update-23.ru

Update syntax test

Query

syntax-update-1/syntax-update-23.ru
INSERT DATA { <s> <p> 'o1', 'o2', 'o3' }

syntax-update-24.ru

Update syntax test

Query

syntax-update-1/syntax-update-24.ru
INSERT DATA { GRAPH <G> { <s> <p> 'o1', 'o2', 'o3' } }

syntax-update-25.ru

Update syntax test

Query

syntax-update-1/syntax-update-25.ru
INSERT DATA {
<s1> <p1> <o1>
GRAPH <G> { <s> <p1> 'o1'; <p2> <o2> }
GRAPH <G1> { <s> <p1> 'o1'; <p2> <o2> }
<s1> <p1> <o1>
}

syntax-update-26.ru

Update syntax test

Query

syntax-update-1/syntax-update-26.ru
INSERT
# Comment
DATA { GRAPH <G> { <s> <p> 'o1', 'o2', 'o3' } }

syntax-update-27.ru

Update syntax test

Query

syntax-update-1/syntax-update-27.ru
INSERT
DATA { }

syntax-update-28.ru

Update syntax test

Query

syntax-update-1/syntax-update-28.ru
INSERT
DATA { GRAPH <G>{} }

syntax-update-29.ru

Update syntax test

Query

syntax-update-1/syntax-update-29.ru
DELETE DATA { <s> <p> 'o1', 'o2', 'o3' }

syntax-update-03.ru

Update syntax test

Query

syntax-update-1/syntax-update-03.ru
LOAD <http://example.org/faraway> ;

syntax-update-30.ru

Update syntax test

Query

syntax-update-1/syntax-update-30.ru
DELETE DATA { GRAPH <G> { <s> <p> 'o1', 'o2', 'o3' } }

syntax-update-31.ru

Update syntax test

Query

syntax-update-1/syntax-update-31.ru
DELETE DATA {
<s1> <p1> <o1>
GRAPH <G> { <s> <p1> 'o1'; <p2> <o2> }
GRAPH <G1> { <s> <p1> 'o1'; <p2> <o2> }
<s1> <p1> <o1>
}

syntax-update-32.ru

Update syntax test

Query

syntax-update-1/syntax-update-32.ru
BASE <base:>
PREFIX : <http://example/>

WITH :g
DELETE {
<s> ?p ?o .
}
INSERT {
?s ?p <#o> .
}
USING <base:g1>
USING <base:g2>
USING NAMED :gn1
USING NAMED :gn2
WHERE
{ ?s ?p ?o }

syntax-update-33.ru

Update syntax test

Query

syntax-update-1/syntax-update-33.ru
PREFIX : <http://example/>
WITH :g
DELETE {
<base:s> ?p ?o .
}
WHERE
{ ?s ?p ?o }

syntax-update-34.ru

Update syntax test

Query

syntax-update-1/syntax-update-34.ru
PREFIX : <http://example/>
WITH :g
INSERT {
<base:s> ?p ?o .
}
WHERE
{ ?s ?p ?o }

syntax-update-35.ru

Update syntax test

Query

syntax-update-1/syntax-update-35.ru
DELETE WHERE { ?s ?p ?o }

syntax-update-36.ru

Update syntax test

Query

syntax-update-1/syntax-update-36.ru
# Comment
DELETE
# Comment
WHERE
# Comment
{ GRAPH <G> { <s> <p> 123 ; <q> 4567.0 . } }

syntax-update-37.ru

Update syntax test

Query

syntax-update-1/syntax-update-37.ru
CREATE GRAPH <g> ;
LOAD <remote> INTO GRAPH <g> ;

syntax-update-38.ru

Update syntax test

Query

syntax-update-1/syntax-update-38.ru
# Empty

syntax-update-39.ru

Update syntax test

Query

syntax-update-1/syntax-update-39.ru
BASE <http://example/>
# Otherwise empty

syntax-update-04.ru

Update syntax test

Query

syntax-update-1/syntax-update-04.ru
LOAD <http://example.org/faraway> INTO GRAPH <localCopy>

syntax-update-40.ru

Update syntax test

Query

syntax-update-1/syntax-update-40.ru
PREFIX : <http://example/>
# Otherwise empty

syntax-update-bad-01.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-bad-01.ru
# No URL
LOAD ;

syntax-update-bad-02.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-bad-02.ru
# Typo in keyword.
CREATE DEAFULT

syntax-update-bad-03.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-bad-03.ru
# Variable in data.
DELETE DATA { ?s <p> <o> }

syntax-update-bad-04.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-bad-04.ru
# Variable in data.
INSERT DATA { GRAPH ?g {<s> <p> <o> } }

syntax-update-bad-05.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-bad-05.ru
# Nested GRAPH
DELETE DATA {
GRAPH <G> {
<s> <p> <o> .
GRAPH <G1> { <s> <p1> 'o1' }
}
}

syntax-update-bad-06.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-bad-06.ru
# Missing template
INSERT WHERE { ?s ?p ?o }

syntax-update-bad-07.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-bad-07.ru
# No separator
CREATE GRAPH <g>
LOAD <remote> INTO GRAPH <g>

syntax-update-bad-08.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-bad-08.ru
# Too many separators
CREATE GRAPH <g>
;;
LOAD <remote> INTO GRAPH <g>

syntax-update-bad-09.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-bad-09.ru
CREATE GRAPH <g>
;
LOAD <remote> INTO GRAPH <g>
;;

syntax-update-05.ru

Update syntax test

Query

syntax-update-1/syntax-update-05.ru
DROP NAMED

syntax-update-bad-10.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-bad-10.ru
# BNode in DELETE WHERE
DELETE WHERE { _:a <p> <o> }

syntax-update-bad-11.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-bad-11.ru
# BNode in DELETE template
DELETE { <s> <p> [] } WHERE { ?x <p> <o> }

syntax-update-bad-12.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-bad-12.ru
# BNode in DELETE DATA
DELETE DATA { _:a <p> <o> }

syntax-update-53.ru

Update syntax test

Query

syntax-update-1/syntax-update-53.ru
PREFIX : <http://www.example.org/>

INSERT DATA {
GRAPH<g1> { _:b1 :p :o }
GRAPH<g2> { _:b1 :p :o }
}

syntax-update-54.ru

Negative update syntax test

Query

syntax-update-1/syntax-update-54.ru
PREFIX : <http://www.example.org/>

INSERT DATA { _:b1 :p :o }
;
INSERT DATA { _:b1 :p :o }

syntax-update-06.ru

Update syntax test

Query

syntax-update-1/syntax-update-06.ru
DROP DEFAULT

syntax-update-07.ru

Update syntax test

Query

syntax-update-1/syntax-update-07.ru
DROP ALL

syntax-update-08.ru

Update syntax test

Query

syntax-update-1/syntax-update-08.ru
DROP GRAPH <graph>

syntax-update-09.ru

Update syntax test

Query

syntax-update-1/syntax-update-09.ru
DROP SILENT NAMED

syntax-update-other-01

Update syntax test

Query

syntax-update-2/large-request-01.ru
BASE <http://foo.com/>
INSERT DATA {
GRAPH <http://example.com/data> {
<a> <b> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29 .
<c> <d> "000"; <d> "001"; <d> "002"; <d> "003"; <d> "004"; <d> "005"; <d> "006"; <d> "007"; <d> "008"; <d> "009";
<d> "010"; <d> "011"; <d> "012"; <d> "013"; <d> "014"; <d> "015"; <d> "016"; <d> "017"; <d> "018"; <d> "019";
<d> "020"; <d> "021"; <d> "022"; <d> "023"; <d> "024"; <d> "025"; <d> "026"; <d> "027"; <d> "028"; <d> "029";
<d> "030"; <d> "031"; <d> "032"; <d> "033"; <d> "034"; <d> "035"; <d> "036"; <d> "037"; <d> "038"; <d> "039";
<d> "040"; <d> "041"; <d> "042"; <d> "043"; <d> "044"; <d> "045"; <d> "046"; <d> "047"; <d> "048"; <d> "049";
<d> "050"; <d> "051"; <d> "052"; <d> "053"; <d> "054"; <d> "055"; <d> "056"; <d> "057"; <d> "058"; <d> "059";
<d> "060"; <d> "061"; <d> "062"; <d> "063"; <d> "064"; <d> "065"; <d> "066"; <d> "067"; <d> "068"; <d> "069";
<d> "070"; <d> "071"; <d> "072"; <d> "073"; <d> "074"; <d> "075"; <d> "076"; <d> "077"; <d> "078"; <d> "079";
<d> "080"; <d> "081"; <d> "082"; <d> "083"; <d> "084"; <d> "085"; <d> "086"; <d> "087"; <d> "088"; <d> "089";
<d> "090"; <d> "091"; <d> "092"; <d> "093"; <d> "094"; <d> "095"; <d> "096"; <d> "097"; <d> "098"; <d> "099";
<d> "100"; <d> "101"; <d> "102"; <d> "103"; <d> "104"; <d> "105"; <d> "106"; <d> "107"; <d> "108"; <d> "109";
<d> "110"; <d> "111"; <d> "112"; <d> "113"; <d> "114"; <d> "115"; <d> "116"; <d> "117"; <d> "118"; <d> "119";
<d> "120"; <d> "121"; <d> "122"; <d> "123"; <d> "124"; <d> "125"; <d> "126"; <d> "127"; <d> "128"; <d> "129";
<d> "130"; <d> "131"; <d> "132"; <d> "133"; <d> "134"; <d> "135"; <d> "136"; <d> "137"; <d> "138"; <d> "139";
<d> "140"; <d> "141"; <d> "142"; <d> "143"; <d> "144"; <d> "145"; <d> "146"; <d> "147"; <d> "148"; <d> "149";
<d> "150"; <d> "151"; <d> "152"; <d> "153"; <d> "154"; <d> "155"; <d> "156"; <d> "157"; <d> "158"; <d> "159";
<d> "160"; <d> "161"; <d> "162"; <d> "163"; <d> "164"; <d> "165"; <d> "166"; <d> "167"; <d> "168"; <d> "169";
<d> "170"; <d> "171"; <d> "172"; <d> "173"; <d> "174"; <d> "175"; <d> "176"; <d> "177"; <d> "178"; <d> "179";
<d> "180"; <d> "181"; <d> "182"; <d> "183"; <d> "184"; <d> "185"; <d> "186"; <d> "187"; <d> "188"; <d> "189";
<d> "190"; <d> "191"; <d> "192"; <d> "193"; <d> "194"; <d> "195"; <d> "196"; <d> "197"; <d> "198"; <d> "199";
<d> "200"; <d> "201"; <d> "202"; <d> "203"; <d> "204"; <d> "205"; <d> "206"; <d> "207"; <d> "208"; <d> "209";
<d> "210"; <d> "211"; <d> "212"; <d> "213"; <d> "214"; <d> "215"; <d> "216"; <d> "217"; <d> "218"; <d> "219";
<d> "220"; <d> "221"; <d> "222"; <d> "223"; <d> "224"; <d> "225"; <d> "226"; <d> "227"; <d> "228"; <d> "229";
<d> "230"; <d> "231"; <d> "232"; <d> "233"; <d> "234"; <d> "235"; <d> "236"; <d> "237"; <d> "238"; <d> "239";
<d> "240"; <d> "241"; <d> "242"; <d> "243"; <d> "244"; <d> "245"; <d> "246"; <d> "247"; <d> "248"; <d> "249";
<d> "250"; <d> "251"; <d> "252"; <d> "253"; <d> "254"; <d> "255"; <d> "256"; <d> "257"; <d> "258"; <d> "259";
<d> "260"; <d> "261"; <d> "262"; <d> "263"; <d> "264"; <d> "265"; <d> "266"; <d> "267"; <d> "268"; <d> "269";
<d> "270"; <d> "271"; <d> "272"; <d> "273"; <d> "274"; <d> "275"; <d> "276"; <d> "277"; <d> "278"; <d> "279";
<d> "280"; <d> "281"; <d> "282"; <d> "283"; <d> "284"; <d> "285"; <d> "286"; <d> "287"; <d> "288"; <d> "289";
<d> "290"; <d> "291"; <d> "292"; <d> "293"; <d> "294"; <d> "295"; <d> "296"; <d> "297"; <d> "298"; <d> "299".
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> . <e> <f> <g> .
<e> <f> <g000> . <e> <f> <g001> . <e> <f> <g002> . <e> <f> <g003> . <e> <f> <g004> .
<e> <f> <g005> . <e> <f> <g006> . <e> <f> <g007> . <e> <f> <g008> . <e> <f> <g009> .
<e> <f> <g010> . <e> <f> <g011> . <e> <f> <g012> . <e> <f> <g013> . <e> <f> <g014> .
<e> <f> <g015> . <e> <f> <g016> . <e> <f> <g017> . <e> <f> <g018> . <e> <f> <g019> .
<e> <f> <g020> . <e> <f> <g021> . <e> <f> <g022> . <e> <f> <g023> . <e> <f> <g024> .
<e> <f> <g025> . <e> <f> <g026> . <e> <f> <g027> . <e> <f> <g028> . <e> <f> <g029> .
<e> <f> <g030> . <e> <f> <g031> . <e> <f> <g032> . <e> <f> <g033> . <e> <f> <g034> .
<e> <f> <g035> . <e> <f> <g036> . <e> <f> <g037> . <e> <f> <g038> . <e> <f> <g039> .
<e> <f> <g040> . <e> <f> <g041> . <e> <f> <g042> . <e> <f> <g043> . <e> <f> <g044> .
<e> <f> <g045> . <e> <f> <g046> . <e> <f> <g047> . <e> <f> <g048> . <e> <f> <g049> .
<e> <f> <g050> . <e> <f> <g051> . <e> <f> <g052> . <e> <f> <g053> . <e> <f> <g054> .
<e> <f> <g055> . <e> <f> <g056> . <e> <f> <g057> . <e> <f> <g058> . <e> <f> <g059> .
<e> <f> <g060> . <e> <f> <g061> . <e> <f> <g062> . <e> <f> <g063> . <e> <f> <g064> .
<e> <f> <g065> . <e> <f> <g066> . <e> <f> <g067> . <e> <f> <g068> . <e> <f> <g069> .
<e> <f> <g070> . <e> <f> <g071> . <e> <f> <g072> . <e> <f> <g073> . <e> <f> <g074> .
<e> <f> <g075> . <e> <f> <g076> . <e> <f> <g077> . <e> <f> <g078> . <e> <f> <g079> .
<e> <f> <g080> . <e> <f> <g081> . <e> <f> <g082> . <e> <f> <g083> . <e> <f> <g084> .
<e> <f> <g085> . <e> <f> <g086> . <e> <f> <g087> . <e> <f> <g088> . <e> <f> <g089> .
<e> <f> <g090> . <e> <f> <g091> . <e> <f> <g092> . <e> <f> <g093> . <e> <f> <g094> .
<e> <f> <g095> . <e> <f> <g096> . <e> <f> <g097> . <e> <f> <g098> . <e> <f> <g099> .
<e> <f> <g100> . <e> <f> <g101> . <e> <f> <g102> . <e> <f> <g103> . <e> <f> <g104> .
<e> <f> <g105> . <e> <f> <g106> . <e> <f> <g107> . <e> <f> <g108> . <e> <f> <g109> .
<e> <f> <g110> . <e> <f> <g111> . <e> <f> <g112> . <e> <f> <g113> . <e> <f> <g114> .
<e> <f> <g115> . <e> <f> <g116> . <e> <f> <g117> . <e> <f> <g118> . <e> <f> <g119> .
<e> <f> <g120> . <e> <f> <g121> . <e> <f> <g122> . <e> <f> <g123> . <e> <f> <g124> .
<e> <f> <g125> . <e> <f> <g126> . <e> <f> <g127> . <e> <f> <g128> . <e> <f> <g129> .
<e> <f> <g130> . <e> <f> <g131> . <e> <f> <g132> . <e> <f> <g133> . <e> <f> <g134> .
<e> <f> <g135> . <e> <f> <g136> . <e> <f> <g137> . <e> <f> <g138> . <e> <f> <g139> .
<e> <f> <g140> . <e> <f> <g141> . <e> <f> <g142> . <e> <f> <g143> . <e> <f> <g144> .
<e> <f> <g145> . <e> <f> <g146> . <e> <f> <g147> . <e> <f> <g148> . <e> <f> <g149> .
<e> <f> <g150> . <e> <f> <g151> . <e> <f> <g152> . <e> <f> <g153> . <e> <f> <g154> .
<e> <f> <g155> . <e> <f> <g156> . <e> <f> <g157> . <e> <f> <g158> . <e> <f> <g159> .
<e> <f> <g160> . <e> <f> <g161> . <e> <f> <g162> . <e> <f> <g163> . <e> <f> <g164> .
<e> <f> <g165> . <e> <f> <g166> . <e> <f> <g167> . <e> <f> <g168> . <e> <f> <g169> .
<e> <f> <g170> . <e> <f> <g171> . <e> <f> <g172> . <e> <f> <g173> . <e> <f> <g174> .
<e> <f> <g175> . <e> <f> <g176> . <e> <f> <g177> . <e> <f> <g178> . <e> <f> <g179> .
<e> <f> <g180> . <e> <f> <g181> . <e> <f> <g182> . <e> <f> <g183> . <e> <f> <g184> .
<e> <f> <g185> . <e> <f> <g186> . <e> <f> <g187> . <e> <f> <g188> . <e> <f> <g189> .
<e> <f> <g190> . <e> <f> <g191> . <e> <f> <g192> . <e> <f> <g193> . <e> <f> <g194> .
<e> <f> <g195> . <e> <f> <g196> . <e> <f> <g197> . <e> <f> <g198> . <e> <f> <g199> .
<e> <f> <g200> . <e> <f> <g201> . <e> <f> <g202> . <e> <f> <g203> . <e> <f> <g204> .
<e> <f> <g205> . <e> <f> <g206> . <e> <f> <g207> . <e> <f> <g208> . <e> <f> <g209> .
<e> <f> <g210> . <e> <f> <g211> . <e> <f> <g212> . <e> <f> <g213> . <e> <f> <g214> .
<e> <f> <g215> . <e> <f> <g216> . <e> <f> <g217> . <e> <f> <g218> . <e> <f> <g219> .
<e> <f> <g220> . <e> <f> <g221> . <e> <f> <g222> . <e> <f> <g223> . <e> <f> <g224> .
<e> <f> <g225> . <e> <f> <g226> . <e> <f> <g227> . <e> <f> <g228> . <e> <f> <g229> .
<e> <f> <g230> . <e> <f> <g231> . <e> <f> <g232> . <e> <f> <g233> . <e> <f> <g234> .
<e> <f> <g235> . <e> <f> <g236> . <e> <f> <g237> . <e> <f> <g238> . <e> <f> <g239> .
<e> <f> <g240> . <e> <f> <g241> . <e> <f> <g242> . <e> <f> <g243> . <e> <f> <g244> .
<e> <f> <g245> . <e> <f> <g246> . <e> <f> <g247> . <e> <f> <g248> . <e> <f> <g249> .
<e> <f> <g250> . <e> <f> <g251> . <e> <f> <g252> . <e> <f> <g253> . <e> <f> <g254> .
<e> <f> <g255> . <e> <f> <g256> . <e> <f> <g257> . <e> <f> <g258> . <e> <f> <g259> .
<e> <f> <g260> . <e> <f> <g261> . <e> <f> <g262> . <e> <f> <g263> . <e> <f> <g264> .
<e> <f> <g265> . <e> <f> <g266> . <e> <f> <g267> . <e> <f> <g268> . <e> <f> <g269> .
<e> <f> <g270> . <e> <f> <g271> . <e> <f> <g272> . <e> <f> <g273> . <e> <f> <g274> .
<e> <f> <g275> . <e> <f> <g276> . <e> <f> <g277> . <e> <f> <g278> . <e> <f> <g279> .
<e> <f> <g280> . <e> <f> <g281> . <e> <f> <g282> . <e> <f> <g283> . <e> <f> <g284> .
<e> <f> <g285> . <e> <f> <g286> . <e> <f> <g287> . <e> <f> <g288> . <e> <f> <g289> .
<e> <f> <g290> . <e> <f> <g291> . <e> <f> <g292> . <e> <f> <g293> . <e> <f> <g294> .
<e> <f> <g295> . <e> <f> <g296> . <e> <f> <g297> . <e> <f> <g298> . <e> <f> <g299> .
<e> <f> <g300> . <e> <f> <g301> . <e> <f> <g302> . <e> <f> <g303> . <e> <f> <g304> .
<e> <f> <g305> . <e> <f> <g306> . <e> <f> <g307> . <e> <f> <g308> . <e> <f> <g309> .
<e> <f> <g310> . <e> <f> <g311> . <e> <f> <g312> . <e> <f> <g313> . <e> <f> <g314> .
<e> <f> <g315> . <e> <f> <g316> . <e> <f> <g317> . <e> <f> <g318> . <e> <f> <g319> .
<e> <f> <g320> . <e> <f> <g321> . <e> <f> <g322> . <e> <f> <g323> . <e> <f> <g324> .
<e> <f> <g325> . <e> <f> <g326> . <e> <f> <g327> . <e> <f> <g328> . <e> <f> <g329> .
<e> <f> <g330> . <e> <f> <g331> . <e> <f> <g332> . <e> <f> <g333> . <e> <f> <g334> .
<e> <f> <g335> . <e> <f> <g336> . <e> <f> <g337> . <e> <f> <g338> . <e> <f> <g339> .
<e> <f> <g340> . <e> <f> <g341> . <e> <f> <g342> . <e> <f> <g343> . <e> <f> <g344> .
<e> <f> <g345> . <e> <f> <g346> . <e> <f> <g347> . <e> <f> <g348> . <e> <f> <g349> .
<e> <f> <g350> . <e> <f> <g351> . <e> <f> <g352> . <e> <f> <g353> . <e> <f> <g354> .
<e> <f> <g355> . <e> <f> <g356> . <e> <f> <g357> . <e> <f> <g358> . <e> <f> <g359> .
<e> <f> <g360> . <e> <f> <g361> . <e> <f> <g362> . <e> <f> <g363> . <e> <f> <g364> .
<e> <f> <g365> . <e> <f> <g366> . <e> <f> <g367> . <e> <f> <g368> . <e> <f> <g369> .
<e> <f> <g370> . <e> <f> <g371> . <e> <f> <g372> . <e> <f> <g373> . <e> <f> <g374> .
<e> <f> <g375> . <e> <f> <g376> . <e> <f> <g377> . <e> <f> <g378> . <e> <f> <g379> .
<e> <f> <g380> . <e> <f> <g381> . <e> <f> <g382> . <e> <f> <g383> . <e> <f> <g384> .
<e> <f> <g385> . <e> <f> <g386> . <e> <f> <g387> . <e> <f> <g388> . <e> <f> <g389> .
<e> <f> <g390> . <e> <f> <g391> . <e> <f> <g392> . <e> <f> <g393> . <e> <f> <g394> .
<e> <f> <g395> . <e> <f> <g396> . <e> <f> <g397> . <e> <f> <g398> . <e> <f> <g399> .
}
}

ADD SILENT

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g2

@prefix : <http://example.org/ns#> . :s :p :o .

Update

update-silent/add-silent.ru
ADD SILENT GRAPH <http://www.example.com/g1> TO GRAPH <http://www.example.com/g2>

Result Dataset:

Default Graph

Named Graphs

http://example.org/g2

@prefix : <http://example.org/ns#> . :s :p :o .

ADD SILENT TO DEFAULT

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

Update

update-silent/add-to-default-silent.ru
ADD SILENT GRAPH <http://www.example.com/g1> TO DEFAULT

Result Dataset:

Default Graph

Named Graphs


CLEAR SILENT DEFAULT

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

Update

update-silent/clear-default-silent.ru
CLEAR DEFAULT

Result Dataset:

Default Graph

Named Graphs


CLEAR SILENT GRAPH iri

Update evaluation test

Input Dataset:

Default Graph

update-silent/spo.ttl

@prefix : <http://example.org/ns#> . :s :p :o .

Named Graphs

Update

update-silent/clear-silent.ru
CLEAR SILENT GRAPH <http://www.example.org>

Result Dataset:

Default Graph

update-silent/spo.ttl

@prefix : <http://example.org/ns#> . :s :p :o .

Named Graphs


COPY SILENT

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g2

@prefix : <http://example.org/ns#> . :s :p :o .

Update

update-silent/copy-silent.ru
COPY SILENT GRAPH <http://www.example.com/g1> TO GRAPH <http://www.example.com/g2>

Result Dataset:

Default Graph

Named Graphs

http://example.org/g2

@prefix : <http://example.org/ns#> . :s :p :o .

COPY SILENT TO DEFAULT

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

Update

update-silent/copy-to-default-silent.ru
COPY SILENT GRAPH <http://www.example.com/g1> TO DEFAULT

Result Dataset:

Default Graph

Named Graphs


CREATE SILENT iri

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/ns#> . :s :p :o .

Update

update-silent/create-silent.ru
CREATE SILENT GRAPH <http://example.org/g1>

Result Dataset:

Default Graph

Named Graphs

http://example.org/g1

@prefix : <http://example.org/ns#> . :s :p :o .

DROP SILENT DEFAULT

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

Update

update-silent/drop-default-silent.ru
DROP DEFAULT

Result Dataset:

Default Graph

Named Graphs


DROP SILENT GRAPH iri

Update evaluation test

Input Dataset:

Default Graph

update-silent/spo.ttl

@prefix : <http://example.org/ns#> . :s :p :o .

Named Graphs

Update

update-silent/drop-silent.ru
DROP SILENT GRAPH <http://www.example.org>

Result Dataset:

Default Graph

update-silent/spo.ttl

@prefix : <http://example.org/ns#> . :s :p :o .

Named Graphs


LOAD SILENT INTO

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

Update

update-silent/load-silent-into.ru
LOAD SILENT <somescheme://www.example.com/THIS-GRAPH-DOES-NOT-EXIST/> INTO GRAPH <http://www.example.org/>

Result Dataset:

Default Graph

Named Graphs


LOAD SILENT

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

Update

update-silent/load-silent.ru
LOAD SILENT <somescheme://www.example.com/THIS-GRAPH-DOES-NOT-EXIST/>

Result Dataset:

Default Graph

Named Graphs


MOVE SILENT

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

http://example.org/g2

@prefix : <http://example.org/ns#> . :s :p :o .

Update

update-silent/move-silent.ru
MOVE SILENT GRAPH <http://www.example.com/g1> TO GRAPH <http://www.example.com/g2>

Result Dataset:

Default Graph

Named Graphs

http://example.org/g2

@prefix : <http://example.org/ns#> . :s :p :o .

MOVE SILENT TO DEFAULT

Update evaluation test

Input Dataset:

Default Graph

Named Graphs

Update

update-silent/move-to-default-silent.ru
MOVE SILENT GRAPH <http://www.example.com/g1> TO DEFAULT

Result Dataset:

Default Graph

Named Graphs


Generated for the SPARQL 1.1 test suite by SPARQL-1.1-Implementation-Report. Direct new implementation reports and feedback to public-rdf-dawg-comments@w3.org.

Mon Oct 22 16:09:58 2012 GMT

$Id: summary.html,v 1.7 2012/10/22 16:12:31 gwilliam Exp $