# Test vocabulary for the JSON-LD test suite.
# This vocabulary defines classes an properties which extend
# the test-manifest vocabulary at <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest>.

@prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dc:     <http://purl.org/dc/elements/1.1/> .
@prefix mf:     <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
@prefix xsd:    <http://www.w3.org/2001/XMLSchema#> .
@prefix :       <http://json-ld.org/test-suite/vocab#> .

: rdfs:comment     "Manifest vocabulary for JSON-LD test cases" ;
  dc:creator       "Gregg Kellogg" ;
  dc:publisher     "W3C Linked JSON Community Group" ;
  dc:title         "Test case manifest vocabulary extensions" ;
  dc:description   "Test case manifest vocabulary extensions" ;
  dc:date          "2013-09-23" ;
  dc:identifier    : .

## ---- Test Case Classes ---

:Test a rdfs:Class ;
  rdfs:label "Superclass of all JSON-LD tests" ;
  rdfs:comment """
    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.
  """ .

:PositiveEvaluationTest a rdfs:Class ;
  rdfs:label "Positive Evaluation Test" ;
  rdfs:subClassOf :Test ;
  rdfs:comment """
    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.
  """ .

:NegativeEvaluationTest a rdfs:Class ;
  rdfs:label "Positive Evaluation Test" ;
  rdfs:subClassOf :Test ;
  rdfs:comment """
    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.
  """ .

:PositiveSyntaxTest a rdfs:Class ;
  rdfs:subClassOf :Test ;
  rdfs:label "Positive Syntax Test" ;
  rdfs:comment """
    A type of test specifically for syntax testing.
    Syntax tests are not required to have an associated result, only an action.
  """ .

:NegativeSyntaxTest a rdfs:Class ;
  rdfs:subClassOf :Test ;
  rdfs:label "Negative Syntax Test" ;
  rdfs:comment """
    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.
  """ .

:CompactTest a rdfs:Class ;
  rdfs:label "Compact Evaluation Test" ;
  rdfs:comment """
    A `CompactTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`,
    `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the
    [compact](http://json-ld.org/spec/latest/json-ld-api/index.html#widl-JsonLdProcessor-compact-Promise-any-input-JsonLdContext-context-JsonLdOptions-options)
    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.
  """ .

:ExpandTest a rdfs:Class ;
  rdfs:label "Expand Evaluation Test" ;
  rdfs:comment """
    A `ExpandTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`,
    `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the
    [expand](http://json-ld.org/spec/latest/json-ld-api/index.html#widl-JsonLdProcessor-expand-Promise-any-input-JsonLdOptions-options)
    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.
  """ .

:FlattenTest a rdfs:Class ;
  rdfs:label "Flatten Evaluation Test" ;
  rdfs:comment """
    A `FlattenTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`,
    `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the
    [flatten](http://json-ld.org/spec/latest/json-ld-api/index.html#widl-JsonLdProcessor-flatten-Promise-any-input-JsonLdContext-context-JsonLdOptions-options)
    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.
  """ .

:FrameTest a rdfs:Class ;
  rdfs:label "Frame Evaluation Test" ;
  rdfs:comment """
    A `FrameTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`,
    `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the
    [frame](http://json-ld.org/spec/latest/json-ld-framing/#widl-JsonLdProcessor-frame-void-object-or-object---or-IRI-input-object-or-IRI-frame-JsonLdCallback-callback-JsonLdOptions-options)
    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.
  """ .

:FromRDFTest a rdfs:Class ;
  rdfs:label "From RDF Evaluation Test" ;
  rdfs:comment """
    A `FromRDFTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`,
    `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the
    [RDF to Object Conversion](http://json-ld.org/spec/latest/json-ld-api/index.html#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.
  """ .

:NormalizeTest a rdfs:Class ;
  rdfs:label "Normalization Evaluation Test" ;
  rdfs:comment """
    A `NormalizeTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`,
    `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the
    [Normalization](http://json-ld.org/spec/latest/rdf-graph-normalization/#normalization-algorithm)
    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.
  """ .

