Skip to content

Language tag #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/ruby-rdf/json-ld.git
revision: c1e72171960b31bf417c7af9ecea6ebf75fd0316
revision: b1a47abbdd6db71d2b9ccb42811445fee1626d60
branch: develop
specs:
json-ld (3.0.2)
Expand Down Expand Up @@ -74,7 +74,7 @@ GEM
sparql (~> 3.0)
sparql-client (~> 3.0)
mini_portile2 (2.4.0)
multi_json (1.13.1)
multi_json (1.14.0)
net-http-persistent (3.1.0)
connection_pool (~> 2.2)
nokogiri (1.10.4)
Expand Down
3 changes: 3 additions & 0 deletions common/extract-examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
require 'yaml'
require 'cgi'

# Define I18N vocabulary
class RDF::Vocab::I18N < RDF::Vocabulary("https://www.w3.org/ns/i18n#"); end unless RDF::Vocab.const_defined?(:I18N)

# FIXME: This is here until the rdf:JSON is added in RDF.rb
unless RDF::RDFV.properties.include?( RDF.to_uri + 'JSON')
RDF::RDFV.property :JSON, label: "JSON", comment: "JSON datatype"
Expand Down
5 changes: 3 additions & 2 deletions common/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@
consists of a string and a non-empty language tag
as defined by [[BCP47]].
The <dfn data-cite="RDF11-CONCEPTS#dfn-language-tag">language tag</dfn> MUST be well-formed
according to <a data-cite="BCP47#section-2.2.9">section 2.2.9 Classes of Conformance</a> of [[BCP47]],
and is normalized to lowercase.</dd>
according to <a data-cite="BCP47#section-2.2.9">section 2.2.9 Classes of Conformance</a> of [[BCP47]].
<span class="changed note">Processors MAY normalize <a>language tags</a> to lowercase.</span>
</dd>
<dt><dfn data-cite="LINKED-DATA" data-no-xref="" class="preserve">Linked Data</dfn></dt><dd>
A set of documents, each containing a representation of a <a>linked data graph</a> or <a>dataset</a>.</dd>
<dt><dfn data-cite="RDF11-CONCEPTS#dfn-rdf-graph" data-lt="linked data graph|graph" class="preserve">RDF graph</dfn></dt><dd>
Expand Down
25 changes: 12 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5204,19 +5204,18 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
data-result-for="Setting the default base direction of a JSON-LD document-compacted">
<!--
[{
"http://example.org/title": [{"@value": ****"HTML و CSS: تصميم و إنشاء مواقع الويب"****, "@language": "ar-eg", ****"@direction": "rtl"****}],
"http://example.org/publisher": [{"@value": ****"مكتبة"****, "@language": "ar-eg", ****"@direction": "rtl"****}]
"http://example.org/title": [{"@value": ****"HTML و CSS: تصميم و إنشاء مواقع الويب"****, "@language": "ar-EG", ****"@direction": "rtl"****}],
"http://example.org/publisher": [{"@value": ****"مكتبة"****, "@language": "ar-EG", ****"@direction": "rtl"****}]
}]
-->
</pre>
<table class="statements"
data-result-for="Setting the default base direction of a JSON-LD document-expanded"
data-options="rdfDirection=i18n-datatype"
data-to-rdf>
<thead><tr><th>Subject</th><th>Property</th><th>Value</th><th>Language</th><th>Direction</th></tr></thead>
<tbody>
<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>
<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>
<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>
<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>
</tbody>
</table>
<pre class="turtle nohighlight"
Expand All @@ -5229,8 +5228,8 @@ <h3>Using the Document Base for the Default Vocabulary</h3>

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

# Note that this version preserves the base direction using a datatype.
[
ex:title ****"HTML و CSS: تصميم و إنشاء مواقع الويب"^^i18n:ar-eg_rtl****;
ex:publisher ****"مكتبة"^^i18n:ar-eg_rtl****
ex:title ****"HTML و CSS: تصميم و إنشاء مواقع الويب"^^i18n:ar-EG_rtl****;
ex:publisher ****"مكتبة"^^i18n:ar-EG_rtl****
] .
-->
</pre>
Expand All @@ -5264,12 +5263,12 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
[
ex:title ****[
rdf:value "HTML و CSS: تصميم و إنشاء مواقع الويب",
rdf:language "ar-eg",
rdf:language "ar-EG",
rdf:direction "rtl"
]****;
ex:publisher ****[
rdf:value "مكتبة",
rdf:language "ar-eg",
rdf:language "ar-EG",
rdf:direction "rtl"
]****
] .
Expand Down Expand Up @@ -5341,8 +5340,8 @@ <h3>Using the Document Base for the Default Vocabulary</h3>
data-to-rdf>
<thead><tr><th>Subject</th><th>Property</th><th>Value</th><th>Language</th><th>Direction</th></tr></thead>
<tbody>
<tr><td>_:b0</td><td>http://example.com/vocab/publisher</td><td lang="ar-eg">مكتبة</td><td>ar-eg</td><td></td></tr>
<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>
<tr><td>_:b0</td><td>http://example.com/vocab/publisher</td><td lang="ar-EG">مكتبة</td><td>ar-EG</td><td></td></tr>
<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>
<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>
</tbody>
</table>
Expand Down