Skip to content

Commit a867d35

Browse files
#555 fromRdf-manifest.jsonld#t0027 covers fallback logic in useNativeTypes mode
1 parent 7bccd8a commit a867d35

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed

tests/fromRdf-manifest.jsonld

+10
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,16 @@
195195
"purpose": "Check list generation with rdf:first property and rdf:nil value.",
196196
"input": "fromRdf/0026-in.nq",
197197
"expect": "fromRdf/0026-out.jsonld"
198+
}, {
199+
"@id": "#t0027",
200+
"@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
201+
"name": "use native types flag with values that cannot be serialized to JSON",
202+
"purpose": "useNativeTypes flag being true is disregarded for a value that cannot be serialized into a native JSON value.",
203+
"option": {
204+
"useNativeTypes": true
205+
},
206+
"input": "fromRdf/0027-in.nq",
207+
"expect": "fromRdf/0027-out.jsonld"
198208
}, {
199209
"@id": "#tdi01",
200210
"@type": [ "jld:PositiveEvaluationTest", "jld:FromRDFTest" ],

tests/fromRdf/0027-in.nq

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<http://example.com/boolean-native> <http://example.com/example> "true"^^<http://www.w3.org/2001/XMLSchema#boolean> .
2+
<http://example.com/boolean-native> <http://example.com/example> "false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
3+
4+
<http://example.com/boolean-object> <http://example.com/example> "True"^^<http://www.w3.org/2001/XMLSchema#boolean> .
5+
<http://example.com/boolean-object> <http://example.com/example> "False"^^<http://www.w3.org/2001/XMLSchema#boolean> .
6+
7+
<http://example.com/number-native> <http://example.com/example> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .
8+
<http://example.com/number-native> <http://example.com/example> "1.1"^^<http://www.w3.org/2001/XMLSchema#decimal> .
9+
10+
<http://example.com/number-object> <http://example.com/example> "0.1e999999999999999"^^<http://www.w3.org/2001/XMLSchema#double> .
11+
<http://example.com/number-object> <http://example.com/example> "+INF"^^<http://www.w3.org/2001/XMLSchema#double> .
12+
<http://example.com/number-object> <http://example.com/example> "-INF"^^<http://www.w3.org/2001/XMLSchema#double> .

tests/fromRdf/0027-out.jsonld

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"@graph": [
3+
{
4+
"@id": "http://example.com/boolean-native",
5+
"http://example.com/example": [
6+
{
7+
"@type": "http://www.w3.org/2001/XMLSchema#boolean",
8+
"@value": true
9+
},
10+
{
11+
"@type": "http://www.w3.org/2001/XMLSchema#boolean",
12+
"@value": false
13+
}
14+
]
15+
},
16+
{
17+
"@id": "http://example.com/boolean-object",
18+
"http://example.com/example": [
19+
{
20+
"@type": "http://www.w3.org/2001/XMLSchema#boolean",
21+
"@value": "True"
22+
},
23+
{
24+
"@type": "http://www.w3.org/2001/XMLSchema#boolean",
25+
"@value": "False"
26+
}
27+
]
28+
},
29+
{
30+
"@id": "http://example.com/number-native",
31+
"http://example.com/example": [
32+
{
33+
"@type": "http://www.w3.org/2001/XMLSchema#integer",
34+
"@value": 1
35+
},
36+
{
37+
"@type": "http://www.w3.org/2001/XMLSchema#decimal",
38+
"@value": 1.1
39+
}
40+
]
41+
},
42+
{
43+
"@id": "http://example.com/number-object",
44+
"http://example.com/example": [
45+
{
46+
"@type": "http://www.w3.org/2001/XMLSchema#double",
47+
"@value": "0.1e999999999999999"
48+
},
49+
{
50+
"@type": "http://www.w3.org/2001/XMLSchema#double",
51+
"@value": "+INF"
52+
},
53+
{
54+
"@type": "http://www.w3.org/2001/XMLSchema#double",
55+
"@value": "-INF"
56+
}
57+
]
58+
}
59+
]
60+
}

0 commit comments

Comments
 (0)