W3C

Tests using YAML-LD JSON Profile

These tests implement the requirements for the YAML-LD JSON Profile.

This is an HTML version of a test manifest. The JSON-LD version of this manifest may be found at manifest.jsonld.jsonld. The manifest vocabulary is described in the JSON-LD Test Vocabulary ( JSON-LD, Turtle ) and is based on the RDF Test Vocabulary.

The YAML-LD Test Suite is a set of tests that can be used to verify YAML-LD Processor conformance to the set of specifications that constitute YAML-LD. The goal of the suite is to provide an easy and comprehensive YAML-LD testing solution for developers creating YAML-LD Processors.

General instructions for running the YAML-LD Test suite

Described in the README.

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 Group that you will be creating a new test or fix and the purpose of the change by creating an issue on the GitHub Repository, or by sending a message to the group mailing list, public-linked-json@w3.org.
  2. Clone the git repository: git://github.com/w3c/json-ld-api.git .
  3. Make your changes on a separate branch and submit them via a GitHub Pull Request, 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.

Test Definitions

baseIri
https://json-ld.github.io/yaml-ld/tests/
Test cir-document-content-1-negative Document with scalar content.
ID
#cir-document-content-1-negative
Type
jld:NegativeEvaluationTest,jld:ExpandTest
Name
Document with scalar content.
Purpose
Document content MUST be sequence or mapping.
Input
cases/cir-document-content-1-negative-in.yamlld
References
(1)
Requirement
must
Expect Error Code
loading document failed
Test cir-mapping-key-1-negative Mapping with integer key.
ID
#cir-mapping-key-1-negative
Type
jld:NegativeEvaluationTest,jld:ExpandTest
Name
Mapping with integer key.
Purpose
A mapping key MUST be a string.
Input
cases/mapping-key-must-be-string/integer.yamlld
References
(1) (2)
Requirement
must
Expect Error Code
mapping-key-error
Test cir-mapping-key-2-negative Mapping with an object key.
ID
#cir-mapping-key-2-negative
Type
jld:NegativeEvaluationTest,jld:ExpandTest
Name
Mapping with an object key.
Purpose
A mapping key MUST be a string.
Input
cases/mapping-key-must-be-string/object.yamlld
References
(1)
Requirement
must
Expect Error Code
mapping-key-error
Test cir-mapping-key-3-negative Mapping with a list key.
ID
#cir-mapping-key-3-negative
Type
jld:NegativeEvaluationTest,jld:ExpandTest
Name
Mapping with a list key.
Purpose
A mapping key MUST be a string.
Input
cases/mapping-key-must-be-string/list.yamlld
References
(1)
Requirement
must
Expect Error Code
mapping-key-error
Test cir-mapping-key-4-negative Mapping with a float key.
ID
#cir-mapping-key-4-negative
Type
jld:NegativeEvaluationTest,jld:ExpandTest
Name
Mapping with a float key.
Purpose
A mapping key MUST be a string.
Input
cases/mapping-key-must-be-string/float.yamlld
References
(1)
Requirement
must
Expect Error Code
mapping-key-error
Test cir-mapping-key-5-negative Mapping with a null key.
ID
#cir-mapping-key-5-negative
Type
jld:NegativeEvaluationTest,jld:ExpandTest
Name
Mapping with a null key.
Purpose
A mapping key MUST be a string.
Input
cases/mapping-key-must-be-string/null.yamlld
References
(1)
Requirement
must
Expect Error Code
mapping-key-error
Test cir-scalar-core-1-positive tag:yaml.org.2002 scalars
ID
#cir-scalar-core-1-positive
Type
jld:PositiveEvaluationTest,jld:ExpandTest
Name
tag:yaml.org.2002 scalars
Purpose
Otherwise, the conversion result is mapped through the YAML Core Schema.
Input
cases/cir-scalar-core-1-positive-in.yamlld
References
(1) (2)
Requirement
must
Expect
cases/cir-scalar-core-1-positive-out.yamlld
Test cir-scalar-i18n-1-positive language-tagged string with i18n (ignored without extendedYAML)
ID
#cir-scalar-i18n-1-positive
Type
jld:PositiveEvaluationTest,jld:ExpandTest
Name
language-tagged string with i18n (ignored without extendedYAML)
Purpose
Otherwise, the conversion result is mapped through the YAML Core Schema.
Input
cases/cir-scalar-i18n-1-positive-in.yamlld
References
(1)
Requirement
must
Expect
cases/cir-scalar-i18n-1-positive-out.yamlld
Options
extendedYAML
false
Test cir-scalar-other-1-positive Scalars with other node tags (ignored without extendedYAML)
ID
#cir-scalar-other-1-positive
Type
jld:PositiveEvaluationTest,jld:ExpandTest
Name
Scalars with other node tags (ignored without extendedYAML)
Purpose
Otherwise, the conversion result is mapped through the YAML Core Schema.
Input
cases/cir-scalar-other-1-positive-in.yamlld
References
(1) (2)
Requirement
must
Expect
cases/cir-scalar-other-1-positive-out.yamlld
Options
extendedYAML
false
Test cr-comments-1-positive Various comment forms
ID
#cr-comments-1-positive
Type
jld:PositiveEvaluationTest,jld:ExpandTest
Name
Various comment forms
Purpose
Comments are white space.
Input
cases/cr-comments-1-positive-in.yamlld
References
(1)
Requirement
must
Expect
cases/cr-comments-1-positive-out.yamlld
Test cr-utf8-1-positive UTF-8 BOM
ID
#cr-utf8-1-positive
Type
jld:PositiveEvaluationTest,jld:ExpandTest
Name
UTF-8 BOM
Purpose
A YAML-LD document MUST be encoded in UTF-8, to ensure interoperability with [[JSON]].
Input
cases/cr-utf8-1-positive-in.yamlld
References
(1) (2) (3)
Requirement
must
Expect
cases/cr-utf8-1-positive-out.yamlld
Test cr-utf8-2-negative UTF-16 BOM
ID
#cr-utf8-2-negative
Type
jld:NegativeEvaluationTest,jld:ExpandTest
Name
UTF-16 BOM
Purpose
A YAML-LD document MUST be encoded in UTF-8, to ensure interoperability with [[JSON]].
Input
cases/cr-utf8-2-negative-in.yamlld
References
(1) (2) (3) (4) (5) (6)
Requirement
must
Expect Error Code
invalid encoding
Test cr-well-formed-1-positive Load a well-formed document
ID
#cr-well-formed-1-positive
Type
jld:PositiveEvaluationTest,jld:ExpandTest
Name
Load a well-formed document
Purpose
All YAML-LD streams MUST form a well-formed stream.
Input
cases/cr-well-formed-1-positive-in.yamlld
References
(1) (2)
Requirement
must
Expect
cases/cr-well-formed-1-positive-out.yamlld
Test cr-well-formed-2-negative Fail to load a non-well-formed stream
ID
#cr-well-formed-2-negative
Type
jld:NegativeEvaluationTest,jld:ExpandTest
Name
Fail to load a non-well-formed stream
Purpose
All YAML-LD streams MUST form a well-formed stream.
Input
cases/cr-well-formed-2-negative-in.yamlld
References
(1) (2) (3) (4) (5)
Requirement
must
Expect Error Code
loading document failed
Test aa-cycles-1-positive Use of anchors and aliases
ID
#aa-cycles-1-positive
Type
jld:PositiveEvaluationTest,jld:ExpandTest
Name
Use of anchors and aliases
Purpose
A YAML-LD document MAY contain anchored nodes and alias nodes.
Input
cases/aa-cycles-1-positive-in.yamlld
References
(1) (2) (3)
Requirement
may
Expect
cases/aa-cycles-1-positive-out.yamlld
Test aa-cycles-2-negative Anchors and aliases with cycles
ID
#aa-cycles-2-negative
Type
jld:NegativeEvaluationTest,jld:ExpandTest
Name
Anchors and aliases with cycles
Purpose
A YAML-LD document ... MUST NOT contain cycles.
Input
cases/aa-cycles-2-negative-in.yamlld
References
(1) (2) (3) (4) (5)
Requirement
must
Expect Error Code
loading document failed
Test aa-cycles-3-positive Alias node resolution
ID
#aa-cycles-3-positive
Type
jld:PositiveEvaluationTest,jld:ExpandTest
Name
Alias node resolution
Purpose
Alias nodes MUST be resolved by value to their target nodes.
Input
cases/aa-cycles-3-positive-in.yamlld
References
(1) (2)
Requirement
must
Expect
cases/aa-cycles-3-positive-out.yamlld
Test cir-scalar-core-2-positive tag:yaml.org.2002 scalars (RDF)
ID
#cir-scalar-core-2-positive
Type
jld:PositiveEvaluationTest,jld:ToRDFTest
Name
tag:yaml.org.2002 scalars (RDF)
Purpose
If t resolves with a prefix of tag:yaml.org.2002:, the conversion result is mapped through the YAML Core Schema.
Input
cases/cir-scalar-core-2-positive-in.yamlld
References
(1)
Requirement
must
Expect
cases/cir-scalar-core-2-positive-out.nq
Test cir-scalar-other-2-positive Scalars with other node tags (RDF) (ignored without extendedYAML)
ID
#cir-scalar-other-2-positive
Type
jld:PositiveEvaluationTest,jld:ToRDFTest
Name
Scalars with other node tags (RDF) (ignored without extendedYAML)
Purpose
Otherwise, the conversion result is an RDF literal.
Input
cases/cir-scalar-other-2-positive-in.yamlld
References
(1)
Requirement
may
Expect
cases/cir-scalar-other-2-positive-out.nq
Options
extendedYAML
false
Test cr-well-formed-3-negative Undefined alias
ID
#cr-well-formed-3-negative
Type
jld:NegativeEvaluationTest,jld:ExpandTest
Name
Undefined alias
Purpose
All document MUST use node aliases defined by a previous node.
Input
cases/cr-well-formed-3-negative-in.yamlld
References
(1) (2) (3) (4)
Requirement
must
Expect Error Code
loading document failed