Skip to content

Commit 1322bc5

Browse files
committed
Tests for language and base direction
1 parent 7d298cb commit 1322bc5

File tree

14 files changed

+236
-0
lines changed

14 files changed

+236
-0
lines changed

sparql/sparql12/lang-basedir/data-empty.ttl

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
PREFIX : <http://example/>
2+
3+
:x1 :p "abc"@en .
4+
:x2 :p "abc"@en--ltr .
5+
:x3 :p "تصميم المواقع"@ar--rtl .
6+
:x4 :p 1 .
7+
:x5 :p <http://example/> .
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
PREFIX : <http://example/>
2+
3+
SELECT ?x ?hasLang {
4+
?x :p ?object .
5+
BIND( hasLANG(?object) AS ?hasLang )
6+
} ORDER BY ?x
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{ "head": {
2+
"vars": [ "x" , "hasLang" ]
3+
} ,
4+
"results": {
5+
"bindings": [
6+
{
7+
"x": { "type": "uri" , "value": "http://example/x1" } ,
8+
"hasLang": { "type": "literal" , "datatype": "http://www.w3.org/2001/XMLSchema#boolean" , "value": "true" }
9+
} ,
10+
{
11+
"x": { "type": "uri" , "value": "http://example/x2" } ,
12+
"hasLang": { "type": "literal" , "datatype": "http://www.w3.org/2001/XMLSchema#boolean" , "value": "true" }
13+
} ,
14+
{
15+
"x": { "type": "uri" , "value": "http://example/x3" } ,
16+
"hasLang": { "type": "literal" , "datatype": "http://www.w3.org/2001/XMLSchema#boolean" , "value": "true" }
17+
} ,
18+
{
19+
"x": { "type": "uri" , "value": "http://example/x4" } ,
20+
"hasLang": { "type": "literal" , "datatype": "http://www.w3.org/2001/XMLSchema#boolean" , "value": "false" }
21+
} ,
22+
{
23+
"x": { "type": "uri" , "value": "http://example/x5" } ,
24+
"hasLang": { "type": "literal" , "datatype": "http://www.w3.org/2001/XMLSchema#boolean" , "value": "false" }
25+
}
26+
]
27+
}
28+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
PREFIX : <http://example/>
2+
3+
SELECT ?x ?hasLangDir {
4+
?x :p ?object .
5+
BIND( hasLANGDIR(?object) AS ?hasLangDir )
6+
} ORDER BY ?x
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{ "head": {
2+
"vars": [ "x" , "hasLangDir" ]
3+
} ,
4+
"results": {
5+
"bindings": [
6+
{
7+
"x": { "type": "uri" , "value": "http://example/x1" } ,
8+
"hasLangDir": { "type": "literal" , "datatype": "http://www.w3.org/2001/XMLSchema#boolean" , "value": "false" }
9+
} ,
10+
{
11+
"x": { "type": "uri" , "value": "http://example/x2" } ,
12+
"hasLangDir": { "type": "literal" , "datatype": "http://www.w3.org/2001/XMLSchema#boolean" , "value": "true" }
13+
} ,
14+
{
15+
"x": { "type": "uri" , "value": "http://example/x3" } ,
16+
"hasLangDir": { "type": "literal" , "datatype": "http://www.w3.org/2001/XMLSchema#boolean" , "value": "true" }
17+
} ,
18+
{
19+
"x": { "type": "uri" , "value": "http://example/x4" } ,
20+
"hasLangDir": { "type": "literal" , "datatype": "http://www.w3.org/2001/XMLSchema#boolean" , "value": "false" }
21+
} ,
22+
{
23+
"x": { "type": "uri" , "value": "http://example/x5" } ,
24+
"hasLangDir": { "type": "literal" , "datatype": "http://www.w3.org/2001/XMLSchema#boolean" , "value": "false" }
25+
}
26+
]
27+
}
28+
}

sparql/sparql12/lang-basedir/lang.rq

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
PREFIX : <http://example/>
2+
3+
SELECT ?x ?lang {
4+
?x :p ?object .
5+
BIND( LANG(?object) AS ?lang )
6+
} ORDER BY ?x

sparql/sparql12/lang-basedir/lang.srj

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{ "head": {
2+
"vars": [ "x" , "lang" ]
3+
} ,
4+
"results": {
5+
"bindings": [
6+
{
7+
"x": { "type": "uri" , "value": "http://example/x1" } ,
8+
"lang": { "type": "literal" , "value": "en" }
9+
} ,
10+
{
11+
"x": { "type": "uri" , "value": "http://example/x2" } ,
12+
"lang": { "type": "literal" , "value": "en" }
13+
} ,
14+
{
15+
"x": { "type": "uri" , "value": "http://example/x3" } ,
16+
"lang": { "type": "literal" , "value": "ar" }
17+
} ,
18+
{
19+
"x": { "type": "uri" , "value": "http://example/x4" } ,
20+
"lang": { "type": "literal" , "value": "" }
21+
} ,
22+
{
23+
"x": { "type": "uri" , "value": "http://example/x5" }
24+
}
25+
]
26+
}
27+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
PREFIX : <http://example/>
2+
3+
SELECT ?x ?langdir {
4+
?x :p ?object .
5+
BIND( LANGDIR(?object) AS ?langdir )
6+
} ORDER BY ?x
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{ "head": {
2+
"vars": [ "x" , "langdir" ]
3+
} ,
4+
"results": {
5+
"bindings": [
6+
{
7+
"x": { "type": "uri" , "value": "http://example/x1" } ,
8+
"langdir": { "type": "literal" , "value": "" }
9+
} ,
10+
{
11+
"x": { "type": "uri" , "value": "http://example/x2" } ,
12+
"langdir": { "type": "literal" , "value": "ltr" }
13+
} ,
14+
{
15+
"x": { "type": "uri" , "value": "http://example/x3" } ,
16+
"langdir": { "type": "literal" , "value": "rtl" }
17+
} ,
18+
{
19+
"x": { "type": "uri" , "value": "http://example/x4" } ,
20+
"langdir": { "type": "literal" , "value": "" }
21+
} ,
22+
{
23+
"x": { "type": "uri" , "value": "http://example/x5" }
24+
}
25+
]
26+
}
27+
}

0 commit comments

Comments
 (0)