Skip to content

Commit d787de2

Browse files
committed
Add more @type: @vocab tests
This addresses #204
1 parent 1779ef7 commit d787de2

10 files changed

+114
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"@context": {
3+
"Bar": "http://example.com/vocab#Bar",
4+
"foo": {
5+
"@id": "http://example.com/vocab#foo",
6+
"@type": "@vocab"
7+
}
8+
}
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{
3+
"http://example.com/vocab#foo": [
4+
{ "@id": "http://example.com/vocab#Bar" },
5+
{ "@id": "http://example.com/vocab#Baz" }
6+
]
7+
}
8+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"@context": {
3+
"Bar": "http://example.com/vocab#Bar",
4+
"foo": {
5+
"@id": "http://example.com/vocab#foo",
6+
"@type": "@vocab"
7+
}
8+
},
9+
"foo": [
10+
"Bar",
11+
"http://example.com/vocab#Baz"
12+
]
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"@context": {
3+
"Bar": "http://example.com/vocab#Bar",
4+
"foo": {
5+
"@id": "http://example.com/vocab#foo",
6+
"@type": "@id"
7+
}
8+
}
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{
3+
"http://example.com/vocab#foo": [
4+
{ "@id": "http://example.com/vocab#Bar" },
5+
{ "@id": "http://example.com/vocab#Baz" }
6+
]
7+
}
8+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"@context": {
3+
"Bar": "http://example.com/vocab#Bar",
4+
"foo": {
5+
"@id": "http://example.com/vocab#foo",
6+
"@type": "@id"
7+
}
8+
},
9+
"foo": [
10+
"http://example.com/vocab#Bar",
11+
"http://example.com/vocab#Baz"
12+
]
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"@context": {
3+
"Bar": "http://example.com/vocab#Bar",
4+
"fooI": {
5+
"@id": "http://example.com/vocab#foo",
6+
"@type": "@id"
7+
},
8+
"fooV": {
9+
"@id": "http://example.com/vocab#foo",
10+
"@type": "@vocab"
11+
}
12+
}
13+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{
3+
"http://example.com/vocab#foo": [
4+
{ "@id": "http://example.com/vocab#Bar" },
5+
{ "@id": "http://example.com/vocab#Baz" }
6+
]
7+
}
8+
]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"@context": {
3+
"Bar": "http://example.com/vocab#Bar",
4+
"fooI": {
5+
"@id": "http://example.com/vocab#foo",
6+
"@type": "@id"
7+
},
8+
"fooV": {
9+
"@id": "http://example.com/vocab#foo",
10+
"@type": "@vocab"
11+
}
12+
},
13+
"fooV": "Bar",
14+
"fooI": "http://example.com/vocab#Baz"
15+
}

test-suite/tests/compact-manifest.jsonld

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,24 @@
354354
"input": "compact-0058-in.jsonld",
355355
"context": "compact-0058-context.jsonld",
356356
"expect": "compact-0058-out.jsonld"
357+
}, {
358+
"@type": ["test:TestCase", "jld:CompactTest"],
359+
"name": "If there's no term with @type: @id, use terms with @type: @vocab for IRIs not mapped to terms",
360+
"input": "compact-0059-in.jsonld",
361+
"context": "compact-0059-context.jsonld",
362+
"expect": "compact-0059-out.jsonld"
363+
}, {
364+
"@type": ["test:TestCase", "jld:CompactTest"],
365+
"name": "If there's no term with @type: @vocab, use terms with @type: @id for IRIs mapped to terms",
366+
"input": "compact-0060-in.jsonld",
367+
"context": "compact-0060-context.jsonld",
368+
"expect": "compact-0060-out.jsonld"
369+
}, {
370+
"@type": ["test:TestCase", "jld:CompactTest"],
371+
"name": "Separate IRIs for the same property to use term with more specific @type (@id vs. @vocab)",
372+
"input": "compact-0061-in.jsonld",
373+
"context": "compact-0061-context.jsonld",
374+
"expect": "compact-0061-out.jsonld"
357375
}
358376
]
359377
}

0 commit comments

Comments
 (0)