Skip to content

Commit a27b0f4

Browse files
committed
Add embedded graph framing tests from jsonld.js.
Fixes #591.
1 parent 35e0771 commit a27b0f4

25 files changed

+1019
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@type": "ex:Library",
7+
"@embed": "@always",
8+
"ex:contains": {
9+
"@type": "ex:Book",
10+
"@embed": "@always",
11+
"ex:contains": {
12+
"@type": "ex:Chapter",
13+
"@embed": "@always"
14+
},
15+
"ex:bookmark": {
16+
"@type": "ex:Chapter",
17+
"@embed": "@always"
18+
}
19+
}
20+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#",
5+
"ex:contains": {"@type": "@id"},
6+
"ex:bookmark": {"@type": "@id"}
7+
},
8+
"@graph": [
9+
{
10+
"@id": "http://example.org/test/#library",
11+
"@type": "ex:Library",
12+
"ex:contains": "http://example.org/test#book"
13+
},
14+
{
15+
"@id": "http://example.org/test#book",
16+
"@type": "ex:Book",
17+
"dc:contributor": "Writer",
18+
"dc:title": "My Book",
19+
"ex:contains": "http://example.org/test#chapter",
20+
"ex:bookmark": "http://example.org/test#chapter"
21+
},
22+
{
23+
"@id": "http://example.org/test#chapter",
24+
"@type": "ex:Chapter",
25+
"dc:description": "Fun",
26+
"dc:title": "Chapter One"
27+
}
28+
]
29+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@graph": [{
7+
"@id": "http://example.org/test/#library",
8+
"@type": "ex:Library",
9+
"ex:contains": {
10+
"@id": "http://example.org/test#book",
11+
"@type": "ex:Book",
12+
"dc:contributor": "Writer",
13+
"dc:title": "My Book",
14+
"ex:contains": {
15+
"@id": "http://example.org/test#chapter",
16+
"@type": "ex:Chapter",
17+
"dc:description": "Fun",
18+
"dc:title": "Chapter One"
19+
},
20+
"ex:bookmark": {
21+
"@id": "http://example.org/test#chapter",
22+
"@type": "ex:Chapter",
23+
"dc:description": "Fun",
24+
"dc:title": "Chapter One"
25+
}
26+
}
27+
}]
28+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@type": "ex:Library",
7+
"@embed": "@always",
8+
"ex:contains": {
9+
"@type": "ex:Book",
10+
"@embed": "@always",
11+
"ex:contains": {
12+
"@type": "ex:Chapter",
13+
"@embed": "@always"
14+
},
15+
"ex:topic": {
16+
"@type": "ex:Library",
17+
"@embed": "@always"
18+
}
19+
}
20+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#",
5+
"ex:contains": {"@type": "@id"},
6+
"ex:topic": {"@type": "@id"}
7+
},
8+
"@graph": [
9+
{
10+
"@id": "http://example.org/test/#library",
11+
"@type": "ex:Library",
12+
"ex:contains": "http://example.org/test#book"
13+
},
14+
{
15+
"@id": "http://example.org/test#book",
16+
"@type": "ex:Book",
17+
"dc:contributor": "Writer",
18+
"dc:title": "My Book about a library",
19+
"ex:contains": "http://example.org/test#chapter",
20+
"ex:topic": "http://example.org/test/#library"
21+
},
22+
{
23+
"@id": "http://example.org/test#chapter",
24+
"@type": "ex:Chapter",
25+
"dc:description": "Fun",
26+
"dc:title": "Chapter One"
27+
}
28+
]
29+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@graph": [{
7+
"@id": "http://example.org/test/#library",
8+
"@type": "ex:Library",
9+
"ex:contains": {
10+
"@id": "http://example.org/test#book",
11+
"@type": "ex:Book",
12+
"dc:contributor": "Writer",
13+
"dc:title": "My Book about a library",
14+
"ex:contains": {
15+
"@id": "http://example.org/test#chapter",
16+
"@type": "ex:Chapter",
17+
"dc:description": "Fun",
18+
"dc:title": "Chapter One"
19+
},
20+
"ex:topic": {
21+
"@id": "http://example.org/test/#library"
22+
}
23+
}
24+
}]
25+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@type": "ex:Library",
7+
"@embed": "@always",
8+
"ex:contains": {
9+
"@type": "ex:Book",
10+
"@embed": "@always",
11+
"ex:contains": {
12+
"@type": "ex:Chapter",
13+
"@embed": "@always",
14+
"ex:topic": {
15+
"@type": "ex:Library",
16+
"@embed": "@always"
17+
}
18+
}
19+
}
20+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#",
5+
"ex:contains": {"@type": "@id"},
6+
"ex:topic": {"@type": "@id"}
7+
},
8+
"@graph": [
9+
{
10+
"@id": "http://example.org/test/#library",
11+
"@type": "ex:Library",
12+
"ex:contains": "http://example.org/test#book"
13+
},
14+
{
15+
"@id": "http://example.org/test#book",
16+
"@type": "ex:Book",
17+
"dc:contributor": "Writer",
18+
"dc:title": "My Book about a library",
19+
"ex:contains": "http://example.org/test#chapter"
20+
},
21+
{
22+
"@id": "http://example.org/test#chapter",
23+
"@type": "ex:Chapter",
24+
"dc:description": "Fun",
25+
"dc:title": "Chapter One",
26+
"ex:topic": "http://example.org/test/#library"
27+
}
28+
]
29+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@graph": [{
7+
"@id": "http://example.org/test/#library",
8+
"@type": "ex:Library",
9+
"ex:contains": {
10+
"@id": "http://example.org/test#book",
11+
"@type": "ex:Book",
12+
"dc:contributor": "Writer",
13+
"dc:title": "My Book about a library",
14+
"ex:contains": {
15+
"@id": "http://example.org/test#chapter",
16+
"@type": "ex:Chapter",
17+
"dc:description": "Fun",
18+
"dc:title": "Chapter One",
19+
"ex:topic": {
20+
"@id": "http://example.org/test/#library"
21+
}
22+
}
23+
}
24+
}]
25+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@type": "ex:Library",
7+
"@embed": "@always",
8+
"ex:contains": {
9+
"@type": "ex:Book",
10+
"@omitDefault": "true",
11+
"@embed": "@always",
12+
"ex:contains": {
13+
"@type": "ex:Chapter",
14+
"@embed": "@always",
15+
"ex:topic": {
16+
"@type": "ex:Library",
17+
"@embed": "@always"
18+
}
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)