Skip to content

Commit 4ebd398

Browse files
committed
Add documentation for @type having @container: @set.
Fixes #34.
1 parent 45c6cb4 commit 4ebd398

File tree

346 files changed

+371
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

346 files changed

+371
-121
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"@type": {"@container": "@set"}
5+
},
6+
"@type": ["http:/example.org/type"]
7+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"@context": [
3+
"http://schema.org/",
4+
{"@base": "http://example.com/"}
5+
],
6+
"@graph": [{
7+
"@id": "people/alice",
8+
"gender": [
9+
{"@value": "weiblich", "@language": "de"},
10+
{"@value": "female", "@language": "en"}
11+
],
12+
"knows": {"@id": "people/bob"},
13+
"name": "Alice"
14+
}, {
15+
"@id": "graphs/1",
16+
"@graph": {
17+
"@id": "people/alice",
18+
"parent": {
19+
"@id": "people/bob",
20+
"name": "Bob"
21+
}
22+
}
23+
}, {
24+
"@id": "graphs/2",
25+
"@graph": {
26+
"@id": "people/bob",
27+
"sibling": {
28+
"name": "Mary",
29+
"sibling": {"@id": "people/bob"}
30+
}
31+
}
32+
}]
33+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[{
2+
"@id": "http://example.com/people/alice",
3+
"http://schema.org/name": [{"@value": "Alice"}],
4+
"http://schema.org/gender": [
5+
{"@value": "weiblich","@language": "de"},
6+
{"@value": "female","@language": "en"}
7+
],
8+
"http://schema.org/knows": [
9+
{"@id": "http://example.com/people/bob"}
10+
]
11+
}, {
12+
"@id": "http://example.com/graphs/1",
13+
"@graph": [{
14+
"@id": "http://example.com/people/alice",
15+
"http://schema.org/parent": [{
16+
"@id": "http://example.com/people/bob",
17+
"http://schema.org/name": [{"@value": "Bob"}]
18+
}]
19+
}]
20+
}, {
21+
"@id": "http://example.com/graphs/2",
22+
"@graph": [{
23+
"@id": "http://example.com/people/bob",
24+
"http://schema.org/sibling": [{
25+
"http://schema.org/name": [{"@value": "Mary"}],
26+
"http://schema.org/sibling": [
27+
{"@id": "http://example.com/people/bob"}
28+
]
29+
}]
30+
}]
31+
}]
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<table class="statements" data-result-for="Linked Data Dataset-expanded" data-to-rdf>
2+
<thead><tr>
3+
<th>Graph</th>
4+
<th>Subject</th>
5+
<th>Property</th>
6+
<th>Value</th>
7+
<th>Language</th>
8+
</tr></thead>
9+
<tbody>
10+
<tr>
11+
<td> </td>
12+
<td>http://example.com/people/alice</td>
13+
<td>schema:name</td>
14+
<td>Alice</td>
15+
<td></td>
16+
</tr>
17+
<tr>
18+
<td> </td>
19+
<td>http://example.com/people/alice</td>
20+
<td>schema:gender</td>
21+
<td>weiblich</td>
22+
<td>de</td>
23+
</tr>
24+
<tr>
25+
<td> </td>
26+
<td>http://example.com/people/alice</td>
27+
<td>schema:gender</td>
28+
<td>female</td>
29+
<td>en</td>
30+
</tr>
31+
<tr>
32+
<td> </td>
33+
<td>http://example.com/people/alice</td>
34+
<td>schema:knows</td>
35+
<td>http://example.com/people/bob</td>
36+
<td></td>
37+
</tr>
38+
<tr>
39+
<td>http://example.com/graphs/1</td>
40+
<td>http://example.com/people/bob</td>
41+
<td>schema:name</td>
42+
<td>Bob</td>
43+
<td></td>
44+
</tr>
45+
<tr>
46+
<td>http://example.com/graphs/1</td>
47+
<td>http://example.com/people/alice</td>
48+
<td>schema:parent</td>
49+
<td>http://example.com/people/bob</td>
50+
<td></td>
51+
</tr>
52+
<tr>
53+
<td>http://example.com/graphs/2</td>
54+
<td>http://example.com/people/bob</td>
55+
<td>schema:sibling</td>
56+
<td>_:b0</td>
57+
<td></td>
58+
</tr>
59+
<tr>
60+
<td>http://example.com/graphs/2</td>
61+
<td>_:b0</td>
62+
<td>schema:name</td>
63+
<td>Mary</td>
64+
<td></td>
65+
</tr>
66+
<tr>
67+
<td>http://example.com/graphs/2</td>
68+
<td>_:b0</td>
69+
<td>schema:sibling</td>
70+
<td>http://example.com/people/bob</td>
71+
<td></td>
72+
</tr>
73+
</tbody>
74+
</table>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@prefix schema: <http://schema.org/> .
2+
<http://example.com/people/alice> schema:knows <http://example.com/people/bob>;
3+
schema:name "Alice";
4+
schema:gender "weiblich"@de, "female"@en .
5+
<http://example.com/graphs/1> {
6+
<http://example.com/people/alice> schema:parent <http://example.com/people/bob> .
7+
<http://example.com/people/bob> schema:name "Bob" .
8+
}
9+
<http://example.com/graphs/2> {
10+
<http://example.com/people/bob> schema:sibling [
11+
schema:name "Mary";
12+
schema:sibling <http://example.com/people/bob>
13+
] .
14+
}

