json-ld 3.1.9 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/VERSION +1 -1
- data/lib/json/ld/compact.rb +1 -0
- data/lib/json/ld/context.rb +24 -20
- data/lib/json/ld/expand.rb +13 -13
- data/lib/json/ld/flatten.rb +1 -1
- data/lib/json/ld/format.rb +2 -1
- data/lib/json/ld/html/nokogiri.rb +3 -4
- data/lib/json/ld/reader.rb +1 -1
- data/lib/json/ld/to_rdf.rb +9 -8
- data/lib/json/ld/writer.rb +1 -1
- data/spec/compact_spec.rb +70 -0
- data/spec/context_spec.rb +8 -1
- data/spec/format_spec.rb +5 -1
- data/spec/frame_spec.rb +93 -3
- data/spec/reader_spec.rb +14 -14
- data/spec/spec_helper.rb +8 -2
- metadata +34 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54bba5db6d794f8e36e96200fb75cce4377021ea02c008bcc09b76a4a6ff95a2
|
4
|
+
data.tar.gz: bbd5282a8f1b87d6c44b567a49135f32765f11ada771fffd5e26683481589a19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f13bf980c40f0aa82965c6cd6ee9fe5f8c63d91b5206974630d5bfd84ebf9318902654e8937644ef79aa02f1447c41cc3c3ea4382998b74b275f80ebff00f93
|
7
|
+
data.tar.gz: 36a5a219f342d13249f1c6a3971448b9dea645640f5bc55d21278b831c3c619d584ad2dda27cee94793b5bd3954c5a0e54507ea6c99a328a3da7feb19730058a
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ JSON::LD parses and serializes [JSON-LD][] into [RDF][] and implements expansion
|
|
14
14
|
JSON::LD can now be used to create a _context_ from an RDFS/OWL definition, and optionally include a JSON-LD representation of the ontology itself. This is currently accessed through the `script/gen_context` script.
|
15
15
|
|
16
16
|
* If the [jsonlint][] gem is installed, it will be used when validating an input document.
|
17
|
-
* If available, uses [Nokogiri][]
|
17
|
+
* If available, uses [Nokogiri][] for parsing HTML, falls back to REXML otherwise.
|
18
18
|
* Provisional support for [JSON-LD-star][JSON-LD-star].
|
19
19
|
|
20
20
|
[Implementation Report](https://ruby-rdf.github.io/json-ld/etc/earl.html)
|
@@ -72,7 +72,7 @@ In the first case, the embedded node is not asserted, and only appears as the su
|
|
72
72
|
|
73
73
|
#### Serializing a Graph containing embedded statements
|
74
74
|
|
75
|
-
require 'json
|
75
|
+
require 'json/ld'
|
76
76
|
statement = RDF::Statement(RDF::URI('bob'), RDF::Vocab::FOAF.age, RDF::Literal(23))
|
77
77
|
graph = RDF::Graph.new << [statement, RDF::URI("ex:certainty"), RDF::Literal(0.9)]
|
78
78
|
graph.dump(:jsonld, validate: false, standard_prefixes: true)
|
@@ -565,7 +565,7 @@ The {JSON::LD::ContentNegotiation#call} method looks for a result which includes
|
|
565
565
|
See [Rack::LinkedData][] to do the same thing with an RDF Graph or Dataset as the source, rather than Ruby objects.
|
566
566
|
|
567
567
|
## Documentation
|
568
|
-
Full documentation available on [RubyDoc](https://
|
568
|
+
Full documentation available on [RubyDoc](https://ruby-rdf.github.io/json-ld/file/README.md)
|
569
569
|
|
570
570
|
## Differences from [JSON-LD API][]
|
571
571
|
The specified JSON-LD API is based on a WebIDL definition implementing [Promises][] intended for use within a browser.
|
@@ -588,9 +588,9 @@ Note, the API method signatures differed in versions before 1.0, in that they al
|
|
588
588
|
* {JSON::LD::Writer}
|
589
589
|
|
590
590
|
## Dependencies
|
591
|
-
* [Ruby](https://ruby-lang.org/) (>= 2.
|
592
|
-
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.
|
593
|
-
* [JSON](https://rubygems.org/gems/json) (>= 2.
|
591
|
+
* [Ruby](https://ruby-lang.org/) (>= 2.6)
|
592
|
+
* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.2)
|
593
|
+
* [JSON](https://rubygems.org/gems/json) (>= 2.6)
|
594
594
|
|
595
595
|
## Installation
|
596
596
|
The recommended installation method is via [RubyGems](https://rubygems.org/).
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1
|
1
|
+
3.2.1
|
data/lib/json/ld/compact.rb
CHANGED
@@ -297,6 +297,7 @@ module JSON::LD
|
|
297
297
|
if index_key == '@index'
|
298
298
|
map_key = expanded_item['@index']
|
299
299
|
else
|
300
|
+
index_key = context.expand_iri(index_key, vocab: true)
|
300
301
|
container_key = context.compact_iri(index_key, vocab: true)
|
301
302
|
map_key, *others = Array(compacted_item[container_key])
|
302
303
|
if map_key.is_a?(String)
|
data/lib/json/ld/context.rb
CHANGED
@@ -5,13 +5,6 @@ require 'bigdecimal'
|
|
5
5
|
require 'set'
|
6
6
|
require 'rdf/util/cache'
|
7
7
|
|
8
|
-
begin
|
9
|
-
# Attempt to load this to avoid unnecessary context fetches
|
10
|
-
require 'json-ld-preloaded'
|
11
|
-
rescue LoadError
|
12
|
-
# Silently allow this to fail
|
13
|
-
end
|
14
|
-
|
15
8
|
module JSON::LD
|
16
9
|
class Context
|
17
10
|
include Utils
|
@@ -50,6 +43,13 @@ module JSON::LD
|
|
50
43
|
end
|
51
44
|
end
|
52
45
|
|
46
|
+
begin
|
47
|
+
# Attempt to load this to avoid unnecessary context fetches
|
48
|
+
require 'json/ld/preloaded'
|
49
|
+
rescue LoadError
|
50
|
+
# Silently allow this to fail
|
51
|
+
end
|
52
|
+
|
53
53
|
# The base.
|
54
54
|
#
|
55
55
|
# @return [RDF::URI] Current base IRI, used for expanding relative IRIs.
|
@@ -253,6 +253,7 @@ module JSON::LD
|
|
253
253
|
|
254
254
|
local_context = as_array(local_context)
|
255
255
|
|
256
|
+
log_depth do
|
256
257
|
local_context.each do |context|
|
257
258
|
case context
|
258
259
|
when nil,false
|
@@ -266,22 +267,22 @@ module JSON::LD
|
|
266
267
|
"Attempt to clear a context with protected terms"
|
267
268
|
end
|
268
269
|
when Context
|
269
|
-
|
270
|
+
log_debug("parse") {"context: #{context.inspect}"}
|
270
271
|
result = result.merge(context)
|
271
272
|
when IO, StringIO
|
272
|
-
|
273
|
+
log_debug("parse") {"io: #{context}"}
|
273
274
|
# Load context document, if it is an open file
|
274
275
|
begin
|
275
276
|
ctx = JSON.load(context)
|
276
277
|
raise JSON::LD::JsonLdError::InvalidRemoteContext, "Context missing @context key" if @options[:validate] && ctx['@context'].nil?
|
277
278
|
result = result.parse(ctx["@context"] ? ctx["@context"] : {})
|
278
279
|
rescue JSON::ParserError => e
|
279
|
-
|
280
|
+
log_info("parse") {"Failed to parse @context from remote document at #{context}: #{e.message}"}
|
280
281
|
raise JSON::LD::JsonLdError::InvalidRemoteContext, "Failed to parse remote context at #{context}: #{e.message}" if @options[:validate]
|
281
282
|
self
|
282
283
|
end
|
283
284
|
when String, RDF::URI
|
284
|
-
|
285
|
+
log_debug("parse") {"remote: #{context}, base: #{result.context_base || result.base}"}
|
285
286
|
|
286
287
|
# 3.2.1) Set context to the result of resolving value against the base IRI which is established as specified in section 5.1 Establishing a Base URI of [RFC3986]. Only the basic algorithm in section 5.2 of [RFC3986] is used; neither Syntax-Based Normalization nor Scheme-Based Normalization are performed. Characters additionally allowed in IRI references are treated in the same way that unreserved characters are treated in URI references, per section 6.5 of [RFC3987].
|
287
288
|
context = RDF::URI(result.context_base || base).join(context)
|
@@ -296,11 +297,11 @@ module JSON::LD
|
|
296
297
|
|
297
298
|
cached_context = if PRELOADED[context_canon.to_s]
|
298
299
|
# If we have a cached context, merge it into the current context (result) and use as the new context
|
299
|
-
|
300
|
+
log_debug("parse") {"=> cached_context: #{context_canon.to_s.inspect}"}
|
300
301
|
|
301
302
|
# If this is a Proc, then replace the entry with the result of running the Proc
|
302
303
|
if PRELOADED[context_canon.to_s].respond_to?(:call)
|
303
|
-
|
304
|
+
log_debug("parse") {"=> (call)"}
|
304
305
|
PRELOADED[context_canon.to_s] = PRELOADED[context_canon.to_s].call
|
305
306
|
end
|
306
307
|
PRELOADED[context_canon.to_s]
|
@@ -320,16 +321,17 @@ module JSON::LD
|
|
320
321
|
ctx = Context.new(unfrozen: true, **options).dup
|
321
322
|
ctx.context_base = context.to_s
|
322
323
|
ctx = ctx.parse(remote_doc.document['@context'], remote_contexts: remote_contexts.dup)
|
324
|
+
ctx.context_base = context.to_s # In case it was altered
|
323
325
|
ctx.instance_variable_set(:@base, nil)
|
324
326
|
ctx
|
325
327
|
end
|
326
328
|
rescue JsonLdError::LoadingDocumentFailed => e
|
327
|
-
|
329
|
+
log_info("parse") {"Failed to retrieve @context from remote document at #{context_canon.inspect}: #{e.message}"}
|
328
330
|
raise JsonLdError::LoadingRemoteContextFailed, "#{context}: #{e.message}", e.backtrace
|
329
331
|
rescue JsonLdError
|
330
332
|
raise
|
331
333
|
rescue StandardError => e
|
332
|
-
|
334
|
+
log_info("parse") {"Failed to retrieve @context from remote document at #{context_canon.inspect}: #{e.message}"}
|
333
335
|
raise JsonLdError::LoadingRemoteContextFailed, "#{context}: #{e.message}", e.backtrace
|
334
336
|
end
|
335
337
|
end
|
@@ -406,6 +408,7 @@ module JSON::LD
|
|
406
408
|
raise JsonLdError::InvalidLocalContext, "must be a URL, JSON object or array of same: #{context.inspect}"
|
407
409
|
end
|
408
410
|
end
|
411
|
+
end
|
409
412
|
result
|
410
413
|
end
|
411
414
|
|
@@ -475,7 +478,7 @@ module JSON::LD
|
|
475
478
|
remote_contexts: [],
|
476
479
|
validate_scoped: true)
|
477
480
|
# Expand a string value, unless it matches a keyword
|
478
|
-
|
481
|
+
log_debug("create_term_definition") {"term = #{term.inspect}"}
|
479
482
|
|
480
483
|
# If defined contains the key term, then the associated value must be true, indicating that the term definition has already been created, so return. Otherwise, a cyclical term definition has been detected, which is an error.
|
481
484
|
case defined[term]
|
@@ -646,7 +649,7 @@ module JSON::LD
|
|
646
649
|
# Otherwise, term is an absolute IRI. Set the IRI mapping for definition to term
|
647
650
|
term
|
648
651
|
end
|
649
|
-
|
652
|
+
log_debug("") {"=> #{definition.id}"}
|
650
653
|
elsif term.include?('/')
|
651
654
|
# If term is a relative IRI
|
652
655
|
definition.id = expand_iri(term, vocab: true)
|
@@ -659,7 +662,7 @@ module JSON::LD
|
|
659
662
|
# Otherwise, active context must have a vocabulary mapping, otherwise an invalid value has been detected, which is an error. Set the IRI mapping for definition to the result of concatenating the value associated with the vocabulary mapping and term.
|
660
663
|
raise JsonLdError::InvalidIRIMapping, "relative term definition without vocab: #{term} on term #{term.inspect}" unless vocab
|
661
664
|
definition.id = vocab + term
|
662
|
-
|
665
|
+
log_debug("") {"=> #{definition.id}"}
|
663
666
|
end
|
664
667
|
|
665
668
|
@iri_to_term[definition.id] = term if simple_term && definition.id
|
@@ -699,6 +702,7 @@ module JSON::LD
|
|
699
702
|
when nil then [nil]
|
700
703
|
else value['@context']
|
701
704
|
end
|
705
|
+
log_debug("") {"context: #{definition.context.inspect}"}
|
702
706
|
rescue JsonLdError => e
|
703
707
|
raise JsonLdError::InvalidScopedContext, "Term definition for #{term.inspect} contains illegal value for @context: #{e.message}"
|
704
708
|
end
|
@@ -1684,7 +1688,7 @@ module JSON::LD
|
|
1684
1688
|
ec.default_direction = that.default_direction
|
1685
1689
|
ec.default_language = that.default_language
|
1686
1690
|
ec.previous_context = that.previous_context
|
1687
|
-
ec.processingMode = that.processingMode if that.instance_variable_get(:@
|
1691
|
+
ec.processingMode = that.processingMode if that.instance_variable_get(:@processingMode)
|
1688
1692
|
ec.vocab = that.vocab if that.vocab
|
1689
1693
|
|
1690
1694
|
ec.instance_eval do
|
@@ -1884,7 +1888,7 @@ module JSON::LD
|
|
1884
1888
|
@base_and_parents ||= begin
|
1885
1889
|
u = base
|
1886
1890
|
iri_set = u.to_s.end_with?('/') ? [u.to_s] : []
|
1887
|
-
iri_set << u.to_s while (u = u.parent)
|
1891
|
+
iri_set << u.to_s while (u != './' && u = u.parent)
|
1888
1892
|
iri_set
|
1889
1893
|
end
|
1890
1894
|
b = base.to_s
|
data/lib/json/ld/expand.rb
CHANGED
@@ -88,7 +88,7 @@ module JSON::LD
|
|
88
88
|
|
89
89
|
# If element contains the key @context, set active context to the result of the Context Processing algorithm, passing active context and the value of the @context key as local context.
|
90
90
|
if input.key?('@context')
|
91
|
-
context = context.parse(input
|
91
|
+
context = context.parse(input['@context'], base: @options[:base])
|
92
92
|
log_debug("expand", depth: log_depth.to_i) {"context: #{context.inspect}"}
|
93
93
|
end
|
94
94
|
|
@@ -99,7 +99,7 @@ module JSON::LD
|
|
99
99
|
|
100
100
|
# See if keys mapping to @type have terms with a local context
|
101
101
|
type_key = nil
|
102
|
-
input.keys.sort.
|
102
|
+
(input.keys - %w(@context)).sort.
|
103
103
|
select {|k| context.expand_iri(k, vocab: true, base: @options[:base]) == '@type'}.
|
104
104
|
each do |tk|
|
105
105
|
|
@@ -107,7 +107,7 @@ module JSON::LD
|
|
107
107
|
Array(input[tk]).sort.each do |term|
|
108
108
|
term_context = type_scoped_context.term_definitions[term].context if type_scoped_context.term_definitions[term]
|
109
109
|
unless term_context.nil?
|
110
|
-
log_debug("expand", depth: log_depth.to_i) {"term_context: #{term_context.inspect}"}
|
110
|
+
log_debug("expand", depth: log_depth.to_i) {"term_context[#{term}]: #{term_context.inspect}"}
|
111
111
|
context = context.parse(term_context, base: @options[:base], propagate: false)
|
112
112
|
end
|
113
113
|
end
|
@@ -258,10 +258,10 @@ module JSON::LD
|
|
258
258
|
expanded_property.to_s.start_with?("_:") &&
|
259
259
|
context.processingMode('json-ld-1.1')
|
260
260
|
|
261
|
-
|
261
|
+
log_debug("expand property", depth: log_depth.to_i) {"ap: #{active_property.inspect}, expanded: #{expanded_property.inspect}, value: #{value.inspect}"}
|
262
262
|
|
263
263
|
if expanded_property.nil?
|
264
|
-
|
264
|
+
log_debug(" => ", depth: log_depth.to_i) {"skip nil property"}
|
265
265
|
next
|
266
266
|
end
|
267
267
|
|
@@ -341,7 +341,7 @@ module JSON::LD
|
|
341
341
|
Array(output_object['@included']) + included_result
|
342
342
|
when '@type'
|
343
343
|
# If expanded property is @type and value is neither a string nor an array of strings, an invalid type value error has been detected and processing is aborted. Otherwise, set expanded value to the result of using the IRI Expansion algorithm, passing active context, true for vocab, and true for document relative to expand the value or each of its items.
|
344
|
-
|
344
|
+
log_debug("@type", depth: log_depth.to_i) {"value: #{value.inspect}"}
|
345
345
|
e_type = case value
|
346
346
|
when Array
|
347
347
|
value.map do |v|
|
@@ -516,7 +516,7 @@ module JSON::LD
|
|
516
516
|
|
517
517
|
# If expanded value contains an @reverse member, i.e., properties that are reversed twice, execute for each of its property and item the following steps:
|
518
518
|
if value.key?('@reverse')
|
519
|
-
|
519
|
+
log_debug("@reverse", depth: log_depth.to_i) {"double reverse: #{value.inspect}"}
|
520
520
|
value['@reverse'].each do |property, item|
|
521
521
|
# If result does not have a property member, create one and set its value to an empty array.
|
522
522
|
# Append item to the value of the property member of result.
|
@@ -566,7 +566,7 @@ module JSON::LD
|
|
566
566
|
end
|
567
567
|
|
568
568
|
# Unless expanded value is null, set the expanded property member of result to expanded value.
|
569
|
-
|
569
|
+
log_debug("expand #{expanded_property}", depth: log_depth.to_i) { expanded_value.inspect}
|
570
570
|
output_object[expanded_property] = expanded_value unless expanded_value.nil? && expanded_property == '@value' && input_type != '@json'
|
571
571
|
next
|
572
572
|
end
|
@@ -688,21 +688,21 @@ module JSON::LD
|
|
688
688
|
|
689
689
|
# If expanded value is null, ignore key by continuing to the next key from element.
|
690
690
|
if expanded_value.nil?
|
691
|
-
|
691
|
+
log_debug(" => skip nil value", depth: log_depth.to_i)
|
692
692
|
next
|
693
693
|
end
|
694
|
-
|
694
|
+
log_debug(depth: log_depth.to_i) {" => #{expanded_value.inspect}"}
|
695
695
|
|
696
696
|
# If the container mapping associated to key in active context is @list and expanded value is not already a list object, convert expanded value to a list object by first setting it to an array containing only expanded value if it is not already an array, and then by setting it to a JSON object containing the key-value pair @list-expanded value.
|
697
697
|
if container.first == '@list' && container.length == 1 && !list?(expanded_value)
|
698
|
-
|
698
|
+
log_debug(" => ", depth: log_depth.to_i) { "convert #{expanded_value.inspect} to list"}
|
699
699
|
expanded_value = {'@list' => as_array(expanded_value)}
|
700
700
|
end
|
701
|
-
|
701
|
+
log_debug(depth: log_depth.to_i) {" => #{expanded_value.inspect}"}
|
702
702
|
|
703
703
|
# convert expanded value to @graph if container specifies it
|
704
704
|
if container.first == '@graph' && container.length == 1
|
705
|
-
|
705
|
+
log_debug(" => ", depth: log_depth.to_i) { "convert #{expanded_value.inspect} to list"}
|
706
706
|
expanded_value = as_array(expanded_value).map do |v|
|
707
707
|
{'@graph' => as_array(v)}
|
708
708
|
end
|
data/lib/json/ld/flatten.rb
CHANGED
@@ -202,7 +202,7 @@ module JSON::LD
|
|
202
202
|
# * Deserialize the key into a map, and re-serialize the value of `@id`.
|
203
203
|
# * If the map contains an entry with that value (after re-canonicalizing, as appropriate), and the associated antry has a item which matches the non-`@id` item from the map, the node is used to create an `@annotation` entry within that value.
|
204
204
|
#
|
205
|
-
# @param [Hash{String => Hash}]
|
205
|
+
# @param [Hash{String => Hash}] node_map
|
206
206
|
# @return [Hash{String => Hash}]
|
207
207
|
def create_annotations(node_map)
|
208
208
|
node_map.keys.
|
data/lib/json/ld/format.rb
CHANGED
@@ -23,7 +23,8 @@ module JSON::LD
|
|
23
23
|
class Format < RDF::Format
|
24
24
|
content_type 'application/ld+json',
|
25
25
|
extension: :jsonld,
|
26
|
-
alias: 'application/x-ld+json'
|
26
|
+
alias: 'application/x-ld+json',
|
27
|
+
uri: 'http://www.w3.org/ns/formats/JSON-LD'
|
27
28
|
content_encoding 'utf-8'
|
28
29
|
|
29
30
|
reader { JSON::LD::Reader }
|
@@ -136,11 +136,10 @@ module JSON::LD
|
|
136
136
|
input
|
137
137
|
else
|
138
138
|
begin
|
139
|
-
require 'nokogumbo' unless defined?(::Nokogumbo)
|
140
139
|
input = input.read if input.respond_to?(:read)
|
141
|
-
::Nokogiri::HTML5(input.
|
142
|
-
rescue LoadError
|
143
|
-
::Nokogiri::HTML.parse(input, 'utf-8')
|
140
|
+
::Nokogiri::HTML5(input.force_encoding('utf-8'), max_parse_errors: 1000)
|
141
|
+
rescue LoadError, NoMethodError
|
142
|
+
::Nokogiri::HTML.parse(input, base_uri.to_s, 'utf-8')
|
144
143
|
end
|
145
144
|
end
|
146
145
|
|
data/lib/json/ld/reader.rb
CHANGED
@@ -12,7 +12,7 @@ module JSON::LD
|
|
12
12
|
|
13
13
|
##
|
14
14
|
# JSON-LD Reader options
|
15
|
-
# @see
|
15
|
+
# @see https://ruby-rdf.github.io/rdf/RDF/Reader#options-class_method
|
16
16
|
def self.options
|
17
17
|
super + [
|
18
18
|
RDF::CLI::Option.new(
|
data/lib/json/ld/to_rdf.rb
CHANGED
@@ -11,10 +11,11 @@ module JSON::LD
|
|
11
11
|
##
|
12
12
|
# @param [Hash{String => Object}] item
|
13
13
|
# @param [RDF::Resource] graph_name
|
14
|
+
# @param [Boolean] emitted triples are quoted triples.
|
14
15
|
# @yield statement
|
15
16
|
# @yieldparam [RDF::Statement] statement
|
16
17
|
# @return RDF::Resource the subject of this item
|
17
|
-
def item_to_rdf(item, graph_name: nil, &block)
|
18
|
+
def item_to_rdf(item, graph_name: nil, quoted: false, &block)
|
18
19
|
# Just return value object as Term
|
19
20
|
return unless item
|
20
21
|
|
@@ -82,9 +83,9 @@ module JSON::LD
|
|
82
83
|
when nil then node
|
83
84
|
when String then as_resource(item['@id'])
|
84
85
|
when Object
|
85
|
-
# Embedded statement
|
86
|
+
# Embedded/quoted statement
|
86
87
|
# (No error checking, as this is done in expansion)
|
87
|
-
to_enum(:item_to_rdf, item['@id']).to_a.first
|
88
|
+
to_enum(:item_to_rdf, item['@id'], quoted: true).to_a.first
|
88
89
|
end
|
89
90
|
|
90
91
|
#log_debug("item_to_rdf") {"subject: #{subject.to_ntriples rescue 'malformed rdf'}"}
|
@@ -95,12 +96,12 @@ module JSON::LD
|
|
95
96
|
values.each do |v|
|
96
97
|
object = as_resource(v)
|
97
98
|
#log_debug("item_to_rdf") {"type: #{object.to_ntriples rescue 'malformed rdf'}"}
|
98
|
-
yield RDF::Statement(subject, RDF.type, object, graph_name: graph_name)
|
99
|
+
yield RDF::Statement(subject, RDF.type, object, graph_name: graph_name, quoted: quoted)
|
99
100
|
end
|
100
101
|
when '@graph'
|
101
102
|
values = [values].compact unless values.is_a?(Array)
|
102
103
|
values.each do |nd|
|
103
|
-
item_to_rdf(nd, graph_name: subject, &block)
|
104
|
+
item_to_rdf(nd, graph_name: subject, quoted: quoted, &block)
|
104
105
|
end
|
105
106
|
when '@reverse'
|
106
107
|
raise "Huh?" unless values.is_a?(Hash)
|
@@ -113,7 +114,7 @@ module JSON::LD
|
|
113
114
|
object = item_to_rdf(v, graph_name: graph_name, &block)
|
114
115
|
#log_debug("item_to_rdf") {"subject: #{object.to_ntriples rescue 'malformed rdf'}"}
|
115
116
|
# yield subject, prediate, and literal to results.
|
116
|
-
yield RDF::Statement(object, predicate, subject, graph_name: graph_name)
|
117
|
+
yield RDF::Statement(object, predicate, subject, graph_name: graph_name, quoted: quoted)
|
117
118
|
end
|
118
119
|
end
|
119
120
|
when '@included'
|
@@ -136,13 +137,13 @@ module JSON::LD
|
|
136
137
|
object = parse_list(v['@list'], graph_name: graph_name, &block)
|
137
138
|
|
138
139
|
# Append a triple composed of subject, prediate, and object to results and add all triples from list_results to results.
|
139
|
-
yield RDF::Statement(subject, predicate, object, graph_name: graph_name)
|
140
|
+
yield RDF::Statement(subject, predicate, object, graph_name: graph_name, quoted: quoted)
|
140
141
|
else
|
141
142
|
# Otherwise, item is a value object or a node definition. Generate object as the result of the Object Converstion algorithm passing item.
|
142
143
|
object = item_to_rdf(v, graph_name: graph_name, &block)
|
143
144
|
#log_debug("item_to_rdf") {"object: #{object.to_ntriples rescue 'malformed rdf'}"}
|
144
145
|
# yield subject, prediate, and literal to results.
|
145
|
-
yield RDF::Statement(subject, predicate, object, graph_name: graph_name)
|
146
|
+
yield RDF::Statement(subject, predicate, object, graph_name: graph_name, quoted: quoted)
|
146
147
|
end
|
147
148
|
end
|
148
149
|
end
|
data/lib/json/ld/writer.rb
CHANGED
@@ -71,7 +71,7 @@ module JSON::LD
|
|
71
71
|
|
72
72
|
##
|
73
73
|
# JSON-LD Writer options
|
74
|
-
# @see
|
74
|
+
# @see https://ruby-rdf.github.io/rdf/RDF/Writer#options-class_method
|
75
75
|
def self.options
|
76
76
|
super + [
|
77
77
|
RDF::CLI::Option.new(
|
data/spec/compact_spec.rb
CHANGED
@@ -954,6 +954,76 @@ describe JSON::LD::API do
|
|
954
954
|
}),
|
955
955
|
processingMode: 'json-ld-1.1'
|
956
956
|
},
|
957
|
+
"issue-514": {
|
958
|
+
input: %({
|
959
|
+
"http://example.org/ns/prop": [{
|
960
|
+
"@id": "http://example.org/ns/bar",
|
961
|
+
"http://example.org/ns/name": "bar"
|
962
|
+
}, {
|
963
|
+
"@id": "http://example.org/ns/foo",
|
964
|
+
"http://example.org/ns/name": "foo"
|
965
|
+
}]
|
966
|
+
}),
|
967
|
+
context: %({
|
968
|
+
"@context": {
|
969
|
+
"ex": "http://example.org/ns/",
|
970
|
+
"prop": {
|
971
|
+
"@id": "ex:prop",
|
972
|
+
"@container": "@index",
|
973
|
+
"@index": "ex:name"
|
974
|
+
}
|
975
|
+
}
|
976
|
+
}),
|
977
|
+
output: %({
|
978
|
+
"@context": {
|
979
|
+
"ex": "http://example.org/ns/",
|
980
|
+
"prop": {
|
981
|
+
"@id": "ex:prop",
|
982
|
+
"@container": "@index",
|
983
|
+
"@index": "ex:name"
|
984
|
+
}
|
985
|
+
},
|
986
|
+
"prop": {
|
987
|
+
"foo": { "@id": "ex:foo"},
|
988
|
+
"bar": { "@id": "ex:bar"}
|
989
|
+
}
|
990
|
+
})
|
991
|
+
},
|
992
|
+
"issue-514b": {
|
993
|
+
input: %({
|
994
|
+
"http://example.org/ns/prop": [{
|
995
|
+
"@id": "http://example.org/ns/bar",
|
996
|
+
"http://example.org/ns/name": "bar"
|
997
|
+
}, {
|
998
|
+
"@id": "http://example.org/ns/foo",
|
999
|
+
"http://example.org/ns/name": "foo"
|
1000
|
+
}]
|
1001
|
+
}),
|
1002
|
+
context: %({
|
1003
|
+
"@context": {
|
1004
|
+
"ex": "http://example.org/ns/",
|
1005
|
+
"prop": {
|
1006
|
+
"@id": "ex:prop",
|
1007
|
+
"@container": "@index",
|
1008
|
+
"@index": "http://example.org/ns/name"
|
1009
|
+
}
|
1010
|
+
}
|
1011
|
+
}),
|
1012
|
+
output: %({
|
1013
|
+
"@context": {
|
1014
|
+
"ex": "http://example.org/ns/",
|
1015
|
+
"prop": {
|
1016
|
+
"@id": "ex:prop",
|
1017
|
+
"@container": "@index",
|
1018
|
+
"@index": "http://example.org/ns/name"
|
1019
|
+
}
|
1020
|
+
},
|
1021
|
+
"prop": {
|
1022
|
+
"foo": { "@id": "ex:foo"},
|
1023
|
+
"bar": { "@id": "ex:bar"}
|
1024
|
+
}
|
1025
|
+
})
|
1026
|
+
},
|
957
1027
|
}.each_pair do |title, params|
|
958
1028
|
it(title) {run_compact(params)}
|
959
1029
|
end
|
data/spec/context_spec.rb
CHANGED
@@ -181,7 +181,14 @@ describe JSON::LD::Context do
|
|
181
181
|
before {JSON::LD::Context.instance_variable_set(:@cache, nil)}
|
182
182
|
it "retrieves and parses a remote context document" do
|
183
183
|
expect(JSON::LD::API).to receive(:documentLoader).with("http://example.com/context", anything).and_yield(remote_doc)
|
184
|
-
subject.parse(ctx)
|
184
|
+
ec = subject.parse(ctx)
|
185
|
+
expect(ec.send(:mappings)).to produce({
|
186
|
+
"xsd" => "http://www.w3.org/2001/XMLSchema#",
|
187
|
+
"name" => "http://xmlns.com/foaf/0.1/name",
|
188
|
+
"homepage" => "http://xmlns.com/foaf/0.1/homepage",
|
189
|
+
"avatar" => "http://xmlns.com/foaf/0.1/avatar",
|
190
|
+
"integer" => "http://www.w3.org/2001/XMLSchema#integer"
|
191
|
+
}, logger)
|
185
192
|
end
|
186
193
|
end
|
187
194
|
|
data/spec/format_spec.rb
CHANGED
@@ -41,6 +41,10 @@ describe JSON::LD::Format do
|
|
41
41
|
specify {expect(described_class.to_sym).to eq :jsonld}
|
42
42
|
end
|
43
43
|
|
44
|
+
describe "#to_uri" do
|
45
|
+
specify {expect(described_class.to_uri).to eq RDF::URI('http://www.w3.org/ns/formats/JSON-LD')}
|
46
|
+
end
|
47
|
+
|
44
48
|
describe ".detect" do
|
45
49
|
{
|
46
50
|
jsonld: '{"@context" => "foo"}',
|
@@ -66,7 +70,7 @@ describe JSON::LD::Format do
|
|
66
70
|
end
|
67
71
|
end
|
68
72
|
|
69
|
-
describe ".cli_commands" do
|
73
|
+
describe ".cli_commands", skip: Gem.win_platform? do
|
70
74
|
require 'rdf/cli'
|
71
75
|
let(:ttl) {File.expand_path("../test-files/test-1-rdf.ttl", __FILE__)}
|
72
76
|
let(:json) {File.expand_path("../test-files/test-1-input.json", __FILE__)}
|
data/spec/frame_spec.rb
CHANGED
@@ -992,6 +992,95 @@ describe JSON::LD::API do
|
|
992
992
|
end
|
993
993
|
end
|
994
994
|
|
995
|
+
context "omitGraph option" do
|
996
|
+
{
|
997
|
+
"Defaults to false in 1.0": {
|
998
|
+
input: %([{
|
999
|
+
"http://example.org/prop": [{"@value": "value"}],
|
1000
|
+
"http://example.org/foo": [{"@value": "bar"}]
|
1001
|
+
}]),
|
1002
|
+
frame: %({
|
1003
|
+
"@context": {
|
1004
|
+
"@vocab": "http://example.org/"
|
1005
|
+
}
|
1006
|
+
}),
|
1007
|
+
output: %({
|
1008
|
+
"@context": {
|
1009
|
+
"@vocab": "http://example.org/"
|
1010
|
+
},
|
1011
|
+
"@graph": [{
|
1012
|
+
"foo": "bar",
|
1013
|
+
"prop": "value"
|
1014
|
+
}]
|
1015
|
+
}),
|
1016
|
+
processingMode: "json-ld-1.0"
|
1017
|
+
},
|
1018
|
+
"Set with option in 1.0": {
|
1019
|
+
input: %([{
|
1020
|
+
"http://example.org/prop": [{"@value": "value"}],
|
1021
|
+
"http://example.org/foo": [{"@value": "bar"}]
|
1022
|
+
}]),
|
1023
|
+
frame: %({
|
1024
|
+
"@context": {
|
1025
|
+
"@vocab": "http://example.org/"
|
1026
|
+
}
|
1027
|
+
}),
|
1028
|
+
output: %({
|
1029
|
+
"@context": {
|
1030
|
+
"@vocab": "http://example.org/"
|
1031
|
+
},
|
1032
|
+
"foo": "bar",
|
1033
|
+
"prop": "value"
|
1034
|
+
}),
|
1035
|
+
processingMode: "json-ld-1.0",
|
1036
|
+
omitGraph: true
|
1037
|
+
},
|
1038
|
+
"Defaults to true in 1.1": {
|
1039
|
+
input: %([{
|
1040
|
+
"http://example.org/prop": [{"@value": "value"}],
|
1041
|
+
"http://example.org/foo": [{"@value": "bar"}]
|
1042
|
+
}]),
|
1043
|
+
frame: %({
|
1044
|
+
"@context": {
|
1045
|
+
"@vocab": "http://example.org/"
|
1046
|
+
}
|
1047
|
+
}),
|
1048
|
+
output: %({
|
1049
|
+
"@context": {
|
1050
|
+
"@vocab": "http://example.org/"
|
1051
|
+
},
|
1052
|
+
"foo": "bar",
|
1053
|
+
"prop": "value"
|
1054
|
+
}),
|
1055
|
+
processingMode: "json-ld-1.1"
|
1056
|
+
},
|
1057
|
+
"Set with option in 1.1": {
|
1058
|
+
input: %([{
|
1059
|
+
"http://example.org/prop": [{"@value": "value"}],
|
1060
|
+
"http://example.org/foo": [{"@value": "bar"}]
|
1061
|
+
}]),
|
1062
|
+
frame: %({
|
1063
|
+
"@context": {
|
1064
|
+
"@vocab": "http://example.org/"
|
1065
|
+
}
|
1066
|
+
}),
|
1067
|
+
output: %({
|
1068
|
+
"@context": {
|
1069
|
+
"@vocab": "http://example.org/"
|
1070
|
+
},
|
1071
|
+
"@graph": [{
|
1072
|
+
"foo": "bar",
|
1073
|
+
"prop": "value"
|
1074
|
+
}]
|
1075
|
+
}),
|
1076
|
+
processingMode: "json-ld-1.1",
|
1077
|
+
omitGraph: false
|
1078
|
+
},
|
1079
|
+
}.each do |title, params|
|
1080
|
+
it(title) {do_frame(params.merge(pruneBlankNodeIdentifiers: true))}
|
1081
|
+
end
|
1082
|
+
end
|
1083
|
+
|
995
1084
|
context "@included" do
|
996
1085
|
{
|
997
1086
|
"Basic Included array": {
|
@@ -2359,15 +2448,16 @@ describe JSON::LD::API do
|
|
2359
2448
|
|
2360
2449
|
def do_frame(params)
|
2361
2450
|
begin
|
2362
|
-
input, frame, output
|
2451
|
+
input, frame, output = params[:input], params[:frame], params[:output]
|
2452
|
+
params = {processingMode: 'json-ld-1.0'}.merge(params)
|
2363
2453
|
input = ::JSON.parse(input) if input.is_a?(String)
|
2364
2454
|
frame = ::JSON.parse(frame) if frame.is_a?(String)
|
2365
2455
|
output = ::JSON.parse(output) if output.is_a?(String)
|
2366
2456
|
jld = nil
|
2367
2457
|
if params[:write]
|
2368
|
-
expect{jld = JSON::LD::API.frame(input, frame, logger: logger,
|
2458
|
+
expect{jld = JSON::LD::API.frame(input, frame, logger: logger, **params)}.to write(params[:write]).to(:error)
|
2369
2459
|
else
|
2370
|
-
expect{jld = JSON::LD::API.frame(input, frame, logger: logger,
|
2460
|
+
expect{jld = JSON::LD::API.frame(input, frame, logger: logger, **params)}.not_to write.to(:error)
|
2371
2461
|
end
|
2372
2462
|
expect(jld).to produce_jsonld(output, logger)
|
2373
2463
|
|
data/spec/reader_spec.rb
CHANGED
@@ -131,7 +131,7 @@ describe JSON::LD::Reader do
|
|
131
131
|
{
|
132
132
|
"@context": {"@base": "http://a/bb/ccc/d;p?q", "urn:ex:p": {"@type": "@id"}},
|
133
133
|
"@graph": [
|
134
|
-
{"@id": "urn:ex:s001", "urn:ex:p": "
|
134
|
+
{"@id": "urn:ex:s001", "urn:ex:p": "gg:h"},
|
135
135
|
{"@id": "urn:ex:s002", "urn:ex:p": "g"},
|
136
136
|
{"@id": "urn:ex:s003", "urn:ex:p": "./g"},
|
137
137
|
{"@id": "urn:ex:s004", "urn:ex:p": "g/"},
|
@@ -183,7 +183,7 @@ describe JSON::LD::Reader do
|
|
183
183
|
{
|
184
184
|
"@context": {"@base": "http://a/bb/ccc/d/", "urn:ex:p": {"@type": "@id"}},
|
185
185
|
"@graph": [
|
186
|
-
{"@id": "urn:ex:s043", "urn:ex:p": "
|
186
|
+
{"@id": "urn:ex:s043", "urn:ex:p": "gg:h"},
|
187
187
|
{"@id": "urn:ex:s044", "urn:ex:p": "g"},
|
188
188
|
{"@id": "urn:ex:s045", "urn:ex:p": "./g"},
|
189
189
|
{"@id": "urn:ex:s046", "urn:ex:p": "g/"},
|
@@ -235,7 +235,7 @@ describe JSON::LD::Reader do
|
|
235
235
|
{
|
236
236
|
"@context": {"@base": "http://a/bb/ccc/./d;p?q", "urn:ex:p": {"@type": "@id"}},
|
237
237
|
"@graph": [
|
238
|
-
{"@id": "urn:ex:s085", "urn:ex:p": "
|
238
|
+
{"@id": "urn:ex:s085", "urn:ex:p": "gg:h"},
|
239
239
|
{"@id": "urn:ex:s086", "urn:ex:p": "g"},
|
240
240
|
{"@id": "urn:ex:s087", "urn:ex:p": "./g"},
|
241
241
|
{"@id": "urn:ex:s088", "urn:ex:p": "g/"},
|
@@ -287,7 +287,7 @@ describe JSON::LD::Reader do
|
|
287
287
|
{
|
288
288
|
"@context": {"@base": "http://a/bb/ccc/../d;p?q", "urn:ex:p": {"@type": "@id"}},
|
289
289
|
"@graph": [
|
290
|
-
{"@id": "urn:ex:s127", "urn:ex:p": "
|
290
|
+
{"@id": "urn:ex:s127", "urn:ex:p": "gg:h"},
|
291
291
|
{"@id": "urn:ex:s128", "urn:ex:p": "g"},
|
292
292
|
{"@id": "urn:ex:s129", "urn:ex:p": "./g"},
|
293
293
|
{"@id": "urn:ex:s130", "urn:ex:p": "g/"},
|
@@ -339,7 +339,7 @@ describe JSON::LD::Reader do
|
|
339
339
|
{
|
340
340
|
"@context": {"@base": "http://a/bb/ccc/.", "urn:ex:p": {"@type": "@id"}},
|
341
341
|
"@graph": [
|
342
|
-
{"@id": "urn:ex:s169", "urn:ex:p": "
|
342
|
+
{"@id": "urn:ex:s169", "urn:ex:p": "gg:h"},
|
343
343
|
{"@id": "urn:ex:s170", "urn:ex:p": "g"},
|
344
344
|
{"@id": "urn:ex:s171", "urn:ex:p": "./g"},
|
345
345
|
{"@id": "urn:ex:s172", "urn:ex:p": "g/"},
|
@@ -391,7 +391,7 @@ describe JSON::LD::Reader do
|
|
391
391
|
{
|
392
392
|
"@context": {"@base": "http://a/bb/ccc/..", "urn:ex:p": {"@type": "@id"}},
|
393
393
|
"@graph": [
|
394
|
-
{"@id": "urn:ex:s211", "urn:ex:p": "
|
394
|
+
{"@id": "urn:ex:s211", "urn:ex:p": "gg:h"},
|
395
395
|
{"@id": "urn:ex:s212", "urn:ex:p": "g"},
|
396
396
|
{"@id": "urn:ex:s213", "urn:ex:p": "./g"},
|
397
397
|
{"@id": "urn:ex:s214", "urn:ex:p": "g/"},
|
@@ -443,7 +443,7 @@ describe JSON::LD::Reader do
|
|
443
443
|
{
|
444
444
|
"@context": {"@base": "file:///a/bb/ccc/d;p?q", "urn:ex:p": {"@type": "@id"}},
|
445
445
|
"@graph": [
|
446
|
-
{"@id": "urn:ex:s253", "urn:ex:p": "
|
446
|
+
{"@id": "urn:ex:s253", "urn:ex:p": "gg:h"},
|
447
447
|
{"@id": "urn:ex:s254", "urn:ex:p": "g"},
|
448
448
|
{"@id": "urn:ex:s255", "urn:ex:p": "./g"},
|
449
449
|
{"@id": "urn:ex:s256", "urn:ex:p": "g/"},
|
@@ -523,7 +523,7 @@ describe JSON::LD::Reader do
|
|
523
523
|
let(:nt) {%q{
|
524
524
|
# RFC3986 normal examples
|
525
525
|
|
526
|
-
<urn:ex:s001> <urn:ex:p> <
|
526
|
+
<urn:ex:s001> <urn:ex:p> <gg:h>.
|
527
527
|
<urn:ex:s002> <urn:ex:p> <http://a/bb/ccc/g>.
|
528
528
|
<urn:ex:s003> <urn:ex:p> <http://a/bb/ccc/g>.
|
529
529
|
<urn:ex:s004> <urn:ex:p> <http://a/bb/ccc/g/>.
|
@@ -571,7 +571,7 @@ describe JSON::LD::Reader do
|
|
571
571
|
|
572
572
|
# RFC3986 normal examples with trailing slash in base IRI
|
573
573
|
|
574
|
-
<urn:ex:s043> <urn:ex:p> <
|
574
|
+
<urn:ex:s043> <urn:ex:p> <gg:h>.
|
575
575
|
<urn:ex:s044> <urn:ex:p> <http://a/bb/ccc/d/g>.
|
576
576
|
<urn:ex:s045> <urn:ex:p> <http://a/bb/ccc/d/g>.
|
577
577
|
<urn:ex:s046> <urn:ex:p> <http://a/bb/ccc/d/g/>.
|
@@ -619,7 +619,7 @@ describe JSON::LD::Reader do
|
|
619
619
|
|
620
620
|
# RFC3986 normal examples with /. in the base IRI
|
621
621
|
|
622
|
-
<urn:ex:s085> <urn:ex:p> <
|
622
|
+
<urn:ex:s085> <urn:ex:p> <gg:h>.
|
623
623
|
<urn:ex:s086> <urn:ex:p> <http://a/bb/ccc/g>.
|
624
624
|
<urn:ex:s087> <urn:ex:p> <http://a/bb/ccc/g>.
|
625
625
|
<urn:ex:s088> <urn:ex:p> <http://a/bb/ccc/g/>.
|
@@ -667,7 +667,7 @@ describe JSON::LD::Reader do
|
|
667
667
|
|
668
668
|
# RFC3986 normal examples with /.. in the base IRI
|
669
669
|
|
670
|
-
<urn:ex:s127> <urn:ex:p> <
|
670
|
+
<urn:ex:s127> <urn:ex:p> <gg:h>.
|
671
671
|
<urn:ex:s128> <urn:ex:p> <http://a/bb/g>.
|
672
672
|
<urn:ex:s129> <urn:ex:p> <http://a/bb/g>.
|
673
673
|
<urn:ex:s130> <urn:ex:p> <http://a/bb/g/>.
|
@@ -715,7 +715,7 @@ describe JSON::LD::Reader do
|
|
715
715
|
|
716
716
|
# RFC3986 normal examples with trailing /. in the base IRI
|
717
717
|
|
718
|
-
<urn:ex:s169> <urn:ex:p> <
|
718
|
+
<urn:ex:s169> <urn:ex:p> <gg:h>.
|
719
719
|
<urn:ex:s170> <urn:ex:p> <http://a/bb/ccc/g>.
|
720
720
|
<urn:ex:s171> <urn:ex:p> <http://a/bb/ccc/g>.
|
721
721
|
<urn:ex:s172> <urn:ex:p> <http://a/bb/ccc/g/>.
|
@@ -763,7 +763,7 @@ describe JSON::LD::Reader do
|
|
763
763
|
|
764
764
|
# RFC3986 normal examples with trailing /.. in the base IRI
|
765
765
|
|
766
|
-
<urn:ex:s211> <urn:ex:p> <
|
766
|
+
<urn:ex:s211> <urn:ex:p> <gg:h>.
|
767
767
|
<urn:ex:s212> <urn:ex:p> <http://a/bb/ccc/g>.
|
768
768
|
<urn:ex:s213> <urn:ex:p> <http://a/bb/ccc/g>.
|
769
769
|
<urn:ex:s214> <urn:ex:p> <http://a/bb/ccc/g/>.
|
@@ -811,7 +811,7 @@ describe JSON::LD::Reader do
|
|
811
811
|
|
812
812
|
# RFC3986 normal examples with file path
|
813
813
|
|
814
|
-
<urn:ex:s253> <urn:ex:p> <
|
814
|
+
<urn:ex:s253> <urn:ex:p> <gg:h>.
|
815
815
|
<urn:ex:s254> <urn:ex:p> <file:///a/bb/ccc/g>.
|
816
816
|
<urn:ex:s255> <urn:ex:p> <file:///a/bb/ccc/g>.
|
817
817
|
<urn:ex:s256> <urn:ex:p> <file:///a/bb/ccc/g/>.
|
data/spec/spec_helper.rb
CHANGED
@@ -15,10 +15,16 @@ require_relative 'matchers'
|
|
15
15
|
require 'yaml'
|
16
16
|
begin
|
17
17
|
require 'simplecov'
|
18
|
-
require '
|
18
|
+
require 'simplecov-lcov'
|
19
|
+
SimpleCov::Formatter::LcovFormatter.config do |config|
|
20
|
+
#Coveralls is coverage by default/lcov. Send info results
|
21
|
+
config.report_with_single_file = true
|
22
|
+
config.single_report_path = 'coverage/lcov.info'
|
23
|
+
end
|
24
|
+
|
19
25
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
20
26
|
SimpleCov::Formatter::HTMLFormatter,
|
21
|
-
|
27
|
+
SimpleCov::Formatter::LcovFormatter
|
22
28
|
])
|
23
29
|
SimpleCov.start do
|
24
30
|
add_filter "/spec/"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json-ld
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1
|
4
|
+
version: 3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdf
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: multi_json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.15'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.15'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: link_header
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,14 +64,14 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '0.
|
67
|
+
version: '0.3'
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '0.
|
74
|
+
version: '0.3'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: htmlentities
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,14 +92,14 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '2.
|
95
|
+
version: '2.2'
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '2.
|
102
|
+
version: '2.2'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: sinatra-linkeddata
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,14 +134,14 @@ dependencies:
|
|
134
134
|
requirements:
|
135
135
|
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version: '3.
|
137
|
+
version: '3.13'
|
138
138
|
type: :development
|
139
139
|
prerelease: false
|
140
140
|
version_requirements: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
142
|
- - "~>"
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: '3.
|
144
|
+
version: '3.13'
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
146
|
name: yajl-ruby
|
147
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -176,98 +176,98 @@ dependencies:
|
|
176
176
|
requirements:
|
177
177
|
- - "~>"
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version: '3.
|
179
|
+
version: '3.2'
|
180
180
|
type: :development
|
181
181
|
prerelease: false
|
182
182
|
version_requirements: !ruby/object:Gem::Requirement
|
183
183
|
requirements:
|
184
184
|
- - "~>"
|
185
185
|
- !ruby/object:Gem::Version
|
186
|
-
version: '3.
|
186
|
+
version: '3.2'
|
187
187
|
- !ruby/object:Gem::Dependency
|
188
188
|
name: rdf-spec
|
189
189
|
requirement: !ruby/object:Gem::Requirement
|
190
190
|
requirements:
|
191
191
|
- - "~>"
|
192
192
|
- !ruby/object:Gem::Version
|
193
|
-
version: '3.
|
193
|
+
version: '3.2'
|
194
194
|
type: :development
|
195
195
|
prerelease: false
|
196
196
|
version_requirements: !ruby/object:Gem::Requirement
|
197
197
|
requirements:
|
198
198
|
- - "~>"
|
199
199
|
- !ruby/object:Gem::Version
|
200
|
-
version: '3.
|
200
|
+
version: '3.2'
|
201
201
|
- !ruby/object:Gem::Dependency
|
202
202
|
name: rdf-trig
|
203
203
|
requirement: !ruby/object:Gem::Requirement
|
204
204
|
requirements:
|
205
205
|
- - "~>"
|
206
206
|
- !ruby/object:Gem::Version
|
207
|
-
version: '3.
|
207
|
+
version: '3.2'
|
208
208
|
type: :development
|
209
209
|
prerelease: false
|
210
210
|
version_requirements: !ruby/object:Gem::Requirement
|
211
211
|
requirements:
|
212
212
|
- - "~>"
|
213
213
|
- !ruby/object:Gem::Version
|
214
|
-
version: '3.
|
214
|
+
version: '3.2'
|
215
215
|
- !ruby/object:Gem::Dependency
|
216
216
|
name: rdf-turtle
|
217
217
|
requirement: !ruby/object:Gem::Requirement
|
218
218
|
requirements:
|
219
219
|
- - "~>"
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
version: '3.
|
221
|
+
version: '3.2'
|
222
222
|
type: :development
|
223
223
|
prerelease: false
|
224
224
|
version_requirements: !ruby/object:Gem::Requirement
|
225
225
|
requirements:
|
226
226
|
- - "~>"
|
227
227
|
- !ruby/object:Gem::Version
|
228
|
-
version: '3.
|
228
|
+
version: '3.2'
|
229
229
|
- !ruby/object:Gem::Dependency
|
230
230
|
name: rdf-vocab
|
231
231
|
requirement: !ruby/object:Gem::Requirement
|
232
232
|
requirements:
|
233
233
|
- - "~>"
|
234
234
|
- !ruby/object:Gem::Version
|
235
|
-
version: '3.
|
235
|
+
version: '3.2'
|
236
236
|
type: :development
|
237
237
|
prerelease: false
|
238
238
|
version_requirements: !ruby/object:Gem::Requirement
|
239
239
|
requirements:
|
240
240
|
- - "~>"
|
241
241
|
- !ruby/object:Gem::Version
|
242
|
-
version: '3.
|
242
|
+
version: '3.2'
|
243
243
|
- !ruby/object:Gem::Dependency
|
244
244
|
name: rdf-xsd
|
245
245
|
requirement: !ruby/object:Gem::Requirement
|
246
246
|
requirements:
|
247
247
|
- - "~>"
|
248
248
|
- !ruby/object:Gem::Version
|
249
|
-
version: '3.
|
249
|
+
version: '3.2'
|
250
250
|
type: :development
|
251
251
|
prerelease: false
|
252
252
|
version_requirements: !ruby/object:Gem::Requirement
|
253
253
|
requirements:
|
254
254
|
- - "~>"
|
255
255
|
- !ruby/object:Gem::Version
|
256
|
-
version: '3.
|
256
|
+
version: '3.2'
|
257
257
|
- !ruby/object:Gem::Dependency
|
258
258
|
name: rspec
|
259
259
|
requirement: !ruby/object:Gem::Requirement
|
260
260
|
requirements:
|
261
261
|
- - "~>"
|
262
262
|
- !ruby/object:Gem::Version
|
263
|
-
version: '3.
|
263
|
+
version: '3.10'
|
264
264
|
type: :development
|
265
265
|
prerelease: false
|
266
266
|
version_requirements: !ruby/object:Gem::Requirement
|
267
267
|
requirements:
|
268
268
|
- - "~>"
|
269
269
|
- !ruby/object:Gem::Version
|
270
|
-
version: '3.
|
270
|
+
version: '3.10'
|
271
271
|
- !ruby/object:Gem::Dependency
|
272
272
|
name: rspec-its
|
273
273
|
requirement: !ruby/object:Gem::Requirement
|
@@ -411,7 +411,12 @@ files:
|
|
411
411
|
homepage: https://github.com/ruby-rdf/json-ld
|
412
412
|
licenses:
|
413
413
|
- Unlicense
|
414
|
-
metadata:
|
414
|
+
metadata:
|
415
|
+
documentation_uri: https://ruby-rdf.github.io/json-ld
|
416
|
+
bug_tracker_uri: https://github.com/ruby-rdf/json-ld/issues
|
417
|
+
homepage_uri: https://github.com/ruby-rdf/json-ld
|
418
|
+
mailing_list_uri: https://lists.w3.org/Archives/Public/public-rdf-ruby/
|
419
|
+
source_code_uri: https://github.com/ruby-rdf/json-ld
|
415
420
|
post_install_message:
|
416
421
|
rdoc_options: []
|
417
422
|
require_paths:
|
@@ -420,14 +425,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
420
425
|
requirements:
|
421
426
|
- - ">="
|
422
427
|
- !ruby/object:Gem::Version
|
423
|
-
version: '2.
|
428
|
+
version: '2.6'
|
424
429
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
425
430
|
requirements:
|
426
431
|
- - ">="
|
427
432
|
- !ruby/object:Gem::Version
|
428
433
|
version: '0'
|
429
434
|
requirements: []
|
430
|
-
rubygems_version: 3.
|
435
|
+
rubygems_version: 3.3.3
|
431
436
|
signing_key:
|
432
437
|
specification_version: 4
|
433
438
|
summary: JSON-LD reader/writer for Ruby.
|