Skip to content

Commit 4ab4b73

Browse files
committed
Split example 46 into separate examples.
Fixes #241.
1 parent cfd32c6 commit 4ab4b73

File tree

2 files changed

+88
-87
lines changed

2 files changed

+88
-87
lines changed

Gemfile.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GIT
22
remote: https://github.com/ruby-rdf/json-ld.git
3-
revision: 172e0c960c9771fa9f963eca55d28fb63bce56b0
3+
revision: adbd407fa4b5783c8a7f7b79653b6e38815ff854
44
branch: develop
55
specs:
66
json-ld (3.0.2)
@@ -14,8 +14,8 @@ GIT
1414
GEM
1515
remote: https://rubygems.org/
1616
specs:
17-
addressable (2.6.0)
18-
public_suffix (>= 2.0.2, < 4.0)
17+
addressable (2.7.0)
18+
public_suffix (>= 2.0.2, < 5.0)
1919
bcp47 (0.3.3)
2020
i18n
2121
builder (3.2.3)
@@ -28,7 +28,7 @@ GEM
2828
sxp (~> 1.0)
2929
equivalent-xml (0.6.0)
3030
nokogiri (>= 1.4.3)
31-
haml (5.1.1)
31+
haml (5.1.2)
3232
temple (>= 0.8.0)
3333
tilt
3434
hamster (3.0.0)
@@ -37,7 +37,7 @@ GEM
3737
i18n (1.6.0)
3838
concurrent-ruby (~> 1.0)
3939
json-canonicalization (0.1.0)
40-
json-ld-preloaded (3.0.3)
40+
json-ld-preloaded (3.0.4)
4141
json-ld (~> 3.0)
4242
multi_json (~> 1.12)
4343
rdf (~> 3.0)
@@ -77,11 +77,11 @@ GEM
7777
multi_json (1.13.1)
7878
net-http-persistent (3.1.0)
7979
connection_pool (~> 2.2)
80-
nokogiri (1.10.3)
80+
nokogiri (1.10.4)
8181
mini_portile2 (~> 2.4.0)
8282
nokogumbo (1.5.0)
8383
nokogiri
84-
public_suffix (3.1.1)
84+
public_suffix (4.0.1)
8585
rack (2.0.7)
8686
rake (12.3.3)
8787
rdf (3.0.12)
@@ -135,7 +135,7 @@ GEM
135135
rdf-turtle (3.0.6)
136136
ebnf (~> 1.1)
137137
rdf (~> 3.0)
138-
rdf-vocab (3.0.8)
138+
rdf-vocab (3.0.10)
139139
rdf (~> 3.0, >= 3.0.11)
140140
rdf-xsd (3.0.1)
141141
rdf (~> 3.0)
@@ -160,8 +160,8 @@ GEM
160160
rdf (~> 3.0)
161161
sxp (1.0.2)
162162
rdf (~> 3.0)
163-
temple (0.8.1)
164-
tilt (2.0.9)
163+
temple (0.8.2)
164+
tilt (2.0.10)
165165

166166
PLATFORMS
167167
ruby

index.html

Lines changed: 78 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -3441,90 +3441,91 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
34413441
types are listed, the order that <a>type-scoped contexts</a> are applied is based on
34423442
lexicographical ordering.</p>
34433443

3444-
<p>For example, consider the following semantically equivalent examples:</p>
3444+
<p>For example, consider the following semantically equivalent examples.
3445+
The first example, shows how properties and types can define their own
3446+
scoped contexts, which are included when expanding.</p>
34453447

