Skip to content

Commit 3c94f62

Browse files
committed
Update examples to not downcase language.
1 parent 4595c5e commit 3c94f62

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

Gemfile.lock

Lines changed: 2 additions & 2 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: c1e72171960b31bf417c7af9ecea6ebf75fd0316
3+
revision: b1a47abbdd6db71d2b9ccb42811445fee1626d60
44
branch: develop
55
specs:
66
json-ld (3.0.2)
@@ -74,7 +74,7 @@ GEM
7474
sparql (~> 3.0)
7575
sparql-client (~> 3.0)
7676
mini_portile2 (2.4.0)
77-
multi_json (1.13.1)
77+
multi_json (1.14.0)
7878
net-http-persistent (3.1.0)
7979
connection_pool (~> 2.2)
8080
nokogiri (1.10.4)

common/extract-examples.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
require 'yaml'
1919
require 'cgi'
2020

21+
# Define I18N vocabulary
22+
class RDF::Vocab::I18N < RDF::Vocabulary("https://www.w3.org/ns/i18n#"); end unless RDF::Vocab.const_defined?(:I18N)
23+
2124
# FIXME: This is here until the rdf:JSON is added in RDF.rb
2225
unless RDF::RDFV.properties.include?( RDF.to_uri + 'JSON')
2326
RDF::RDFV.property :JSON, label: "JSON", comment: "JSON datatype"
@@ -170,6 +173,7 @@ def dataset_to_table(repo)
170173

171174
if has_datatype
172175
if statement.object.literal? && statement.object.datatype?
176+
require 'byebug'; byebug unless RDF::Vocabulary.find_term(statement.object.datatype).respond_to?(:pname)
173177
row[positions[:datatype]] = RDF::Vocabulary.find_term(statement.object.datatype).pname
174178
else
175179
row[positions[:datatype]] = "&nbsp;"

index.html

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5204,19 +5204,18 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
52045204
data-result-for="Setting the default base direction of a JSON-LD document-compacted">
52055205
<!--
52065206
[{
5207-
"http://example.org/title": [{"@value": ****"HTML و CSS: تصميم و إنشاء مواقع الويب"****, "@language": "ar-eg", ****"@direction": "rtl"****}],
5208-
"http://example.org/publisher": [{"@value": ****"مكتبة"****, "@language": "ar-eg", ****"@direction": "rtl"****}]
5207+
"http://example.org/title": [{"@value": ****"HTML و CSS: تصميم و إنشاء مواقع الويب"****, "@language": "ar-EG", ****"@direction": "rtl"****}],
5208+
"http://example.org/publisher": [{"@value": ****"مكتبة"****, "@language": "ar-EG", ****"@direction": "rtl"****}]
52095209
}]
52105210
-->
52115211
</pre>
52125212
<table class="statements"
5213-
data-result-for="Setting the default base direction of a JSON-LD document-expanded"
52145213
data-options="rdfDirection=i18n-datatype"
52155214
data-to-rdf>
52165215
<thead><tr><th>Subject</th><th>Property</th><th>Value</th><th>Language</th><th>Direction</th></tr></thead>
52175216
<tbody>
5218-
<tr><td>_:b0</td><td>http://example.org/title</td><td lang="ar-eg" dir="rtl">HTML و CSS: تصميم و إنشاء مواقع الويب</td><td>ar-eg</td><td>rtl</td></tr>
5219-
<tr><td>_:b0</td><td>http://example.org/publisher</td><td lang="ar-eg" dir="rtl">مكتبة</td><td>ar-eg</td><td>rtl</td></tr>
5217+
<tr><td>_:b0</td><td>http://example.org/title</td><td lang="ar-EG" dir="rtl">HTML و CSS: تصميم و إنشاء مواقع الويب</td><td>ar-EG</td><td>rtl</td></tr>
5218+
<tr><td>_:b0</td><td>http://example.org/publisher</td><td lang="ar-EG" dir="rtl">مكتبة</td><td>ar-EG</td><td>rtl</td></tr>
52205219
</tbody>
52215220
</table>
52225221
<pre class="turtle nohighlight"
@@ -5229,8 +5228,8 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
52295228

52305229
# Note that this version drops the base direction.
52315230
[
5232-
ex:title ****"HTML و CSS: تصميم و إنشاء مواقع الويب"****@ar-eg;
5233-
ex:publisher ****"مكتبة"****@ar-eg
5231+
ex:title ****"HTML و CSS: تصميم و إنشاء مواقع الويب"****@ar-EG;
5232+
ex:publisher ****"مكتبة"****@ar-EG
52345233
] .
52355234
-->
52365235
</pre>
@@ -5246,8 +5245,8 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
52465245

52475246
# Note that this version preserves the base direction using a datatype.
52485247
[
5249-
ex:title ****"HTML و CSS: تصميم و إنشاء مواقع الويب"^^i18n:ar-eg_rtl****;
5250-
ex:publisher ****"مكتبة"^^i18n:ar-eg_rtl****
5248+
ex:title ****"HTML و CSS: تصميم و إنشاء مواقع الويب"^^i18n:ar-EG_rtl****;
5249+
ex:publisher ****"مكتبة"^^i18n:ar-EG_rtl****
52515250
] .
52525251
-->
52535252
</pre>
@@ -5264,12 +5263,12 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
52645263
[
52655264
ex:title ****[
52665265
rdf:value "HTML و CSS: تصميم و إنشاء مواقع الويب",
5267-
rdf:language "ar-eg",
5266+
rdf:language "ar-EG",
52685267
rdf:direction "rtl"
52695268
]****;
52705269
ex:publisher ****[
52715270
rdf:value "مكتبة",
5272-
rdf:language "ar-eg",
5271+
rdf:language "ar-EG",
52735272
rdf:direction "rtl"
52745273
]****
52755274
] .
@@ -5341,8 +5340,8 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
53415340
data-to-rdf>
53425341
<thead><tr><th>Subject</th><th>Property</th><th>Value</th><th>Language</th><th>Direction</th></tr></thead>
53435342
<tbody>
5344-
<tr><td>_:b0</td><td>http://example.com/vocab/publisher</td><td lang="ar-eg">مكتبة</td><td>ar-eg</td><td></td></tr>
5345-
<tr><td>_:b0</td><td>http://example.com/vocab/title</td><td lang="ar-eg" dir="rtl">HTML و CSS: تصميم و إنشاء مواقع الويب</td><td>ar-eg</td><td><code>rtl</code></td></tr>
5343+
<tr><td>_:b0</td><td>http://example.com/vocab/publisher</td><td lang="ar-EG">مكتبة</td><td>ar-EG</td><td></td></tr>
5344+
<tr><td>_:b0</td><td>http://example.com/vocab/title</td><td lang="ar-EG" dir="rtl">HTML و CSS: تصميم و إنشاء مواقع الويب</td><td>ar-EG</td><td><code>rtl</code></td></tr>
53465345
<tr><td>_:b0</td><td>http://example.com/vocab/title</td><td lang="en" dir="ltr">HTML and CSS: Design and Build Websites</td><td>en</td><td><code>ltr</code></td></tr>
53475346
</tbody>
53485347
</table>

0 commit comments

Comments
 (0)