From a498c70ac0e6d3c1828c90a2b497eeef28b8b922 Mon Sep 17 00:00:00 2001
From: Anatoly Scherbakov
Date: Mon, 29 May 2023 00:49:46 +0400
Subject: [PATCH] #94 Standardize example a bit
---
spec/data/spec.yaml | 2 +-
spec/index.html | 246 ++++++++++++++++++++++++--------------------
2 files changed, 134 insertions(+), 114 deletions(-)
diff --git a/spec/data/spec.yaml b/spec/data/spec.yaml
index 06abb44..eb5d795 100644
--- a/spec/data/spec.yaml
+++ b/spec/data/spec.yaml
@@ -20,7 +20,7 @@ schema:author:
$id: https://github.com/ioggstream
$type: schema:Person
- - name: Benjamin …
+ - name: Benjamin BigBlueHat
$id: https://github.com/BigBlueHat
$type: schema:Person
diff --git a/spec/index.html b/spec/index.html
index 4f5cab9..e46928c 100644
--- a/spec/index.html
+++ b/spec/index.html
@@ -665,10 +665,15 @@ JSON vs YAML comparison
title="Basic JSON-LD document">
@@ -686,12 +691,14 @@ JSON vs YAML comparison
data-content-type="application/ld+yaml"
title="Basic YAML-LD document">
@@ -758,28 +765,32 @@ Anchors and aliases
The YAML-LD document in the following example
- contains alias nodes for the `{"@id": "countries:ITA"}` object:
+ contains alias nodes for the `{"@id": "countries:US"}` object:
-
@@ -797,31 +808,39 @@ Anchors and aliases
data-content-type="application/ld+json"
title="JSON-LD resulting from YAML with node anchors">
@@ -841,15 +860,15 @@ Streams
data-content-type="application/ld+json"
title="YAML-LD with several documents in one file">
@@ -1042,7 +1061,7 @@ FAQ
title="YAML-LD with comments">
@@ -1181,18 +1200,9 @@ Best Practices
data-content-type="application/ld+yaml"
title="Example YAML-LD document without Convenience Context">
@@ -1214,7 +1224,7 @@ Best Practices
Code of the convenience context . Available as:
- https://yaml-ld.dev/context .
+ https://github.com/json-ld/convenience-context .
Other contexts go in https://json-ld.org/contexts, we should probably continue to use that
Best Practices
data-transform="updateExample"
title="Example YAML-LD document with Convenience Context">
@@ -1335,12 +1338,11 @@ Specify node @type
data-content-type="application/ld+json"
title="YAML-LD with tags"
>
- %TAG !xsd: http://www.w3.org/2001/XMLSchema%23
+ %TAG !xsd! http://www.w3.org/2001/XMLSchema%23
---
- "@context":
- schema: https://schema.org/
- "@id": https://yaml-ld.example
- schema:dateModified: !xsd:date 2023-03-21
+ "@context": https://schema.org/
+ "@id": https://w3c.org/yaml-ld/
+ dateModified: !xsd:date 2023-05-29
@@ -1379,18 +1381,31 @@
Reduce duplication
data-content-type="application/ld+json"
title="YAML-LD: Anchors & Aliases"
>
- "@context":
- schema: https://schema.org/
- "@id": https://yaml-ld.example
- schema:author:
- - schema:name: Gregg Kellogg
- schema:url: https://greggkellogg.net/
- - … TODO: Invent a good example where it would be needed to repeat a fragment ☹
+ "@context":
+ "@import": https://schema.org/
+ country: https://publication.europa.eu/resource/authority/country/
+
+ "@included":
+ - &US
+ "@id": country:US
+ - "@id": https://www.w3.org/community/json-ld
+ "@type": Organization
+ member:
+ - "@id": https://github.com/gkellogg
+ "@type": Person
+ name: Gregg Kellogg
+ country: *US
+ - "@id": https://github.com/BigBlueHat
+ "@type": Person
+ name: Benjamin BigBlueHat
+ country: *US
+
+
Two alternative approaches have been proposed to implement the Extended profile:
@@ -1849,6 +1864,8 @@ Conversion to YAML
they not change the meaning of the encoded scalars.
+
+
Conversion to YAML
%YAML 1.2
%TAG !xsd! http://www.w3.org/2001/XMLSchema%23
---
- "@context":
- "@vocab": http://xmlns.com/foaf/0.1/
+ "@context": https://schema.org/
+ "@id": https://github.com/gkellogg
+ "@type": Person
name: !xsd!string Gregg Kellogg
- homepage: https://greggkellogg.net/
- depiction: http://www.gravatar.com/avatar/42f948####...####
- date: !xsd!date "2022-08-08"
+ birthDate: !xsd!date 1970-01-01
-->
@@ -2506,12 +2522,14 @@ YAML !tags
→ @type
declarations
data-content-type="application/ld+json"
title="Extended YAML-LD with tags"
>
- %TAG !xsd: http://www.w3.org/2001/XMLSchema%23
- ---
- "@context":
- schema: https://schema.org/
- "@id": https://yaml-ld.example
- schema:dateModified: !xsd:date 2023-03-21
+ %YAML 1.2
+ %TAG !xsd! http://www.w3.org/2001/XMLSchema%23
+ ---
+ "@context": https://schema.org/
+ "@id": https://github.com/gkellogg
+ "@type": Person
+ name: !xsd!string Gregg Kellogg
+ birthDate: !xsd!date 1970-01-01
@@ -2523,12 +2541,14 @@
YAML !tags
→ @type
declarations
title="Basic YAML-LD"
>
"@context":
- schema: https://schema.org/
- xsd: http://www.w3.org/2001/XMLSchema#
- "@id": https://yaml-ld.example
- schema:dateModified:
+ - "@import": https://schema.org
+ - xsd: "http://www.w3.org/2001/XMLSchema#"
+ "@id": https://github.com/gkellogg
+ "@type": Person
+ name: Gregg Kellogg
+ birthDate:
+ "@value": 1970-01-01
"@type": xsd:date
- "@value": "2023-03-21"