:ToRDFTest a rdfs:Class ;
  rdfs:label "To RDF Evaluation Test" ;
  rdfs:comment """
    A `ToRDFTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`,
    `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the
    [Deserialize JSON-LD to RDF algorithm](http://json-ld.org/spec/latest/json-ld-api/index.html#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](http://www.w3.org/TR/rdf11-concepts/#section-dataset-isomorphism).
  """ .

:Option a rdfs:Class ;
  rdfs:label "Processor Options" ;
  rdfs:comment "Options passed to the test runner to affect invocation of the appropriate API method." .

## ---- Property declarations for each test ----

:input a rdf:Property ;
  rdfs:label "input";
  rdfs:comment "Secondary input file" ;
  rdfs:domain	 :Test ;
  rdfs:range   rdfs:Resource .

:option a rdf:Property ;
  rdfs:label "option";
  rdfs:comment "Options affecting processing" ;
  rdfs:domain	 :Test ;
  rdfs:range   :Option .

:base a rdf:Property ;
  rdfs:label "base";
  rdfs:comment """
    The base IRI to use when expanding or compacting the document.
    If set, this overrides the input document's IRI.
  """ ;
  rdfs:domain	 :Test ;
  rdfs:range   rdfs:Resource .

:compactArrays a rdf:Property ;
  rdfs:label "compact arrays";
  rdfs:comment """
    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.
  """ ;
  rdfs:domain	 :Test ;
  rdfs:range   xsd:boolean .

:useDocumentLoader a rdf:Property ;
  rdfs:label "use document loader";
  rdfs:comment """
    Test runners must implement a callback method with a method signature as defined
    in [LoadDocumentCallback](http://json-ld.org/spec/latest/json-ld-api/index.html#idl-def-LoadDocumentCallback).
    Specifying this option requires the test runner to provide this callback to the appropriate
    API method using the `documentLoader` option.
  """ ;
  rdfs:domain	 :Test ;
  rdfs:range   xsd:boolean .

:expandContext a rdf:Property ;
  rdfs:label "expand context";
  rdfs:comment "A context that is used to initialize the active context when expanding a document." ;
  rdfs:domain	 :Test ;
  rdfs:range   rdfs:Resource .

:processingMode a rdf:Property ;
  rdfs:label "processing mode";
  rdfs:comment """
    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.
  """ ;
  rdfs:domain	 :Test ;
  rdfs:range   xsd:string .

:produceGeneralizedRdf a rdf:Property ;
  rdfs:label "produce generalized RDF";
  rdfs:comment "Unless the produce generalized RDF flag is set to true, RDF triples containing a blank node predicate are excluded from output." ;
  rdfs:domain	 :ToRDFTest ;
  rdfs:range   xsd:boolean .

:useNativeTypes a rdf:Property ;
  rdfs:label "use native types";
  rdfs:comment """
    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.
    """ ;
  rdfs:domain	 :FromRDFTest ;
  rdfs:range   xsd:boolean .

:useRdfType a rdf:Property ;
  rdfs:label "use RDF types";
  rdfs:comment """
    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.
    """ ;
  rdfs:domain	 :FromRDFTest ;
  rdfs:range   xsd:boolean .

:contentType a rdf:Property ;
  rdfs:label "content type";
  rdfs:comment """
    The HTTP Content-Type used for the input file, in case it is a non-registered type.
    """ ;
  rdfs:domain	 :Test ;
  rdfs:range   xsd:boolean .

:redirectTo a rdf:Property ;
  rdfs:label "redirect to";
  rdfs:comment """
    The location of a URL for redirection. A request made of the input file must be redirected
    to the designated URL.
    """ ;
  rdfs:domain	 :Test ;
  rdfs:range   xsd:boolean .

:httpStatus a rdf:Property ;
  rdfs:label "HTTP status";
  rdfs:comment """
    The HTTP status code that must be returned when the input file is requested. This
    is typically used along with the `redirectTo` property.
    """ ;
  rdfs:domain	 :Test ;
  rdfs:range   xsd:boolean .

:httpLink a rdf:Property ;
  rdfs:label "HTTP link";
  rdfs:comment """
    An HTTP Link header to be added to the result of requesting the input file.
    """ ;
  rdfs:domain	 :Test ;
  rdfs:range   xsd:boolean .
