From aaeeecb70f86801e4a703fe7f33015c23bfe630e Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 9 Jan 2019 13:18:34 -0800 Subject: [PATCH 1/4] Update text on vocabulary mapping and `@vocab` to allow relative IRIs, which are resolved relative to the `base IRI`. This subsumes the previous usage of allowing just the empty string. --- Gemfile.lock | 21 ++++++++++++--------- index.html | 36 +++++++++++++++++++----------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 79fbbd48..c85ec99a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +1,13 @@ GIT remote: git://github.com/ruby-rdf/json-ld.git - revision: a26c3205d006550f85162848a4a2bc3366b39970 + revision: cee48fd9f71fcf51bca0512d4d8ea36d1d292459 branch: develop specs: json-ld (3.0.2) + link_header (~> 0.0, >= 0.0.8) multi_json (~> 1.13) - rdf (~> 3.0, >= 3.0.4) + rack (>= 1.6, < 3.0) + rdf (~> 3.0, >= 3.0.8) GEM remote: https://rubygems.org/ @@ -16,7 +18,7 @@ GEM i18n builder (3.2.3) colorize (0.8.1) - concurrent-ruby (1.1.3) + concurrent-ruby (1.1.4) connection_pool (2.2.2) ebnf (1.1.3) rdf (~> 3.0) @@ -29,7 +31,7 @@ GEM hamster (3.0.0) concurrent-ruby (~> 1.0) htmlentities (4.3.4) - i18n (1.1.1) + i18n (1.5.1) concurrent-ruby (~> 1.0) json-ld-preloaded (3.0.2) json-ld (~> 3.0) @@ -67,17 +69,18 @@ GEM shex (~> 0.5, >= 0.5.2) sparql (~> 3.0) sparql-client (~> 3.0) - mini_portile2 (2.3.0) + mini_portile2 (2.4.0) multi_json (1.13.1) net-http-persistent (3.0.0) connection_pool (~> 2.2) - nokogiri (1.8.5) - mini_portile2 (~> 2.3.0) + nokogiri (1.10.0) + mini_portile2 (~> 2.4.0) nokogumbo (1.5.0) nokogiri public_suffix (3.0.3) + rack (2.0.6) rake (12.3.2) - rdf (3.0.7) + rdf (3.0.9) hamster (~> 3.0) link_header (~> 0.0, >= 0.0.8) rdf-aggregate-repo (2.2.1) @@ -166,4 +169,4 @@ DEPENDENCIES rake BUNDLED WITH - 1.17.1 + 1.17.3 diff --git a/index.html b/index.html index ce8365a0..d0fd1880 100644 --- a/index.html +++ b/index.html @@ -2164,28 +2164,29 @@

Advanced Concepts

-

Using the Document Base as the Default Vocabulary

+

Using the Document Base for the Default Vocabulary

In some cases, vocabulary terms are defined directly within the document - itself, rather than in an external vocabulary. Since - json-ld-1.1, the vocabulary mapping in the active - context can be set to the empty string "", which causes terms which - are expanded relative to the vocabulary, such as the keys of node - objects, to use the base IRI to create absolute - IRIs.

+ itself, rather than in an external vocabulary. + Since json-ld-1.1, the vocabulary mapping in the active context + can be set to the a relative IRI, + which is, itself, resolved against the base IRI. + This causes terms which are expanded relative to the vocabulary, + such as the keys of node objects, + to be based on the base IRI to create absolute IRIs.

   
@@ -9658,7 +9659,7 @@ 

Context Definitions

If the context definition has an @vocab key, its value MUST be a absolute IRI, a compact IRI, a blank node identifier, - an empty string (""), + a relative IRI, a term, or null.

If the context definition has an @version key, @@ -9916,7 +9917,7 @@

Keywords

@vocab
The @vocab keyword MUST NOT be aliased and MAY be used as a key in a context definition or as the value of @type in an expanded term definition. - Its value MUST be a absolute IRI, a compact IRI, a blank node identifier, an empty string (""), a term, or null. + Its value MUST be a absolute IRI, a relative IRI, a compact IRI, a blank node identifier, an empty string (""), a term, or null. This keyword is described further in , and .
@@ -9967,7 +9968,7 @@

Relationship to RDF