index.html

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,6 +2549,27 @@ <h3>Using the Document Base as the Default Vocabulary</h3>
25492549
<a>keywords</a> have been given the aliases
25502550
<strong>url</strong> and <strong>a</strong>, respectively.</p>
25512551

2552+
<p><span class="changed">Other than for <code>@type</code>,</span> properties of
2553+
<a>expanded term definitions</a> where the term is a <a>keyword</a> are be ignored.</p>
2554+
2555+
<p class="changed">When <a>processing mode</a> is set to <code>json-ld-1.1</code>,
2556+
<code>@type</code> may be used with an <a>expanded term definition</a> with <code>@container</code> set
2557+
to <code>@set</code>; no other members may be set within such an <a>expanded term definition</a>.
2558+
This is used by the <a data-cite="JSON-LD11-API#compaction-algorithm">Compaction algorithm</a> to ensure that the values of @type (or an alias)
2559+
are always represented in an <a>array</a>.</p>
2560+
2561+
<pre class="example" data-transform="updateExample" title="Setting @container: @set on @type">
2562+
<!--
2563+
{
2564+
"@context": {
2565+
"@version": 1.1,
2566+
"@type": {"@container": "@set"}
2567+
},
2568+
"@type": ["http:/example.org/type"]
2569+
}
2570+
-->
2571+
</pre>
2572+
25522573
<p>Since keywords cannot be redefined, they can also not be aliased to
25532574
other keywords.</p>
25542575

@@ -9013,7 +9034,7 @@ <h2>Context Definitions</h2>
90139034
<p>A <a>context definition</a> MUST be a <a>dictionary</a> whose
90149035
keys MUST be either <a>terms</a>, <a>compact IRIs</a>, <a>absolute IRIs</a>,
90159036
or one of the <a>keywords</a> <code>@language</code>, <code>@base</code>,
9016-
<code>@vocab</code>, or <code class="changed">@version</code>.</p>
9037+
<code class="changed">@type</code>, <code>@vocab</code>, or <code class="changed">@version</code>.</p>
90179038

90189039
<p>If the <a>context definition</a> has an <code>@language</code> key,
90199040
its value MUST have the <a data-cite="BCP47#section-2.1.1">lexical form</a> described in [[!BCP47]] or be <a>null</a>.</p>
@@ -9022,6 +9043,9 @@ <h2>Context Definitions</h2>
90229043
its value MUST be an <a>absolute IRI</a>, a <a>relative IRI</a>,
90239044
or <a>null</a>.</p>
90249045

9046+
<p class="changed">If the <a>context definition</a> has an <code>@type</code> key,
9047+
its value MUST be a <a>dictionary</a> with the single member <code>@context</code> with value <code>@set</code>.</p>
9048+
90259049
<p>If the <a>context definition</a> has an <code>@vocab</code> key,
90269050
its value MUST be a <a>absolute IRI</a>, a <a>compact IRI</a>,
90279051
a <a>blank node identifier</a>,
@@ -9854,14 +9878,18 @@ <h2>Changes since 1.0 Recommendation of 16 January 2014</h2>
98549878
a context. When this is set, vocabulary-relative IRIs, such as the
98559879
keys of <a>node objects</a>, are expanded or compacted relative
98569880
to the <a>base IRI</a> using string concatenation.</li>
9857-
<li><a>Lists</a> may now have items which are themselves <a>lists</a>.</li>
98589881
</ul>
9882+
<p>Additionally, see <a href="#changes-from-cg" class="sectionRef"></a>.</p>
98599883
</section>
98609884

