From ecb0469dac9fd4e8ff76dd0cb8885ef7849aa9d1 Mon Sep 17 00:00:00 2001
From: Gregg Kellogg JSON-LD mostly uses the JSON syntax [[RFC8259]] along with
- various micro-syntaxes based on XML Schema datatypes [[XMLSCHEMA11-2]].
- However, it has become increasingly common to include JSON within
- a script element
- within an HTML document [[HTML]],
- as described in .
- As not all processors operate in an environment which can include HTML,
- this specification describes various categories of JSON-LD processors. A pure JSON Processor only requires the use of a
- JSON processor and is restricted to processing documents retrieved
- with a JSON content type (e.g., A full Processor is capable of processing JSON-LD embedded in HTML,
- in addition to the capabilities of a pure JSON Processor. In addition to the normatively defined processor levels, an additional processor
- level is defined for reference. A event-based JSON Processor processes a stream of characters
- expecting an event after each syntactic element is encountered.
- Such processors are sensitive to the order of the members of JSON objects,
- which can have a performance impact if the members of JSON objects are encountered in an unexpected order.
- An event-based JSON Processor may process JSON-LD embedded in HTML. An event-based JSON Processor
- may be sensitive to processing certain keywords in order, including
- This section describes features required of a full Processor. The algorithm extracts the text content a
- JSON-LD script element into a map or array of maps.
- A JSON-LD script element is a script element
- within an HTML [[HTML]] document with the type attribute set to
- The algorithm takes a single required input variable: source,
- the textContent of an HTML script element.RDF Serialization/Deserialization
-
- Processor Levels
-
-
-
- application/ld+json
or other JSON type).Additional Processor Levels
-
- @context
, @id
, and @type
.Data Round Tripping
HTML Content Algorithms
- Extract Script Content Algorithm
-
- application/ld+json
.
-
- The Application Programming Interface
@@ -5817,9 +5748,6 @@ LoadDocumentCallback
it MUST be added as a profile on application/ld+json
.
Processors MAY include other media types using a +json
suffix as defined in [[RFC6839]].
A full Processor MUST include text/html
at any preference level,
- unless requestProfile is `http://www.w3.org/ns/json-ld#context`.
303
"See Other" redirects
@@ -5831,7 +5759,7 @@ href
relative to the previous url
and restart the algorithm from step 2,
ensuring that documentUrl is set to the original url.application/json
+ application/json
or any media type with a +json
suffix as defined in [[RFC6839]]
except application/ld+json
,
and the response has an HTTP Link Header [[RFC8288]] using the http://www.w3.org/ns/json-ld#context
link relation,
@@ -5843,74 +5771,9 @@ The HTTP Link Header is ignored for documents served as application/ld+json
or text/html
.
text/html
:
- If no such element is found, - or the located element is not a JSON-LD script element, - the promise is rejected with a JsonLdError whose code is set to loading document failed - and processing is terminated.
-application/ld+json
along with the value of the
- profile option, if found.false
,
- set source to the textContent
- of the first JSON-LD script element in document.
- If no such element is found, - or the located element is not a JSON-LD script element, - the promise is rejected with a JsonLdError whose code is set to loading document failed - and processing is terminated.
false
,
- the promise is rejected with a JsonLdError whose code is set to loading document failed
- and processing is terminated.true
.
- Set document to a new empty array.
- For each JSON-LD script element in input:
- application/json
,
application/ld+json
,
- text/html
,
nor any other media type using a
+json
suffix as defined in [[RFC6839]].
Reject the promise passing a loading document failed error.This section describes features available + with a documentLoader supporting HTML script extraction.
+Implementations of a documentLoader MAY support extracting JSON-LD from + script elements contained within an HTML [[HTML]] document. + This section describes the normative behavior of such processors. + Such a processor supports HTML script extraction.
+ +This sections describe an extension to the algorithm specified + in LoadDocumentCallback to support extracting JSON-LD from HTML.
+ +Step 2 is updated to add the following: A processor supporting HTML script extraction MUST include text/html
at any preference level,
+ unless requestProfile is `http://www.w3.org/ns/json-ld#context`.
After step 5, add the following processing step:
+ Otherwise, if the retrieved resource's Content-Type is text/html
:
If no such element is found, + or the located element is not a JSON-LD script element, + the promise is rejected with a JsonLdError whose code is set to loading document failed + and processing is terminated.
+application/ld+json
along with the value of the
+ profile option, if found.false
,
+ set source to the textContent
+ of the first JSON-LD script element in document.
+ If no such element is found, + or the located element is not a JSON-LD script element, + the promise is rejected with a JsonLdError whose code is set to loading document failed + and processing is terminated.
false
,
+ the promise is rejected with a JsonLdError whose code is set to loading document failed
+ and processing is terminated.true
.
+ Set document to a new empty array.
+ For each JSON-LD script element in input:
+ The algorithm extracts the text content a
+ JSON-LD script element into a map or array of maps.
+ A JSON-LD script element is a script element
+ within an HTML [[HTML]] document with the type attribute set to
+ application/ld+json
.
The algorithm takes a single required input variable: source, + the textContent of an HTML script element.
+ +A FromRDFTest
modifies either a PositiveEvaluationTest
, NegativeEvaluationTest
, PositiveSyntaxTest
or NegativeSyntaxTest
.
An HtmlTest
modifies either a PositiveEvaluationTest
or NegativeEvaluationTest
indicating that the source is of type text/html, which requires optional HTML script extraction support.
An HttpTest
modifies either a PositiveEvaluationTest
or NegativeEvaluationTest
.
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.
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.
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. See the README for more details on running tests.
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. See the README for more details on running tests.
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.
A type of test specifically for syntax testing. Syntax tests are not required to have an associated result, only an action.
@@ -359,10 +369,10 @@A context that is used to initialize the active context when expanding a document.
A frame that is used for transforming the input document.
+Secondary input file
Secondary input file
+A frame that is used for transforming the input document.
Options affecting processing
diff --git a/tests/vocab.jsonld b/tests/vocab.jsonld index 425496c5..3bab6132 100644 --- a/tests/vocab.jsonld +++ b/tests/vocab.jsonld @@ -24,247 +24,254 @@ }, "@graph": [ { - "@id": "jld:PositiveEvaluationTest", - "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.", - "@type": "rdfs:Class", - "rdfs:label": "Positive Evaluation Test", - "rdfs:subClassOf": "jld:Test" + "@id": "jld:compactArrays", + "rdfs:label": "compact arrays", + "rdfs:range": "xsd:boolean", + "@type": "rdf:Property", + "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": "jld:Option" }, { - "@id": "jld:Test", - "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.1\", unless specified explicitly as a test option.", + "@id": "jld:Option", + "rdfs:label": "Processor Options", "@type": "rdfs:Class", - "rdfs:label": "Superclass of all JSON-LD tests" + "rdfs:comment": "Options passed to the test runner to affect invocation of the appropriate API method." }, { - "@id": "jld:option", - "rdfs:comment": "Options affecting processing", - "rdfs:range": "jld:Option", - "rdfs:domain": "jld:Test", + "@id": "jld:redirectTo", + "rdfs:label": "redirect to", + "rdfs:range": "xsd:boolean", "@type": "rdf:Property", - "rdfs:label": "option" + "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": "jld:Option" }, { - "@id": "jld:Option", - "rdfs:comment": "Options passed to the test runner to affect invocation of the appropriate API method.", + "@id": "jld:NegativeSyntaxTest", + "rdfs:label": "Negative Syntax Test", "@type": "rdfs:Class", - "rdfs:label": "Processor Options" + "rdfs:subClassOf": "jld: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." }, { - "@id": "jld:CompactTest", - "rdfs:comment": "A `CompactTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`.", + "@id": "jld:Test", + "rdfs:label": "Superclass of all JSON-LD tests", "@type": "rdfs:Class", - "rdfs:subClassOf": "jld:Test", - "rdfs:label": "Compact Evaluation Test" + "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.1\", unless specified explicitly as a test option." }, { - "@id": "https://w3c.github.io/json-ld-api/tests/vocab#", - "rdfs:comment": "Manifest vocabulary for JSON-LD test cases", - "dc11:title": "Test case manifest vocabulary extensions", - "dc11:creator": "Gregg Kellogg", - "dc11:publisher": "W3C Linked JSON Community Group", - "dc11:description": "Test case manifest vocabulary extensions", - "dc11:identifier": "https://w3c.github.io/json-ld-api/tests/vocab#", - "dc11:date": "2013-09-23" + "@id": "jld:useNativeTypes", + "rdfs:label": "use native types", + "rdfs:range": "xsd:boolean", + "@type": "rdf:Property", + "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": "jld:Option" }, { - "@id": "jld:NegativeEvaluationTest", - "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. See the [README](https://w3c.github.io/json-ld-api/tests/) for more details on running tests.", + "@id": "jld:context", + "rdfs:label": "context", + "rdfs:range": "rdfs:Resource", + "@type": "rdf:Property", + "rdfs:comment": "A context that is used for transforming the input document.", + "rdfs:domain": "jld:Test" + }, + { + "@id": "jld:FromRDFTest", + "rdfs:label": "From RDF Evaluation Test", "@type": "rdfs:Class", - "rdfs:label": "Positive Evaluation Test", - "rdfs:subClassOf": "jld:Test" + "rdfs:subClassOf": "jld:Test", + "rdfs:comment": "A `FromRDFTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`." + }, + { + "@id": "jld:httpStatus", + "rdfs:label": "HTTP status", + "rdfs:range": "xsd:boolean", + "@type": "rdf:Property", + "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": "jld:Option" }, { "@id": "jld:useRdfType", - "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:label": "use RDF types", "rdfs:range": "xsd:boolean", - "rdfs:domain": "jld:Option", "@type": "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": "jld:Option" }, { - "@id": "jld:ExpandTest", - "rdfs:comment": "A `ExpandTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`.", + "@id": "jld:NegativeEvaluationTest", + "rdfs:label": "Positive Evaluation Test", "@type": "rdfs:Class", "rdfs:subClassOf": "jld:Test", - "rdfs:label": "Expand Evaluation 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. See the [README](https://w3c.github.io/json-ld-api/tests/) for more details on running tests." }, { - "@id": "jld:NegativeSyntaxTest", - "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.", + "@id": "jld:HtmlTest", + "rdfs:label": "HTML Evaluation Test", "@type": "rdfs:Class", "rdfs:subClassOf": "jld:Test", - "rdfs:label": "Negative Syntax Test" + "rdfs:comment": "An `HtmlTest` modifies either a `PositiveEvaluationTest` or `NegativeEvaluationTest` indicating that the source is of type text/html, which requires optional _HTML script extraction_ support." }, { - "@id": "jld:compactArrays", - "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.", + "@id": "jld:compactToRelative", + "rdfs:label": "compact to relative", "rdfs:range": "xsd:boolean", - "rdfs:domain": "jld:Option", "@type": "rdf:Property", - "rdfs:label": "compact arrays" + "rdfs:comment": "If set to `false`, the JSON-LD processor will not attempt to compact using document-relative IRIs.", + "rdfs:domain": "jld:Option" }, { - "@id": "jld:HttpTest", - "rdfs:comment": "An `HttpTest` modifies either a `PositiveEvaluationTest` or `NegativeEvaluationTest`.", + "@id": "jld:PositiveSyntaxTest", + "rdfs:label": "Positive Syntax Test", "@type": "rdfs:Class", "rdfs:subClassOf": "jld:Test", - "rdfs:label": "HTTP Evaluation Test" + "rdfs:comment": "A type of test specifically for syntax testing. Syntax tests are not required to have an associated result, only an action." }, { - "@id": "jld:compactToRelative", - "rdfs:comment": "If set to `false`, the JSON-LD processor will not attempt to compact using document-relative IRIs.", - "rdfs:range": "xsd:boolean", - "rdfs:domain": "jld:Option", - "@type": "rdf:Property", - "rdfs:label": "compact to relative" + "@id": "jld:ToRDFTest", + "rdfs:label": "To RDF Evaluation Test", + "@type": "rdfs:Class", + "rdfs:subClassOf": "jld:Test", + "rdfs:comment": "A `ToRDFTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`." }, { - "@id": "jld:httpStatus", - "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:range": "xsd:boolean", - "rdfs:domain": "jld:Option", - "@type": "rdf:Property", - "rdfs:label": "HTTP status" + "@id": "jld:ExpandTest", + "rdfs:label": "Expand Evaluation Test", + "@type": "rdfs:Class", + "rdfs:subClassOf": "jld:Test", + "rdfs:comment": "A `ExpandTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`." }, { - "@id": "jld:FrameTest", - "rdfs:comment": "A `FrameTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`.", + "@id": "jld:HttpTest", + "rdfs:label": "HTTP Evaluation Test", "@type": "rdfs:Class", "rdfs:subClassOf": "jld:Test", - "rdfs:label": "Frame Evaluation Test" + "rdfs:comment": "An `HttpTest` modifies either a `PositiveEvaluationTest` or `NegativeEvaluationTest`." }, { - "@id": "jld:PositiveSyntaxTest", - "rdfs:comment": "A type of test specifically for syntax testing. Syntax tests are not required to have an associated result, only an action.", + "@id": "jld:PositiveEvaluationTest", + "rdfs:label": "Positive Evaluation Test", "@type": "rdfs:Class", "rdfs:subClassOf": "jld:Test", - "rdfs:label": "Positive Syntax 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." }, { - "@id": "jld:base", - "rdfs:comment": "The base IRI to use when expanding or compacting the document. If set, this overrides the input document's IRI.", + "@id": "jld:expandContext", + "rdfs:label": "expand context", "rdfs:range": "rdfs:Resource", - "rdfs:domain": "jld:Option", "@type": "rdf:Property", - "rdfs:label": "base" + "rdfs:comment": "A context that is used to initialize the active context when expanding a document.", + "rdfs:domain": "jld:Option" }, { - "@id": "jld:redirectTo", - "rdfs:comment": "The location of a URL for redirection. A request made of the input file must be redirected to the designated URL.", - "rdfs:range": "xsd:boolean", - "rdfs:domain": "jld:Option", - "@type": "rdf:Property", - "rdfs:label": "redirect to" + "@id": "jld:FrameTest", + "rdfs:label": "Frame Evaluation Test", + "@type": "rdfs:Class", + "rdfs:subClassOf": "jld:Test", + "rdfs:comment": "A `FrameTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`." }, { - "@id": "jld:FlattenTest", - "rdfs:comment": "A `FlattenTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`.", + "@id": "jld:CompactTest", + "rdfs:label": "Compact Evaluation Test", "@type": "rdfs:Class", "rdfs:subClassOf": "jld:Test", - "rdfs:label": "Flatten Evaluation Test" + "rdfs:comment": "A `CompactTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`." }, { - "@id": "jld:expandContext", - "rdfs:comment": "A context that is used to initialize the active context when expanding a document.", + "@id": "https://w3c.github.io/json-ld-api/tests/vocab#", + "dc11:description": "Test case manifest vocabulary extensions", + "dc11:identifier": "https://w3c.github.io/json-ld-api/tests/vocab#", + "dc11:title": "Test case manifest vocabulary extensions", + "dc11:creator": "Gregg Kellogg", + "dc11:date": "2013-09-23", + "rdfs:comment": "Manifest vocabulary for JSON-LD test cases", + "dc11:publisher": "W3C Linked JSON Community Group" + }, + { + "@id": "jld:input", + "rdfs:label": "input", "rdfs:range": "rdfs:Resource", - "rdfs:domain": "jld:Option", "@type": "rdf:Property", - "rdfs:label": "expand context" + "rdfs:comment": "Secondary input file", + "rdfs:domain": "jld:Test" }, { "@id": "jld:frame", - "rdfs:comment": "A frame that is used for transforming the input document.", + "rdfs:label": "input", "rdfs:range": "rdfs:Resource", - "rdfs:domain": "jld:Test", "@type": "rdf:Property", - "rdfs:label": "input" + "rdfs:comment": "A frame that is used for transforming the input document.", + "rdfs:domain": "jld:Test" }, { - "@id": "jld:ToRDFTest", - "rdfs:comment": "A `ToRDFTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`.", - "@type": "rdfs:Class", - "rdfs:subClassOf": "jld:Test", - "rdfs:label": "To RDF Evaluation Test" + "@id": "jld:base", + "rdfs:label": "base", + "rdfs:range": "rdfs:Resource", + "@type": "rdf:Property", + "rdfs:comment": "The base IRI to use when expanding or compacting the document. If set, this overrides the input document's IRI.", + "rdfs:domain": "jld:Option" }, { - "@id": "jld:httpAccept", - "rdfs:comment": "An HTTP Accept header.", - "rdfs:range": "xsd:boolean", - "rdfs:domain": "jld:Option", + "@id": "jld:option", + "rdfs:label": "option", + "rdfs:range": "jld:Option", "@type": "rdf:Property", - "rdfs:label": "HTTP Accept" + "rdfs:comment": "Options affecting processing", + "rdfs:domain": "jld:Test" }, { - "@id": "jld:FromRDFTest", - "rdfs:comment": "A `FromRDFTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`.", + "@id": "jld:FlattenTest", + "rdfs:label": "Flatten Evaluation Test", "@type": "rdfs:Class", "rdfs:subClassOf": "jld:Test", - "rdfs:label": "From RDF Evaluation Test" + "rdfs:comment": "A `FlattenTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`." }, { - "@id": "jld:useNativeTypes", - "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:range": "xsd:boolean", - "rdfs:domain": "jld:Option", - "@type": "rdf:Property", - "rdfs:label": "use native types" - }, - { - "@id": "jld:context", - "rdfs:comment": "A context that is used for transforming the input document.", - "rdfs:range": "rdfs:Resource", - "rdfs:domain": "jld:Test", - "@type": "rdf:Property", - "rdfs:label": "context" - }, - { - "@id": "jld:contentType", - "rdfs:comment": "The HTTP Content-Type used for the input file, in case it is a non-registered type.", - "rdfs:range": "xsd:boolean", - "rdfs:domain": "jld:Option", + "@id": "jld:specVersion", + "rdfs:label": "spec version", + "rdfs:range": "xsd:string", "@type": "rdf:Property", - "rdfs:label": "content type" + "rdfs:comment": "Indicates the JSON-LD version to which the test applies, rather than the specific processing mode. Values are \"json-ld-1.0\", and \"json-ld-1.1\". If not set, the test is presumed to be valid for all versions of JSON-LD. In cases where results differ between spec versions for the same test, the test will have both a \"1.0\" and \"1.1\" version, for example.", + "rdfs:domain": "jld:Option" }, { "@id": "jld:produceGeneralizedRdf", - "rdfs:comment": "Unless the produce generalized RDF flag is set to true, RDF triples containing a blank node predicate are excluded from output.", + "rdfs:label": "produce generalized RDF", "rdfs:range": "xsd:boolean", - "rdfs:domain": "jld:Option", "@type": "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": "jld:Option" }, { - "@id": "jld:specVersion", - "rdfs:comment": "Indicates the JSON-LD version to which the test applies, rather than the specific processing mode. Values are \"json-ld-1.0\", and \"json-ld-1.1\". If not set, the test is presumed to be valid for all versions of JSON-LD. In cases where results differ between spec versions for the same test, the test will have both a \"1.0\" and \"1.1\" version, for example.", + "@id": "jld:processingMode", + "rdfs:label": "processing mode", "rdfs:range": "xsd:string", - "rdfs:domain": "jld:Option", "@type": "rdf:Property", - "rdfs:label": "spec version" + "rdfs:comment": "If set to \"json-ld-1.1\", 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": "jld:Option" }, { - "@id": "jld:input", - "rdfs:comment": "Secondary input file", - "rdfs:range": "rdfs:Resource", - "rdfs:domain": "jld:Test", + "@id": "jld:httpLink", + "rdfs:label": "HTTP link", + "rdfs:range": "xsd:boolean", "@type": "rdf:Property", - "rdfs:label": "input" + "rdfs:comment": "An HTTP Link header to be added to the result of requesting the input file.", + "rdfs:domain": "jld:Option" }, { - "@id": "jld:httpLink", - "rdfs:comment": "An HTTP Link header to be added to the result of requesting the input file.", + "@id": "jld:contentType", + "rdfs:label": "content type", "rdfs:range": "xsd:boolean", - "rdfs:domain": "jld:Option", "@type": "rdf:Property", - "rdfs:label": "HTTP link" + "rdfs:comment": "The HTTP Content-Type used for the input file, in case it is a non-registered type.", + "rdfs:domain": "jld:Option" }, { - "@id": "jld:processingMode", - "rdfs:comment": "If set to \"json-ld-1.1\", 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:range": "xsd:string", - "rdfs:domain": "jld:Option", + "@id": "jld:httpAccept", + "rdfs:label": "HTTP Accept", + "rdfs:range": "xsd:boolean", "@type": "rdf:Property", - "rdfs:label": "processing mode" + "rdfs:comment": "An HTTP Accept header.", + "rdfs:domain": "jld:Option" } ] } \ No newline at end of file From 47b4e4c92badb64c6a08efeb73b362e78a97dd02 Mon Sep 17 00:00:00 2001 From: Gregg KelloggThis section describes features available +
This section describes optional features available with a documentLoader supporting HTML script extraction.
Implementations of a documentLoader MAY support extracting JSON-LD from
script elements contained within an HTML [[HTML]] document.
From ad3ad501b0ba05c6b542611bf1c02e001168b637 Mon Sep 17 00:00:00 2001
From: Gregg Kellogg After step 5, add the following processing step:
Otherwise, if the retrieved resource's Content-Type is HTML Content Algorithms
text/html
:
-