Transform JSON-LD to RDF
These tests implement the requirements for the JSON-LD-star Deserialize JSON-LD to RDF Algorithm.
This is an HTML version of a test manifest. The JSON-LD version of this manifest may be found at
toRdf-manifest.jsonld.
The manifest vocabulary is described in the
JSON-LD Test Vocabulary
(JSON-LD,
Turtle)
and is based on the RDF Test Vocabulary.
The JSON-LD-star Test Suite is a set of tests that can
be used to verify JSON-LD Processor for the RDF-star extensions to JSON-LD.
More information and an RDFS definition of the test vocabulary can be found at vocab.
General instructions for running the JSON-LD Test suites
Tests are run broadly the same as those for the core JSON-LD test suite, with the addition of the rdfstar
option set to true
for each test. If not set, explicitly, the test checks for proper behavior when not operating in RDF-star mode.
Running tests
The top-level manifest references the specific test manifests, which in turn reference each test associated with a particular type of behavior.
Implementations create their own infrastructure for running the test suite. In particular, the following should be considered:
- For JSON-Ld-star tests, the
specVersion
is set to JSON-LD-star
.
- Some tests may have a
requires
property, indicating some optional behavior described by a test vocabulary term. Tests that use JSON-LD-star functionality have "requires": "JSON-LD-star"
specified.
Contributing Tests
If you would like to contribute a new test or a fix to an existing test,
please follow these steps:
- Notify the JSON-LD Community mailing list, public-linked-json@w3.org,
that you will be creating a new test or fix and the purpose of the
change.
- Clone the git repository: git://github.com/json-ld/json-ld-star.git
- Make your changes and submit them via github, or via a 'git format-patch'
to the JSON-LD Community Group mailing list.
Distribution
Distributed under the W3C Test Suite License. To contribute to a W3C Test Suite, see the policies and contribution forms.
Disclaimer
UNDER THE EXCLUSIVE LICENSE, THIS DOCUMENT AND ALL DOCUMENTS, TESTS AND SOFTWARE THAT LINK THIS STATEMENT ARE PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.
Code of Conduct
W3C functions under a code of conduct.
- baseIri
- https://w3c.github.io/json-ld-api/tests/
Test sequence:
-
Test tst01 invalid embedded node 1
-
- id
- #tst01
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Node with embedded subject without rdfstar option.
- input
-
toRdf/st01-in.jsonld
- expect
-
invalid @id value
- Options
-
- specVersion
- json-ld-star
- rdfstar
- false
- Requires
- JSON-LD-star
-
Test tst02 ignored annotation 1
-
- id
- #tst02
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node object with @annotation property is ignored without rdfstar option.
- input
-
toRdf/st02-in.jsonld
- expect
-
toRdf/st02-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- false
- Requires
- JSON-LD-star
-
Test tst03 ignored annotation 2
-
- id
- #tst03
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Value object with @annotation property is ignored without rdfstar option
- input
-
toRdf/st03-in.jsonld
- expect
-
toRdf/st03-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- false
- Requires
- JSON-LD-star
-
Test tst04 embedded node 1
-
- id
- #tst04
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with embedded subject having no @id
- input
-
toRdf/st04-in.jsonld
- expect
-
toRdf/st04-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst05 embedded node 2
-
- id
- #tst05
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with embedded subject having IRI @id
- input
-
toRdf/st05-in.jsonld
- expect
-
toRdf/st05-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst06 embedded node 3
-
- id
- #tst06
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with embedded subject having BNode @id
- input
-
toRdf/st06-in.jsonld
- expect
-
toRdf/st06-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst07 embedded node 4
-
- id
- #tst07
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with embedded subject having a type
- input
-
toRdf/st07-in.jsonld
- expect
-
toRdf/st07-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst08 embedded node 5
-
- id
- #tst08
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with embedded subject having an IRI value
- input
-
toRdf/st08-in.jsonld
- expect
-
toRdf/st08-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst09 embedded node 6
-
- id
- #tst09
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with embedded subject having an BNode value
- input
-
toRdf/st09-in.jsonld
- expect
-
toRdf/st09-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst10 embedded node 7
-
- id
- #tst10
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with recursive embedded subject
- input
-
toRdf/st10-in.jsonld
- expect
-
toRdf/st10-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst11 invalid embedded node 2
-
- id
- #tst11
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Illegal node with subject having no property
- input
-
toRdf/st11-in.jsonld
- expect
-
invalid embedded node
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst12 invalid embedded node 3
-
- id
- #tst12
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Illegal node with subject having multiple properties
- input
-
toRdf/st12-in.jsonld
- expect
-
invalid embedded node
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst13 invalid embedded node 4
-
- id
- #tst13
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Illegal node with subject having multiple types
- input
-
toRdf/st13-in.jsonld
- expect
-
invalid embedded node
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst14 invalid embedded node 5
-
- id
- #tst14
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Illegal node with subject having type and property
- input
-
toRdf/st14-in.jsonld
- expect
-
invalid embedded node
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst15 embedded node 8
-
- id
- #tst15
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with embedded object
- input
-
toRdf/st15-in.jsonld
- expect
-
toRdf/st15-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst16 embedded node 9
-
- id
- #tst16
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with embedded object having properties
- input
-
toRdf/st16-in.jsonld
- expect
-
toRdf/st16-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst17 embedded node 10
-
- id
- #tst17
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with recursive embedded object
- input
-
toRdf/st17-in.jsonld
- expect
-
toRdf/st17-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst18 Annotation node 1
-
- id
- #tst18
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation property on value object
- input
-
toRdf/st18-in.jsonld
- expect
-
toRdf/st18-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst19 Annotation node 2
-
- id
- #tst19
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation property on node object
- input
-
toRdf/st19-in.jsonld
- expect
-
toRdf/st19-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst20 Annotation node 3
-
- id
- #tst20
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation property multiple values
- input
-
toRdf/st20-in.jsonld
- expect
-
toRdf/st20-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst20a Annotation node 4
-
- id
- #tst20a
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation property containing multiple properties
- input
-
toRdf/st20a-in.jsonld
- expect
-
toRdf/st20a-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst20b Annotation node 5
-
- id
- #tst20b
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation property containing an empty node object
- input
-
toRdf/st20b-in.jsonld
- expect
-
toRdf/st20b-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst21 Invalid annotation node 1
-
- id
- #tst21
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation property that is on the top-level is invalid
- input
-
toRdf/st21-in.jsonld
- expect
-
invalid annotation
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst22 Invalid annotation node 2
-
- id
- #tst22
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation property on a top-level graph node is invalid
- input
-
toRdf/st22-in.jsonld
- expect
-
invalid annotation
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst23 Invalid annotation node 3
-
- id
- #tst23
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation property having @id is invalid
- input
-
toRdf/st23-in.jsonld
- expect
-
invalid annotation
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst24 Invalid annotation node 4
-
- id
- #tst24
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation property with simple value is invalid
- input
-
toRdf/st24-in.jsonld
- expect
-
invalid annotation
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst24a Invalid annotation node 5
-
- id
- #tst24a
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation property with value object value is invalid
- input
-
toRdf/st24a-in.jsonld
- expect
-
invalid annotation
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst25 Invalid annotation node 6
-
- id
- #tst25
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- @annotation on a list
- input
-
toRdf/st25-in.jsonld
- expect
-
invalid set or list object
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst26 Invalid annotation node 7
-
- id
- #tst26
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation on a list value
- input
-
toRdf/st26-in.jsonld
- expect
-
invalid annotation
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst27 Invalid annotation node 8
-
- id
- #tst27
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- @annotation property on a top-level @included node is invalid
- input
-
toRdf/st27-in.jsonld
- expect
-
invalid annotation
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst27a Invalid annotation node 9
-
- id
- #tst27a
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation that is an embedded node is invalid
- input
-
toRdf/st27a-in.jsonld
- expect
-
invalid annotation
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst28 Embedded annotation node 1
-
- id
- #tst28
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation property on embedded subject
- input
-
toRdf/st28-in.jsonld
- expect
-
toRdf/st28-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst29 Embedded annotation node 1
-
- id
- #tst29
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Node with @annotation property on embedded object
- input
-
toRdf/st29-in.jsonld
- expect
-
toRdf/st29-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst30 embedded node 11
-
- id
- #tst30
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Embedded node with reverse relationship
- input
-
toRdf/st30-in.jsonld
- expect
-
invalid embedded node
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst31 embedded node 12
-
- id
- #tst31
- Type
- jld:NegativeEvaluationTest, jld:ToRDFTest
- Purpose
- Embedded node with expanded reverse relationship
- input
-
toRdf/st31-in.jsonld
- expect
-
invalid embedded node
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst32 embedded node 13
-
- id
- #tst32
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Embedded node used as subject in reverse relationship
- input
-
toRdf/st32-in.jsonld
- expect
-
toRdf/st32-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst33 embedded node 14
-
- id
- #tst33
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- Embedded node used as object in reverse relationship
- input
-
toRdf/st33-in.jsonld
- expect
-
toRdf/st33-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst34 Reverse annotation node 1
-
- id
- #tst34
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- node with @annotation property on node object with reverse relationship
- input
-
toRdf/st34-in.jsonld
- expect
-
toRdf/st34-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst35 Reverse annotation node 2
-
- id
- #tst35
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- reverse relationship inside annotation
- input
-
toRdf/st35-in.jsonld
- expect
-
toRdf/st35-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst36 Alias for embedded node
-
- id
- #tst36
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- embedded node with an alias of `@id`
- input
-
toRdf/st36-in.jsonld
- expect
-
toRdf/st36-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst37 Alias for annotation node
-
- id
- #tst37
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- annotation node with an alias of `@annotation`
- input
-
toRdf/st37-in.jsonld
- expect
-
toRdf/st37-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst38 annotation value 1
-
- id
- #tst38
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- embedded node with annotation on value object
- input
-
toRdf/st38-in.jsonld
- expect
-
toRdf/st38-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst39 annotation with embedded node 1
-
- id
- #tst39
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- annotation node containing an embedded node
- input
-
toRdf/st39-in.jsonld
- expect
-
toRdf/st39-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star
-
Test tst40 annotation with annotation 1
-
- id
- #tst40
- Type
- jld:PositiveEvaluationTest, jld:ToRDFTest
- Purpose
- annotation node containing an annotation node
- input
-
toRdf/st40-in.jsonld
- expect
-
toRdf/st40-out.nq
- Options
-
- specVersion
- json-ld-star
- rdfstar
- true
- Requires
- JSON-LD-star