Skip to content

Commit d130b60

Browse files
Tptafs
authored andcommitted
Ensures SPARQL 1.2 follows RDF 1.1
- the datatype of literals with language tags is rdf:langString - the datatype of plain literals with language tags is xsd:string - plain literals without language tags and literals with xsd:string datatype are the same
1 parent c3f2e12 commit d130b60

File tree

8 files changed

+70
-0
lines changed

8 files changed

+70
-0
lines changed

sparql/sparql12/manifest.ttl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ trs:manifest rdf:type mf:Manifest ;
3636
<syntax-triple-terms-negative/manifest.ttl>
3737
<syntax-triple-terms-positive/manifest.ttl>
3838
<lang-basedir/manifest.ttl>
39+
<rdf11/manifest.ttl>
3940
) .
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT (DATATYPE("foo"@en) AS ?dt) WHERE {}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"head": {
3+
"vars": [ "dt" ]
4+
},
5+
"results": {
6+
"bindings": [
7+
{
8+
"dt": { "type": "uri", "value": "http://www.w3.org/1999/02/22-rdf-syntax-ns#langString" }
9+
}
10+
]
11+
}
12+
}

sparql/sparql12/rdf11/manifest.ttl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2+
@prefix : <https://w3c.github.io/rdf-tests/sparql/sparql12/grouping#> .
3+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4+
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
5+
@prefix qt: <http://www.w3.org/2001/sw/DataAccess/tests/test-query#> .
6+
@prefix dawgt: <http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#> .
7+
8+
:manifest rdf:type mf:Manifest ;
9+
rdfs:label "RDF 1.1 literals handling" ;
10+
mf:entries
11+
(
12+
:langstring-datatype
13+
:plain-string-datatype
14+
:plain-string-same
15+
) .
16+
17+
18+
:langstring-datatype rdf:type mf:QueryEvaluationTest ;
19+
mf:name "DATATYPE on rdf:langString";
20+
rdfs:comment "plain literals with a language tag have a rdf:langString datatype" ;
21+
dawgt:approval dawgt:Proposed ;
22+
mf:action [ qt:query <langstring-datatype.rq> ] ;
23+
mf:result <langstring-datatype.srj> .
24+
25+
:plain-string-datatype rdf:type mf:QueryEvaluationTest ;
26+
mf:name "DATATYPE on plain string literal";
27+
rdfs:comment "plain literals without a language tag have the xsd:string datatype" ;
28+
dawgt:approval dawgt:Proposed ;
29+
mf:action [ qt:query <plain-string-datatype.rq> ] ;
30+
mf:result <plain-string-datatype.srj> .
31+
32+
:plain-string-same rdf:type mf:QueryEvaluationTest ;
33+
mf:name "xsd:string and plain literals are the same";
34+
rdfs:comment "xsd:string literals are the same as literals without datatypes" ;
35+
dawgt:approval dawgt:Proposed ;
36+
mf:action [ qt:query <plain-string-same.rq> ] ;
37+
mf:result <plain-string-same.srj> .
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT (DATATYPE("foo") AS ?dt) WHERE {}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"head": {
3+
"vars": [ "dt" ]
4+
},
5+
"results": {
6+
"bindings": [
7+
{
8+
"dt": { "type": "uri", "value": "http://www.w3.org/2001/XMLSchema#string" }
9+
}
10+
]
11+
}
12+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
2+
ASK { FILTER(sameTerm("foo", "foo"^^xsd:string)) }
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"head": {},
3+
"boolean": true
4+
}

0 commit comments

Comments
 (0)