Skip to content

Commit f7959c4

Browse files
committed
Framing test suite.
1 parent f5bc1dd commit f7959c4

File tree

191 files changed

+4156
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+4156
-0
lines changed

tests/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Introduction
2+
3+
The JSON-LD Test Suite is a set of tests that can
4+
be used to verify JSON-LD Processor conformance to the set of specifications
5+
that constitute JSON-LD. The goal of the suite is to provide an easy and
6+
comprehensive JSON-LD testing solution for developers creating JSON-LD Processors.
7+
8+
# Design
9+
10+
Tests are for _framing_:
11+
* _frame_ tests have _input_, _frame_ and _expected_ documents. The _expected_ results can be compared using JSON object comparison with the processor output. For *NegativeEvaluationTests*, the result is a string associated with the expected error code.
12+
13+
Unless `processingMode` is set explicitly in a test entry, `processingMode` is compatible with both `json-ld-1.0` and `json-ld-1.1`.
14+
15+
Test results that include a context input presume that the context is provided locally, and not from the referenced location, thus the results will include the content of the context file, rather than a reference.
16+
17+
# Running tests
18+
Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:
19+
20+
* Some algorithms, may not preserve the order of statements listed in the input document, and provision should be taken for performing unordered array comparison, for arrays other than values of `@list`. (This may be difficult for compacted results, where array value ordering is dependent on the associated term definition).
21+
* Some implementations may choose an alternative Blank Node Label algorithm, the comparison between documents containing blank node labels should take this into consideration. (One way to do this may be to reduce both results and _expected_ to datsets to extract a bijective mapping of blank node labels between the two datasets as described in [RDF Dataset Isomorphism](https://www.w3.org/TR/rdf11-concepts/#dfn-dataset-isomorphism)).
22+
# Contributing
23+
24+
If you would like to contribute a new test or a fix to an existing test,
25+
please follow these steps:
26+
27+
1. Notify the JSON-LD mailing list, [email protected],
28+
that you will be creating a new test or fix and the purpose of the
29+
change.
30+
2. Clone the git repository: git://github.com/w3c/json-ld-framing.git
31+
3. Make your changes and submit them via github, or via a 'git format-patch'
32+
to the [JSON-LD Working Group mailing list](mailto:[email protected]).

tests/frame-manifest.jsonld

Lines changed: 585 additions & 0 deletions
Large diffs are not rendered by default.

tests/frame/0001-frame.jsonld

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@type": "ex:Library",
7+
"ex:contains": {
8+
"@type": "ex:Book",
9+
"ex:contains": {
10+
"@type": "ex:Chapter"
11+
}
12+
}
13+
}

tests/frame/0001-in.jsonld

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

tests/frame/0001-out.jsonld

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
}
21+
}]
22+
}

tests/frame/0002-frame.jsonld

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@type": "ex:Library",
7+
"ex:contains": {
8+
"@type": "ex:Book",
9+
"ex:contains": {
10+
"@type": "ex:Chapter"
11+
}
12+
}
13+
}

tests/frame/0002-in.jsonld

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+
"ex:contains": {"@type": "@id"}
6+
},
7+
"@graph": [
8+
{
9+
"@id": "http://example.org/test/#library",
10+
"@type": "ex:Library",
11+
"ex:contains": "http://example.org/test#book"
12+
},
13+
{
14+
"@id": "http://example.org/test#book",
15+
"@type": "ex:Book",
16+
"dc:contributor": "Writer",
17+
"dc:title": "My Book",
18+
"ex:contains": "http://example.org/test#chapter"
19+
},
20+
{
21+
"@id": "http://example.org/test#chapter",
22+
"@type": "ex:Chapter",
23+
"dc:description": "Fun",
24+
"dc:title": "Chapter One",
25+
"ex:act": "ex:ActOne"
26+
}
27+
]
28+
}

tests/frame/0002-out.jsonld

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
"ex:act": "ex:ActOne"
20+
}
21+
}
22+
}]
23+
}

tests/frame/0003-frame.jsonld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@type": "ex:DoesNotExist"
7+
}

tests/frame/0003-in.jsonld

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": {
6+
"@type": "@id"
7+
}
8+
},
9+
"@graph": [
10+
{
11+
"@id": "http://example.org/test/#library",
12+
"@type": "ex:Library",
13+
"ex:contains": "http://example.org/test#book"
14+
},
15+
{
16+
"@id": "http://example.org/test#book",
17+
"@type": "ex:Book",
18+
"dc:contributor": "Writer",
19+
"dc:title": "My Book",
20+
"ex:contains": "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+
}

tests/frame/0003-out.jsonld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@graph": []
7+
}

tests/frame/0004-frame.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#",
5+
"ex:contains": {"@type": "@id"}
6+
},
7+
"@type": "ex:Library"
8+
}

tests/frame/0004-in.jsonld

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

tests/frame/0004-out.jsonld

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

tests/frame/0005-frame.jsonld

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@explicit": true,
7+
"@type": "ex:Library",
8+
"ex:contains": {
9+
"@explicit": true,
10+
"@type": "ex:Book",
11+
"dc:title": {},
12+
"ex:contains": {
13+
"@explicit": true,
14+
"@type": "ex:Chapter",
15+
"dc:title": {},
16+
"ex:null": {}
17+
}
18+
}
19+
}

tests/frame/0005-in.jsonld

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": {
6+
"@type": "@id"
7+
}
8+
},
9+
"@graph": [
10+
{
11+
"@id": "http://example.org/test/#library",
12+
"@type": "ex:Library",
13+
"ex:contains": "http://example.org/test#book"
14+
},
15+
{
16+
"@id": "http://example.org/test#book",
17+
"@type": "ex:Book",
18+
"dc:contributor": "Writer",
19+
"dc:title": "My Book",
20+
"ex:contains": "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+
}

tests/frame/0005-out.jsonld

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+
"@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:title": "My Book",
13+
"ex:contains": {
14+
"@id": "http://example.org/test#chapter",
15+
"@type": "ex:Chapter",
16+
"dc:title": "Chapter One",
17+
"ex:null": null
18+
}
19+
}
20+
}]
21+
}

tests/frame/0006-frame.jsonld

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"@context": {
3+
"dc": "http://purl.org/dc/elements/1.1/",
4+
"ex": "http://example.org/vocab#"
5+
},
6+
"@type": "ex:Library",
7+
"ex:contains": {
8+
"@type": "ex:Book",
9+
"ex:contains": {
10+
"@type": "ex:Chapter"
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)