@@ -294,15 +314,185 @@ Introduction
These are used within this document as part of a compact IRI
as a shorthand for the resulting IRI, such as dcterms:title
- used to represent http://purl.org/dc/terms/title
.
+ used to represent http://purl.org/dc/terms/title
.
+
+
+ Core Requirements
+
+ A YAML-LD stream is a YAML stream of YAML-LD documents.
+ Note that each document in a stream is independent
+ from the others;
+ each one has its own context, YAML directives,
+ named anchors, and so on.
+
+
+ A YAML-LD document is a [[YAML]] document
+ that can be interpreted as Linked Data [[LINKED-DATA]].
+
+
+ It MUST be encoded in UTF-8, to ensure interoperability with [[JSON]].
+
+
+ Comments in YAML-LD documents
+ are treated as white space.
+ This behavior is consistent with other
+ Linked Data serializations like [[TURTLE]].
+ See Interoperability considerations of [[I-D.ietf-httpapi-yaml-mediatypes]]
+ for more details.
+
+
+ Since named anchors are a serialization detail,
+ such names
+ MUST NOT be used to convey relevant information,
+ MAY be altered when processing the document,
+ and MAY be dropped when interpreting the document as JSON-LD.
+
+
+ A YAML-LD document MAY contain named anchors and alias nodes,
+ but its representation graph MUST NOT contain cycles.
+ When interpreting the document as JSON-LD,
+ alias nodes MUST be resolved by value to their target nodes.
+
+
+ Example: The following YAML-LD document
+ contains alias nodes for the `{"@id": "countries:ITA"}` object:
+
+ ```yaml
+ %YAML 1.2
+ ---
+ "@context":
+ "@vocab": "http://schema.org/"
+ "countries": "http://publication.europa.eu/resource/authority/country/"
+ "@graph":
+ - &ITA
+ "@id": countries:ITA
+ - "@id": http://people.example/Homer
+ name: Homer Simpson
+ nationality: *ITA
+ - "@id": http://people.example/Lisa
+ name: Lisa Simpson
+ nationality: *ITA
+ ```
+
+ While the representation graph (and eventually the in-memory representation
+ of the data structure, e.g., a Python dictionary or a Java hashmap) will still
+ contain references between nodes, the JSON-LD serialization will not.
+
+ ```json
+ {
+ "@context": {
+ "@vocab": "http://schema.org/",
+ "countries": "http://publication.europa.eu/resource/authority/country/"
+ },
+ "@graph": [
+ {
+ "@id": "countries:ITA"
+ },
+ {
+ "@id": "http://people.example/Homer",
+ "full_name": "Homer Simpson",
+ "country": {
+ "@id": "countries:ITA"
+ }
+ },
+ {
+ "@id": "http://people.example/Lisa",
+ "full_name": "Lisa Simpson",
+ "country": {
+ "@id": "countries:ITA"
+ }
+ }
+ ]
+ }
+ ```
+
+
@@ -326,6 +523,9 @@ IANA Considerations
This section has been submitted to the Internet Engineering Steering
Group (IESG) for review, approval, and registration with IANA.
+
+ This section describes the information required to register the above media type according to [[RFC6838]]
+
application/ld+yaml
@@ -379,7 +579,7 @@ application/ld+yaml
Encoding considerations:
- See YAML media type.
+ See YAML media type.
Security considerations:
See .
Interoperability considerations:
@@ -440,6 +640,96 @@ Examples
+
-