W3C

Compaction

These tests implement the requirements for the JSON-LD-star Compaction Algorithm.

This is an HTML version of a test manifest. The JSON-LD version of this manifest may be found at compact-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:

Contributing Tests

If you would like to contribute a new test or a fix to an existing test, please follow these steps:

  1. 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.
  2. Clone the git repository: git://github.com/json-ld/json-ld-star.git
  3. 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://json-ld.github.io/json-ld-star/tests/

Test sequence:

Test tst04 embedded node 1
id
#tst04
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with embedded subject having no @id
input
compact/st04-in.jsonld
context
compact/st04-out.jsonld
expect
compact/st04-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst05 embedded node 2
id
#tst05
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with embedded subject having IRI @id
input
compact/st05-in.jsonld
context
compact/st05-out.jsonld
expect
compact/st05-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst06 embedded node 3
id
#tst06
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with embedded subject having BNode @id
input
compact/st06-in.jsonld
context
compact/st06-out.jsonld
expect
compact/st06-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst07 embedded node 4
id
#tst07
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with embedded subject having a type
input
compact/st07-in.jsonld
context
compact/st07-out.jsonld
expect
compact/st07-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst08 embedded node 5
id
#tst08
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with embedded subject having an IRI value
input
compact/st08-in.jsonld
context
compact/st08-out.jsonld
expect
compact/st08-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst09 embedded node 6
id
#tst09
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with embedded subject having an BNode value
input
compact/st09-in.jsonld
context
compact/st09-out.jsonld
expect
compact/st09-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst10 embedded node 7
id
#tst10
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with recursive embedded subject
input
compact/st10-in.jsonld
context
compact/st10-out.jsonld
expect
compact/st10-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst15 embedded node 8
id
#tst15
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with embedded object
input
compact/st15-in.jsonld
context
compact/st15-out.jsonld
expect
compact/st15-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst16 embedded node 9
id
#tst16
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with embedded object having properties
input
compact/st16-in.jsonld
context
compact/st16-out.jsonld
expect
compact/st16-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst17 embedded node 10
id
#tst17
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with recursive embedded object
input
compact/st17-in.jsonld
context
compact/st17-out.jsonld
expect
compact/st17-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst18 Annotation node 1
id
#tst18
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with @annotation property on value object
input
compact/st18-in.jsonld
context
compact/st18-out.jsonld
expect
compact/st18-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst19 Annotation node 2
id
#tst19
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with @annotation property on node object
input
compact/st19-in.jsonld
context
compact/st19-out.jsonld
expect
compact/st19-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst20 Annotation node 3
id
#tst20
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with @annotation property multiple values
input
compact/st20-in.jsonld
context
compact/st20-out.jsonld
expect
compact/st20-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst20a Annotation node 4
id
#tst20a
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with @annotation property containing multiple properties
input
compact/st20a-in.jsonld
context
compact/st20a-out.jsonld
expect
compact/st20a-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst20b Annotation node 5
id
#tst20b
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with @annotation property containing an empty node object
input
compact/st20b-in.jsonld
context
compact/st20b-out.jsonld
expect
compact/st20b-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst28 Embedded annotation node 1
id
#tst28
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with @annotation property on embedded subject
input
compact/st28-in.jsonld
context
compact/st28-out.jsonld
expect
compact/st28-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst29 Embedded annotation node 2
id
#tst29
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Node with @annotation property on embedded object
input
compact/st29-in.jsonld
context
compact/st29-out.jsonld
expect
compact/st29-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst32 embedded node 13
id
#tst32
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Embedded node used as subject in reverse relationship
input
compact/st32-in.jsonld
context
compact/st32-out.jsonld
expect
compact/st32-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst33 embedded node 14
id
#tst33
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
Embedded node used as object in reverse relationship
input
compact/st33-in.jsonld
context
compact/st33-out.jsonld
expect
compact/st33-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst34 Reverse annotation node 1
id
#tst34
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
node with @annotation property on node object with reverse relationship
input
compact/st34-in.jsonld
context
compact/st34-out.jsonld
expect
compact/st34-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst35 Reverse annotation node 2
id
#tst35
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
reverse relationship inside annotation
input
compact/st35-in.jsonld
context
compact/st35-out.jsonld
expect
compact/st35-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst36 Alias for embedded node
id
#tst36
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
embedded node with an alias of `@id`
input
compact/st36-in.jsonld
context
compact/st36-out.jsonld
expect
compact/st36-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst37 Alias for annotation node
id
#tst37
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
annotation node with an alias of `@annotation`
input
compact/st37-in.jsonld
context
compact/st37-out.jsonld
expect
compact/st37-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst38 annotation value 1
id
#tst38
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
embedded node with annotation on value object
input
compact/st38-in.jsonld
context
compact/st38-out.jsonld
expect
compact/st38-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst39 annotation with embedded node 1
id
#tst39
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
annotation node containing an embedded node
input
compact/st39-in.jsonld
context
compact/st39-out.jsonld
expect
compact/st39-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star
Test tst40 annotation with annotation 1
id
#tst40
Type
jld:PositiveEvaluationTest, jld:CompactTest
Purpose
annotation node containing an annotation node
input
compact/st40-in.jsonld
context
compact/st40-out.jsonld
expect
compact/st40-out.jsonld
Options
specVersion
json-ld-star
rdfstar
true
Requires
JSON-LD-star