3446-
<aside class="example" title="Expansion using embedded and scoped contexts">
3447-
<p>This example, shows how properties and types can define their own
3448-
scoped contexts, which are included when expanding.</p>
3449-
<pre data-transform="updateExample">
3450-
<!--
3451-
{
3452-
"@context": {
3453-
"@vocab": "http://example.com/vocab/"
3454-
"property": {
3455-
"@id": "http://example.com/vocab/property",
3456-
"@context": {
3457-
"term1": "http://example.com/vocab/term1"
3458-
#### ↑ Scoped context for "property" defines term1
3459-
},
3460-
},
3461-
"Type1": {
3462-
"@id": "http://example.com/vocab/Type1",
3463-
"@context": {
3464-
"term3": "http://example.com/vocab/term3"
3465-
#### ↑ Scoped context for "Type1" defines term3
3466-
},
3467-
},
3468-
"Type2": {
3469-
"@id": "http://example.com/vocab/Type2",
3470-
"@context": {
3471-
"term4": "http://example.com/vocab/term4"
3472-
#### ↑ Scoped context for "Type2" defines term4
3473-
},
3474-
},
3475-
},
3448+
<pre class="example" title="Expansion using embedded and scoped contexts" data-transform="updateExample">
3449+
<!--
3450+
{
3451+
"@context": {
3452+
"@version": 1.1,
3453+
"@vocab": "http://example.com/vocab/",
34763454
"property": {
3455+
"@id": "http://example.com/vocab/property",
34773456
"@context": {
3478-
"term2": "http://example.com/vocab/term2"
3479-
#### ↑ Embedded context defines term2
3480-
},
3481-
"@type": ["Type2", "Type1"],
3482-
"term1": "a",
3483-
"term2": "b",
3484-
"term3": "c",
3485-
"term4": "d",
3486-
}
3487-
}
3488-
-->
3489-
</pre>
3490-
3491-
<p>Contexts are processed depending on how they are defined. A <a>property-scoped context</a>
3492-
is processed first, followed by any <a>embedded context</a>,
3493-
followed lastly by the <a>type-scoped contexts</a>, in the appropriate order.
3494-
The previous example is logically equivalent to the following:</p>
3495-
<pre data-transform="updateExample">
3496-
<!--
3497-
{
3498-
"@context": {
3499-
"@vocab": "http://example.com/vocab/"
3500-
"property": "http://example.com/vocab/property",
3501-
"Type1": "http://example.com/vocab/Type1",
3502-
"Type2": "http://example.com/vocab/Type2",
3457+
"term1": "http://example.com/vocab/term1"
3458+
#### ↑ Scoped context for "property" defines term1####
3459+
}
35033460
},
3504-
"property": {
3505-
"@context": [{
3506-
"term1": "http://example.com/vocab/term1"
3507-
#### ↑ Scoped context for "property" defines term1
3508-
}, {
3509-
"term2": "http://example.com/vocab/term2"
3510-
#### ↑ Embedded context defines term2
3511-
}, {
3512-
"term3": "http://example.com/vocab/term3"
3513-
#### ↑ Scoped context for "Type1" defines term3
3514-
}, {
3461+
"Type1": {
3462+
"@id": "http://example.com/vocab/Type1",
3463+
"@context": {
3464+
"term3": "http://example.com/vocab/term3"
3465+
#### ↑ Scoped context for "Type1" defines term3####
3466+
}
3467+
},
3468+
"Type2": {
3469+
"@id": "http://example.com/vocab/Type2",
3470+
"@context": {
35153471
"term4": "http://example.com/vocab/term4"
3516-
#### ↑ Scoped context for "Type2" defines term4
3517-
}],
3518-
"@type": ["Type2", "Type1"],
3519-
"term1": "a",
3520-
"term2": "b",
3521-
"term3": "c",
3522-
"term4": "d",
3472+
#### ↑ Scoped context for "Type2" defines term4####
3473+
}
35233474
}
3475+
},
3476+
"property": {
3477+
"@context": {
3478+
"term2": "http://example.com/vocab/term2"
3479+
#### ↑ Embedded context defines term2####
3480+
},
3481+
"@type": ["Type2", "Type1"],
3482+
"term1": "a",
3483+
"term2": "b",
3484+
"term3": "c",
3485+
"term4": "d"
35243486
}
3525-
-->
3526-
</pre>
3527-
</aside>
3487+
}
3488+
-->
3489+
</pre>
3490+
3491+
<p>Contexts are processed depending on how they are defined.
3492+
A <a>property-scoped context</a> is processed first,
3493+
followed by any <a>embedded context</a>,
3494+
followed lastly by the <a>type-scoped contexts</a>,
3495+
in the appropriate order. The previous example is logically equivalent to the following:</p>
3496+
3497+
<pre class="example" title="Expansion using embedded and scoped contexts (embedding equivalent)" data-transform="updateExample">
3498+
<!--
3499+
{
3500+
"@context": {
3501+
"@vocab": "http://example.com/vocab/",
3502+
"property": "http://example.com/vocab/property",
3503+
"Type1": "http://example.com/vocab/Type1",
3504+
"Type2": "http://example.com/vocab/Type2"
3505+
},
3506+
"property": {
3507+
"@context": [{
3508+
"term1": "http://example.com/vocab/term1"
3509+
#### ↑ Previously scoped context for "property" defines term1####
3510+
}, {
3511+
"term2": "http://example.com/vocab/term2"
3512+
#### ↑ Embedded context defines term2####
3513+
}, {
3514+
"term3": "http://example.com/vocab/term3"
3515+
#### ↑ Previously scoped context for "Type1" defines term3####
3516+
}, {
3517+
"term4": "http://example.com/vocab/term4"
3518+
#### ↑ Previously scoped context for "Type2" defines term4####
3519+
}],
3520+
"@type": ["Type2", "Type1"],
3521+
"term1": "a",
3522+
"term2": "b",
3523+
"term3": "c",
3524+
"term4": "d"
3525+
}
3526+
}
3527+
-->
3528+
</pre>
35283529

35293530
<p class="note">If a <a>term</a> defines a <a>scoped context</a>,
35303531
and then that term is later re-defined,

0 commit comments

Comments
 (0)