Skip to content

Commit 9dffa49

Browse files
committed
Test that most specific property generator is chosen
This addresses #142 and #160.
1 parent e490c95 commit 9dffa49

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"@context": {
3+
"site": "http://example.com/",
4+
"field_tags_nc": { "@id": [ "site:vocab/field_tags", "http://schema.org/about" ] },
5+
"field_tags_set": { "@id": [ "site:vocab/field_tags", "http://schema.org/about" ], "@container": "@set" },
6+
"field_tags_set_id": { "@id": [ "site:vocab/field_tags", "http://schema.org/about" ], "@container": "@set", "@type": "@id" },
7+
"field_related_nc": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ] },
8+
"field_related_set": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@set" },
9+
"field_related_list": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@list" },
10+
"field_related_list_id": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@list", "@type": "@id" },
11+
"field_related_list_lang": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@list", "@language": "en" }
12+
}
13+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[
2+
{
3+
"@id": "http://example.com/node/1",
4+
"http://example.com/vocab/field_related": [
5+
{
6+
"@list": [
7+
{
8+
"@id": "http://example.com/node/this-is-related-news"
9+
},
10+
{
11+
"@value": "This is a related string",
12+
"@language": "en"
13+
}
14+
]
15+
}
16+
],
17+
"http://schema.org/about": [
18+
{
19+
"@list": [
20+
{
21+
"@id": "http://example.com/node/this-is-related-news"
22+
},
23+
{
24+
"@value": "This is a related string",
25+
"@language": "en"
26+
}
27+
]
28+
},
29+
{
30+
"@id": "http://example.com/term/this-is-a-tag"
31+
}
32+
],
33+
"http://example.com/vocab/field_tags": [
34+
{
35+
"@id": "http://example.com/term/this-is-a-tag"
36+
}
37+
]
38+
}
39+
]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"@context": {
3+
"site": "http://example.com/",
4+
"field_tags_nc": { "@id": [ "site:vocab/field_tags", "http://schema.org/about" ] },
5+
"field_tags_set": { "@id": [ "site:vocab/field_tags", "http://schema.org/about" ], "@container": "@set" },
6+
"field_tags_set_id": { "@id": [ "site:vocab/field_tags", "http://schema.org/about" ], "@container": "@set", "@type": "@id" },
7+
"field_related_nc": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ] },
8+
"field_related_set": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@set" },
9+
"field_related_list": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@list" },
10+
"field_related_list_id": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@list", "@type": "@id" },
11+
"field_related_list_lang": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@list", "@language": "en" }
12+
},
13+
"@id": "site:node/1",
14+
"field_tags_set_id": [
15+
"site:term/this-is-a-tag"
16+
],
17+
"field_related_list": [
18+
{
19+
"@id": "site:node/this-is-related-news"
20+
},
21+
{
22+
"@value": "This is a related string",
23+
"@language": "en"
24+
}
25+
]
26+
}

test-suite/tests/compact-manifest.jsonld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,5 +204,11 @@
204204
"input": "compact-0033-in.jsonld",
205205
"context": "compact-0033-context.jsonld",
206206
"expect": "compact-0033-out.jsonld"
207+
}, {
208+
"@type": ["test:TestCase", "jld:CompactTest"],
209+
"name": "Choose most specific property generator",
210+
"input": "compact-0034-in.jsonld",
211+
"context": "compact-0034-context.jsonld",
212+
"expect": "compact-0034-out.jsonld"
207213
}]
208214
}

0 commit comments

Comments
 (0)