diff --git a/index.html b/index.html index 15aa8cea..2e38aa08 100644 --- a/index.html +++ b/index.html @@ -929,7 +929,7 @@
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 + a script element within an HTML document [[HTML]], as described in . As not all processors operate in an environment which can include HTML, @@ -1111,33 +1111,10 @@
text/html
:
- type
application/ld+json;profile=http://www.w3.org/ns/json-ld#context
,
- set source to the textContent
- of the first element found with that type.type
application/ld+json
,
- set source to the textContent
- of the first element found with that type.http://www.w3.org/ns/json-ld#context
for profiletrue
:
@graph
member to node and initialize
its value to an empty array.true
,
append n to the @graph
member of node after
removing its usages
member, unless the only
@@ -4898,7 +4875,7 @@ U+0000
through U+001F
- using lowercase hexaddecimal Unicode notation (\uhhhh
) unless in the set
+ using lowercase hexadecimal Unicode notation (\uhhhh
) unless in the set
of predefined JSON control characters U+0008
, U+0009
,
U+000A
, U+000C
or U+000D
which SHOULD be serialized as \b
, \t
, \n
, \f
and \r
respectively.
@@ -5001,7 +4978,7 @@ The algorithm extracts the text content a
JSON-LD script element into a dictionary or array of dictionaries.
A JSON-LD script element is a script element
- within an HTML [[HTML]] document with the type
attribute set to
+ within an HTML [[HTML]] document with the type attribute set to
application/ld+json
.
The algorithm takes a single required input variable: source, @@ -5101,7 +5078,7 @@
text/html
,
- and the processor is a pure JSON Processor
- reject the promise passing a loading document failed error.application/json
,
- application/ld+json
,
- nor any other media type using a
- +json
suffix as defined in [[RFC6839]],
- reject the promise passing a loading document failed error.null
.
If set, the base option from options overrides the base IRI.@context
member,
pass that member's value instead.http://www.w3.org/ns/json-ld#context
link relation
- and a Content-Type of application/json
- or any media type with a +json
suffix as defined in [[RFC6839]]
- except application/ld+json
,
+ application/ld+json
- or text/html
.
- If multiple HTTP Link Headers using the http://www.w3.org/ns/json-ld#context
link relation are found,
- the promise is rejected with a JsonLdError whose code is set to multiple context link headers
- and processing is terminated.text/html
,
- the processor is not a pure JSON Processor
- and the passed input is
- a string representing the IRI of a remote document,
- extract the content of the JSON-LD script element(s) into original input:
- type
application/ld+json
,
- reject promise passing an invalid script element error.
- Set original input to the result of the Extract Script Content algorithm,
- using source.false
,
- locate the first JSON-LD script element in input,
- and set source to its textContent, if found.
- Set original input to the result of the Extract Script Content algorithm,
- using source.
- If no JSON-LD script element is found, set original input to a new empty array.@type
.@type
.
rdf:type
properties to be kept as IRIs in the output, rather than use @type
.The LoadDocumentCallback defines a callback that custom document loaders - have to implement to be used to retrieve remote documents and contexts.
+ have to implement to be used to retrieve remote documents and contexts. + The callback returns a Promise resolving to a RemoteDocument. + On failure, the Promise is rejected with an appropriate error code.All errors result in the Promise being rejected with a JsonLdError - whose code is set to loading document failed - or multiple context link headers - as described in the next section.
+The following algorithm describes the default callback and places + requirements on implementations of the callback.
+ +application/ld+json
+ followed by application/json
.
+
+ If requestProfile is set,
+ 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.
303
"See Other" redirects
+ as discussed in [[?cooluris]]).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,
+ set contextUrl to the associated href
.
+ If multiple HTTP Link Headers using the http://www.w3.org/ns/json-ld#context
link relation are found,
+ the promise is rejected with a JsonLdError whose code is set to multiple context link headers
+ and processing is terminated.
Processors MAY transform document to the internal representation.
+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.profile
parameter,
+ and any contextUrl.A custom LoadDocumentCallback set via the + documentLoader option might be used + to maintain a local cache of well-known context documents or to implement + application-specific URL protocols.
+The LoadDocumentOptions type is used to pass various options + to the LoadDocumentCallback.
+ + + +true
,
+ when extracting JSON-LD script elements from HTML,
+ unless a specific fragment identifier is targeted,
+ extracts all encountered JSON-LD script elements using an array form, if necessary.text/html
,
+ this option determines the profile to use for selecting a JSON-LD script elements.profile
parameter.
+ (See IANA Considerations in [[JSON-LD11]]).profile
parameter
+ retrieved as part of the original contentType.type
attribute.The following is a list of issues open at the time of publication.
-Define a "streaming profile" for JSON-LD to help parse data from a stream, rather than require the entire document to be in memory. Also to generate documents that can be so streamed. This would aid in using JSON-LD as a dataset dump format where there are a very large number of quads.
-What if a @context URL response is HTML? - The HTML-based response has the value of potentially providing documentation for the contained context, but we lack a few things and/or need to clarify others. -
More compact @prefix.
application/ld+json;profile=http://www.w3.org/ns/json-ld#context
,
or application/ld+json
is used as the context for further processing.
This allows a mechanism for documenting the content of a context using HTML.
+