Skip to content

Commit 08c7bb9

Browse files
committed
Minor fix to create term definition where term is a CURIE.
1 parent 62919c7 commit 08c7bb9

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ matrix:
1515
allow_failures:
1616
- rvm: jruby
1717
- rvm: 2.7
18-
#dist: trusty

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ gem 'rdf', git: "https://github.com/ruby-rdf/rdf",
88
group :development do
99
gem 'ebnf', git: "https://github.com/dryruby/ebnf", branch: "develop"
1010
gem 'sxp', git: "https://github.com/dryruby/sxp.rb", branch: "develop"
11-
gem 'linkeddata', git: "https://github.com/ruby-rdf/linkeddata", branch: "develop"
11+
gem 'rdf-aggregate-repo', path: '../rdf-aggregate-repo'
12+
#gem 'linkeddata', git: "https://github.com/ruby-rdf/linkeddata", branch: "develop"
1213
gem 'rack-linkeddata', git: "https://github.com/ruby-rdf/rack-linkeddata", branch: "develop"
1314
gem 'rdf-spec', git: "https://github.com/ruby-rdf/rdf-spec", branch: "develop"
1415
gem 'rdf-isomorphic', git: "https://github.com/ruby-rdf/rdf-isomorphic", branch: "develop"
@@ -17,6 +18,7 @@ group :development do
1718
gem 'rdf-vocab', git: "https://github.com/ruby-rdf/rdf-vocab", branch: "develop"
1819
gem 'rdf-xsd', git: "https://github.com/ruby-rdf/rdf-xsd", branch: "develop"
1920
gem 'sinatra-linkeddata', git: "https://github.com/ruby-rdf/sinatra-linkeddata", branch: "develop"
21+
gem 'sparql', git: "https://github.com/ruby-rdf/sparql", branch: "develop"
2022
gem 'fasterer'
2123
gem 'earl-report'
2224
end

lib/json/ld/context.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,14 @@ def create_term_definition(local_context, term, defined, override_protected: fal
873873
raise JsonLdError::InvalidKeywordAlias, "expected value of @id to not be @context on term #{term.inspect}" if
874874
definition.id == '@context'
875875

876-
if term.match?(/(?::[^:])|\//) && (term_iri = expand_iri(term)) != definition.id
877-
raise JsonLdError::InvalidIRIMapping, "term #{term} expands to #{definition.id}, not #{term_iri}"
876+
if term.match?(/(?::[^:])|\//)
877+
term_iri = expand_iri(term,
878+
vocab: true,
879+
local_context: local_context,
880+
defined: defined.merge(term => true))
881+
if term_iri != definition.id
882+
raise JsonLdError::InvalidIRIMapping, "term #{term} expands to #{definition.id}, not #{term_iri}"
883+
end
878884
end
879885

880886
warn "[DEPRECATION] Blank Node terms deprecated in JSON-LD 1.1." if @options[:validate] && processingMode('json-ld-1.1') && definition.id.to_s.start_with?("_:")

0 commit comments

Comments
 (0)