98619885
<section class="appendix informative" id="changes-from-cg">
98629886
<h2>Changes since JSON-LD Community Group Final Report</h2>
98639887
<ul>
98649888
<li><a>Lists</a> may now have items which are themselves <a>lists</a>.</li>
9889+
<li>Values of <code>@type</code>, or an alais of <code>@type</code>, may now have their <code>@container</code> set to @set
9890+
to ensure that <code>@type</code> members are always represented as an array. This
9891+
also allows a term to be defined for <code>@type</code>, where the value MUST be a <a>dictionary</a>
9892+
with <code>@container</code> set to <code>@set</code>.</li>
98659893
</ul>
98669894
</section>
98679895

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Example 032: Setting @container: @set on @type
2+
---
3+
"@context":
4+
"@version": 1.1
5+
"@type":
6+
"@container": "@set"
7+
"@type":
8+
- http:/example.org/type

yaml/example-032-IRI-expansion-within-a-context.yaml renamed to yaml/example-033-IRI-expansion-within-a-context.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 032: IRI expansion within a context
1+
Example 033: IRI expansion within a context
22
---
33
"@context":
44
xsd: http://www.w3.org/2001/XMLSchema#

yaml/example-033-Using-a-term-to-define-the-IRI-of-another-term-within-a-context.yaml renamed to yaml/example-034-Using-a-term-to-define-the-IRI-of-another-term-within-a-context.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 033: Using a term to define the IRI of another term within a context
1+
Example 034: Using a term to define the IRI of another term within a context
22
---
33
"@context":
44
foaf: http://xmlns.com/foaf/0.1/

yaml/example-034-Using-a-compact-IRI-as-a-term.yaml renamed to yaml/example-035-Using-a-compact-IRI-as-a-term.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 034: Using a compact IRI as a term
1+
Example 035: Using a compact IRI as a term
22
---
33
"@context":
44
foaf: http://xmlns.com/foaf/0.1/

yaml/example-035-Associating-context-definitions-with-absolute-IRIs.yaml renamed to yaml/example-036-Associating-context-definitions-with-absolute-IRIs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 035: Associating context definitions with absolute IRIs
1+
Example 036: Associating context definitions with absolute IRIs
22
---
33
"@context":
44
foaf: http://xmlns.com/foaf/0.1/

yaml/example-037-Defining-an-context-within-a-term-definition-expanded.yaml renamed to yaml/example-038-Defining-an-context-within-a-term-definition-expanded.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 037: Defining an @context within a term definition-expanded
1+
Example 038: Defining an @context within a term definition-expanded
22
---
33
- http://xmlns.com/foaf/0.1/interest:
44
- "@id": https://www.w3.org/TR/json-ld11/

yaml/example-037-Defining-an-context-within-a-term-definition-original.yaml renamed to yaml/example-038-Defining-an-context-within-a-term-definition-original.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 037: Defining an @context within a term definition-original
1+
Example 038: Defining an @context within a term definition-original
22
---
33
"@context":
44
"@version": 1.1

yaml/example-038-Defining-an-context-within-a-term-definition-used-on-type-expanded.yaml renamed to yaml/example-039-Defining-an-context-within-a-term-definition-used-on-type-expanded.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 038: Defining an @context within a term definition used on @type-expanded
1+
Example 039: Defining an @context within a term definition used on @type-expanded
22
---
33
- "@type":
44
- http://schema.org/Person

yaml/example-038-Defining-an-context-within-a-term-definition-used-on-type-original.yaml renamed to yaml/example-039-Defining-an-context-within-a-term-definition-used-on-type-original.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 038: Defining an @context within a term definition used on @type-original
1+
Example 039: Defining an @context within a term definition used on @type-original
22
---
33
"@context":
44
"@version": 1.1

yaml/example-039-Expanded-term-definition-with-type-coercion-expanded.yaml renamed to yaml/example-040-Expanded-term-definition-with-type-coercion-expanded.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 039: Expanded term definition with type coercion-expanded
1+
Example 040: Expanded term definition with type coercion-expanded
22
---
33
- "@id": http://example.com/docs/1
44
http://purl.org/dc/terms/modified:

yaml/example-039-Expanded-term-definition-with-type-coercion-original.yaml renamed to yaml/example-040-Expanded-term-definition-with-type-coercion-original.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 039: Expanded term definition with type coercion-original
1+
Example 040: Expanded term definition with type coercion-original
22
---
33
"@context":
44
modified:

yaml/example-040-Expanded-value-with-type-expanded.yaml renamed to yaml/example-041-Expanded-value-with-type-expanded.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 040: Expanded value with type-expanded
1+
Example 041: Expanded value with type-expanded
22
---
33
- http://purl.org/dc/terms/modified:
44
- "@type": http://www.w3.org/2001/XMLSchema#dateTime

yaml/example-040-Expanded-value-with-type-original.yaml renamed to yaml/example-041-Expanded-value-with-type-original.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 040: Expanded value with type-original
1+
Example 041: Expanded value with type-original
22
---
33
"@context":
44
modified:

