Test case manifest vocabulary extensions

Test case manifest vocabulary extensions

Test Case Classes

Compact Evaluation Test

A CompactTest modifies either a PositiveEvaluationTest, NegativeEvaluationTest, PositiveSyntaxTest or NegativeSyntaxTest. Tests are run using the compact method with the input argument from mf:action (aliased as "input" in test manifest) referencing a JSON-LD file in expanded form, context from :input (aliased as "context" in the test manifest) and optional options from :option. The expected results for a PositiveEvaluationTest MUST be compared using JSON object comparison with the processor output.

Expand Evaluation Test

A ExpandTest modifies either a PositiveEvaluationTest, NegativeEvaluationTest, PositiveSyntaxTest or NegativeSyntaxTest. Tests are run using the expand method with the input argument from mf:action (aliased as "input" in test manifest) referencing a JSON-LD file, and optional options from :option. The expected results for a PositiveEvaluationTest MUST be compared using JSON object comparison with the processor output.

Flatten Evaluation Test

A FlattenTest modifies either a PositiveEvaluationTest, NegativeEvaluationTest, PositiveSyntaxTest or NegativeSyntaxTest. Tests are run using the flatten method with the input argument from mf:action (aliased as "input" in test manifest) referencing a JSON-LD file, optional context from :input (aliased as "context" in the test manifest) and optional options from :option. The expected results for a PositiveEvaluationTest MUST be compared using JSON object comparison with the processor output.

Frame Evaluation Test

A FrameTest modifies either a PositiveEvaluationTest, NegativeEvaluationTest, PositiveSyntaxTest or NegativeSyntaxTest. Tests are run using the frame method with the input argument from mf:action (aliased as "input" in test manifest) referencing a JSON-LD file, frame from :input (aliased as "frame" in the test manifest) and optional options from :option. The expected results for a PositiveEvaluationTest MUST be compared using JSON object comparison with the processor output.

From RDF Evaluation Test

A FromRDFTest modifies either a PositiveEvaluationTest, NegativeEvaluationTest, PositiveSyntaxTest or NegativeSyntaxTest. Tests are run using the RDF to Object Conversion algorithm with the input argument from mf:action (aliased as "input" in test manifest) referencing an N-Quads file and optional options from :option. The expected results for a PositiveEvaluationTest MUST be compared using JSON object comparison with the processor output.

Negative Syntax Test

A type of test specifically for syntax testing. Syntax tests are not required to have an associated result, only an action. Negative syntax tests are tests of which the result should be a parser error.

Normalization Evaluation Test

A NormalizeTest modifies either a PositiveEvaluationTest, NegativeEvaluationTest, PositiveSyntaxTest or NegativeSyntaxTest. Tests are run using the Normalization algorithmwith the input argument from mf:action (aliased as "input" in test manifest) referencing an JSON-LD file and optional options from :option. The expected results for a PositiveEvaluationTest are N-Quads serialized in lexographical order and MUST be compared using string comparison.

Positive Evaluation Test

A Negative Evaluation test is successful when the result of processing the input file specified as mf:action (aliased as "input" in test manifest) results in the error identified by the literal value of mf:result (aliased as "expect" in test manifest). The specifics of invoking test, including the interpretation of options (:option) and other input files are specified through another class.

Positive Evaluation Test

A Positive Evaluation test is successful when the result of processing the input file specified as mf:action (aliased as "input" in test manifest) exactly matches the output file specified as mf:result (aliased as "expect" in test manifest) using the comparison defined in another class. The specifics of invoking test, including the interpretation of options (:option) and other input files are specified through another class.

Positive Syntax Test

A type of test specifically for syntax testing. Syntax tests are not required to have an associated result, only an action.

Processor Options

Options passed to the test runner to affect invocation of the appropriate API method.

Superclass of all JSON-LD tests

All JSON-LD tests have an input file referenced using mf:action (aliased as "input" in test manifest). Positive and Negative Evaluation Tests also have a result file referenced using mf:result (aliased as "expect" in test manifest). Other tests may take different inputs and options as defined for each test class. Tests should be run with the processingMode option set to "json-ld-1.0", unless specified explicitly as a test option.

To RDF Evaluation Test

A ToRDFTest modifies either a PositiveEvaluationTest, NegativeEvaluationTest, PositiveSyntaxTest or NegativeSyntaxTest. Tests are run using the Deserialize JSON-LD to RDF algorithm with the input argument from mf:action (aliased as "input" in test manifest) referencing an JSON-LD file and optional options from :option. The expected results for a PositiveEvaluationTest are N-Quads serialized in lexographical order and MUST be compared either string comparison or Dataset as defined in RDF11-CONCEPTS.

Test Case Properties

HTTP link

An HTTP Link header to be added to the result of requesting the input file.

domain: jld:Test
range: xsd:boolean
HTTP status

The HTTP status code that must be returned when the input file is requested. This is typically used along with the redirectTo property.

domain: jld:Test
range: xsd:boolean
base

The base IRI to use when expanding or compacting the document. If set, this overrides the input document's IRI.

domain: jld:Test
range: rdfs:Resource
compact arrays

If set to true, the JSON-LD processor replaces arrays with just one element with that element during compaction. If set to false, all arrays will remain arrays even if they have just one element.

domain: jld:Test
range: xsd:boolean
content type

The HTTP Content-Type used for the input file, in case it is a non-registered type.

domain: jld:Test
range: xsd:boolean
expand context

A context that is used to initialize the active context when expanding a document.

domain: jld:Test
range: rdfs:Resource
input

Secondary input file

domain: jld:Test
range: rdfs:Resource
option

Options affecting processing

domain: jld:Test
range: jld:Option
processing mode

If set to "json-ld-1.0", the JSON-LD processor must produce exactly the same results as the algorithms defined in this specification. If set to another value, the JSON-LD processor is allowed to extend or modify the algorithms defined in this specification to enable application-specific optimizations. The definition of such optimizations is beyond the scope of this specification and thus not defined. Consequently, different implementations may implement different optimizations. Developers must not define modes beginning with json-ld as they are reserved for future versions of this specification.

domain: jld:Test
range: xsd:string
produce generalized RDF

Unless the produce generalized RDF flag is set to true, RDF triples containing a blank node predicate are excluded from output.

domain: jld:ToRDFTest
range: xsd:boolean
redirect to

The location of a URL for redirection. A request made of the input file must be redirected to the designated URL.

domain: jld:Test
range: xsd:boolean
use RDF types

If the use rdf type flag is set to true, statements with an rdf:type predicate will not use @type, but will be transformed as a normal property.

domain: jld:FromRDFTest
range: xsd:boolean
use document loader

Test runners must implement a callback method with a method signature as defined in LoadDocumentCallback. Specifying this option requires the test runner to provide this callback to the appropriate API method using the documentLoader option.

domain: jld:Test
range: xsd:boolean
use native types

If the use native types flag is set to true, RDF literals with a datatype IRI that equal xsd:integer or xsd:double are converted to a JSON numbers and RDF literals with a datatype IRI that equals xsd:boolean are converted to true or false based on their lexical form.

domain: jld:FromRDFTest
range: xsd:boolean