instead, consider one of the following mechanisms:

  • a relative IRI, either relative to the document or the vocabulary - (see for a discussion on using the document base as the vocabulary mapping).
  • + (see for a discussion on using the document base as part of the the vocabulary mapping).
  • a URN such as urn:example:1, see [[?URN]], or
  • a "Skolem IRI" as per Replacing Blank Nodes with IRIs @@ -10691,10 +10692,11 @@

    Changes since 1.0 Recommendation of 16 January 2014

    may include "@set", which create maps from the graph identifier or index value similar to index maps and id maps.
  • -
  • The empty string ("") has been added as a possible value for @vocab in - a context. When this is set, vocabulary-relative IRIs, such as the +
  • a relative IRI has been added as a possible value for @vocab in + a context. When this is set, the vocabulary mapping is resolved against + the base IRI, so that vocabulary-relative IRIs, such as the keys of node objects, are expanded or compacted relative - to the base IRI using string concatenation.
  • + to the document base.

Additionally, see .

From 7899824442ccb5fec3feacaa93a187533a36e575 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 12 Jan 2019 12:51:35 -0800 Subject: [PATCH 2/4] Attempt to speed up travis by using system version of nokogiri. --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 83d33cf9..9dfc1956 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ dist: trusty +env: + global: + - NOKOGIRI_USE_SYSTEM_LIBRARIES=true jobs: include: - stage: common From 1388a08a3e2e0c00388d58ccdfa6e064718db5ef Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 12 Jan 2019 14:36:26 -0800 Subject: [PATCH 3/4] Add text and example showing a vocabulary base which is relative to a previous vocabulary base. --- Gemfile.lock | 2 +- index.html | 83 ++++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 75 insertions(+), 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c85ec99a..f8b7428c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/ruby-rdf/json-ld.git - revision: cee48fd9f71fcf51bca0512d4d8ea36d1d292459 + revision: afe7b3b10547b552676d1379a2be4bc34cf83d02 branch: develop specs: json-ld (3.0.2) diff --git a/index.html b/index.html index d0fd1880..bbc682e4 100644 --- a/index.html +++ b/index.html @@ -2046,7 +2046,7 @@

Advanced Concepts

not contain a colon).

-
+

Since json-ld-1.1, + the vocabulary mapping in a local context can be set to the a relative IRI, + which is concatentated to any vocabulary mapping in the active context + (see + for how this applies if there is no vocabulary mapping in the active context).

+ + + +

Using the Document Base for the Default Vocabulary

In some cases, vocabulary terms are defined directly within the document itself, rather than in an external vocabulary. - Since json-ld-1.1, the vocabulary mapping in the active context - can be set to the a relative IRI, - which is, itself, resolved against the base IRI. + Since json-ld-1.1, the vocabulary mapping in a local context + can be set to a relative IRI, + which is, if there is no vocabulary mapping in scope, resolved against the base IRI. This causes terms which are expanded relative to the vocabulary, such as the keys of node objects, to be based on the base IRI to create absolute IRIs.

@@ -9968,7 +10033,7 @@

Relationship to RDF

instead, consider one of the following mechanisms:

  • a relative IRI, either relative to the document or the vocabulary - (see for a discussion on using the document base as part of the the vocabulary mapping).
  • + (see for a discussion on using the document base as part of the the vocabulary mapping).
  • a URN such as urn:example:1, see [[?URN]], or
  • a "Skolem IRI" as per Replacing Blank Nodes with IRIs From e3dbac5edb9202c757a3dbf1664a84d126ef33f0 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 12 Jan 2019 14:45:10 -0800 Subject: [PATCH 4/4] Update changes since CG. --- index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index bbc682e4..2e11227d 100644 --- a/index.html +++ b/index.html @@ -10757,11 +10757,6 @@

    Changes since 1.0 Recommendation of 16 January 2014

    may include "@set", which create maps from the graph identifier or index value similar to index maps and id maps.
  • -
  • a relative IRI has been added as a possible value for @vocab in - a context. When this is set, the vocabulary mapping is resolved against - the base IRI, so that vocabulary-relative IRIs, such as the - keys of node objects, are expanded or compacted relative - to the document base.

Additionally, see .

@@ -10776,6 +10771,11 @@

Changes since JSON-LD Community Group Final Report

with @container set to @set.
  • The use of blank node identifiers to label properties is obsolete, and may be removed in a future version of JSON-LD, as is the support for generalized RDF Datasets.
  • +
  • The default vocabulary can be a relative IRI, which is evaluated + either against an existing default vocabulary, or against the document base. + This allows vocabulary-relative IRIs, such as the + keys of node objects, are expanded or compacted relative + to the document base.