yaml/example-041-Example-demonstrating-the-context-sensitivity-for-type.yaml renamed to yaml/example-042-Example-demonstrating-the-context-sensitivity-for-type.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 041: Example demonstrating the context-sensitivity for @type
1+
Example 042: Example demonstrating the context-sensitivity for @type
22
---
33
"@id": http://example.org/posts#TripToWestVirginia
44
"@type": http://schema.org/BlogPosting

yaml/example-043-Expanded-term-definition-with-types-expanded.yaml renamed to yaml/example-044-Expanded-term-definition-with-types-expanded.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 043: Expanded term definition with types-expanded
1+
Example 044: Expanded term definition with types-expanded
22
---
33
- "@id": http://example.com/people#john
44
http://xmlns.com/foaf/0.1/name:

yaml/example-043-Expanded-term-definition-with-types-original.yaml renamed to yaml/example-044-Expanded-term-definition-with-types-original.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 043: Expanded term definition with types-original
1+
Example 044: Expanded term definition with types-original
22
---
33
"@context":
44
xsd: http://www.w3.org/2001/XMLSchema#

yaml/example-044-Term-definitions-using-compact-and-absolute-IRIs-expanded.yaml renamed to yaml/example-045-Term-definitions-using-compact-and-absolute-IRIs-expanded.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 044: Term definitions using compact and absolute IRIs-expanded
1+
Example 045: Term definitions using compact and absolute IRIs-expanded
22
---
33
- http://xmlns.com/foaf/0.1/age:
44
- "@type": http://www.w3.org/2001/XMLSchema#integer

yaml/example-044-Term-definitions-using-compact-and-absolute-IRIs-original.yaml renamed to yaml/example-045-Term-definitions-using-compact-and-absolute-IRIs-original.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 044: Term definitions using compact and absolute IRIs-original
1+
Example 045: Term definitions using compact and absolute IRIs-original
22
---
33
"@context":
44
xsd: http://www.w3.org/2001/XMLSchema#

yaml/example-045-Setting-the-default-language-of-a-JSON-LD-document-expanded.yaml renamed to yaml/example-046-Setting-the-default-language-of-a-JSON-LD-document-expanded.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 045: Setting the default language of a JSON-LD document-expanded
1+
Example 046: Setting the default language of a JSON-LD document-expanded
22
---
33
- http://example.org/name:
44
- "@value": 花澄

yaml/example-045-Setting-the-default-language-of-a-JSON-LD-document-original.yaml renamed to yaml/example-046-Setting-the-default-language-of-a-JSON-LD-document-original.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 045: Setting the default language of a JSON-LD document-original
1+
Example 046: Setting the default language of a JSON-LD document-original
22
---
33
"@context":
44
name: http://example.org/name

yaml/example-046-Clearing-default-language.yaml renamed to yaml/example-047-Clearing-default-language.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 046: Clearing default language
1+
Example 047: Clearing default language
22
---
33
"@context":
44
"@language": ja

yaml/example-047-Expanded-term-definition-with-language.yaml renamed to yaml/example-048-Expanded-term-definition-with-language.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 047: Expanded term definition with language
1+
Example 048: Expanded term definition with language
22
---
33
"@context":
44
ex: http://example.com/vocab/

yaml/example-048-Language-map-expressing-a-property-in-three-languages.yaml renamed to yaml/example-049-Language-map-expressing-a-property-in-three-languages.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 048: Language map expressing a property in three languages
1+
Example 049: Language map expressing a property in three languages
22
---
33
"@context":
44
occupation:

yaml/example-049-Overriding-default-language-using-an-expanded-value.yaml renamed to yaml/example-050-Overriding-default-language-using-an-expanded-value.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 049: Overriding default language using an expanded value
1+
Example 050: Overriding default language using an expanded value
22
---
33
"@context":
44
"@language": ja

yaml/example-050-Removing-language-information-using-an-expanded-value.yaml renamed to yaml/example-051-Removing-language-information-using-an-expanded-value.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 050: Removing language information using an expanded value
1+
Example 051: Removing language information using an expanded value
22
---
33
"@context":
44
"@language": ja

yaml/example-051-Multiple-values-with-no-inherent-order-expanded.yaml renamed to yaml/example-052-Multiple-values-with-no-inherent-order-expanded.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Example 051: Multiple values with no inherent order-expanded
1+
Example 052: Multiple values with no inherent order-expanded
22
---
33
- "@id": http://example.org/people#joebob
44
http://xmlns.com/foaf/0.1/nick:

0 commit comments

Comments
 (0)