json-ld 3.1.8 → 3.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/VERSION +1 -1
- data/bin/jsonld +10 -8
- data/lib/json/ld/api.rb +12 -3
- data/lib/json/ld/compact.rb +2 -2
- data/lib/json/ld/context.rb +2 -0
- data/lib/json/ld/flatten.rb +46 -1
- data/lib/json/ld/format.rb +7 -0
- data/lib/json/ld/from_rdf.rb +12 -6
- data/spec/compact_spec.rb +1 -1
- data/spec/context_spec.rb +0 -2
- data/spec/expand_spec.rb +1 -1
- data/spec/flatten_spec.rb +1 -1
- data/spec/from_rdf_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- data/spec/suite_to_rdf_spec.rb +1 -1
- data/spec/to_rdf_spec.rb +1 -1
- data/spec/writer_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d6d6a64b4f09b881332fe9b54bd2c1d0ad116d590bd457443831ccc5fae3ea9
|
4
|
+
data.tar.gz: 91deee18963670cb94360b5c278dc7a8ae55ccbd897c580a54d291f1f98cfd15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f96e6b68f363ccd0b96035a66c438ff59801162742fb1b7fd6443684ee2539d34a994f01c95d9019ae46732efdd9eca37539c837af8137efa2fefb9db0930e0f
|
7
|
+
data.tar.gz: 5fe42b5836c6620aa3b485b2622ef94c7d73c63ec3de495779520c697201cdcd2ae4920e3b210f19cc49523e6b1a02b6b73482bc3fc23b7bb9717ba7cd50f04b
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ JSON::LD can now be used to create a _context_ from an RDFS/OWL definition, and
|
|
15
15
|
|
16
16
|
* If the [jsonlint][] gem is installed, it will be used when validating an input document.
|
17
17
|
* If available, uses [Nokogiri][] and/or [Nokogumbo][] for parsing HTML, falls back to REXML otherwise.
|
18
|
-
* Provisional support for [JSON-LD
|
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)
|
21
21
|
|
@@ -37,9 +37,9 @@ The order of triples retrieved from the `RDF::Enumerable` dataset determines the
|
|
37
37
|
### MultiJson parser
|
38
38
|
The [MultiJson](https://rubygems.org/gems/multi_json) gem is used for parsing JSON; this defaults to the native JSON parser, but will use a more performant parser if one is available. A specific parser can be specified by adding the `:adapter` option to any API call. See [MultiJson](https://rubygems.org/gems/multi_json) for more information.
|
39
39
|
|
40
|
-
### JSON-LD
|
40
|
+
### JSON-LD-star (RDFStar)
|
41
41
|
|
42
|
-
The {JSON::LD::API.expand}, {JSON::LD::API.compact}, {JSON::LD::API.toRdf}, and {JSON::LD::API.fromRdf} API methods, along with the {JSON::LD::Reader} and {JSON::LD::Writer}, include provisional support for [JSON-LD
|
42
|
+
The {JSON::LD::API.expand}, {JSON::LD::API.compact}, {JSON::LD::API.toRdf}, and {JSON::LD::API.fromRdf} API methods, along with the {JSON::LD::Reader} and {JSON::LD::Writer}, include provisional support for [JSON-LD-star][JSON-LD-star].
|
43
43
|
|
44
44
|
Internally, an `RDF::Statement` is treated as another resource, along with `RDF::URI` and `RDF::Node`, which allows an `RDF::Statement` to have a `#subject` or `#object` which is also an `RDF::Statement`.
|
45
45
|
|
@@ -636,7 +636,7 @@ see <https://unlicense.org/> or the accompanying {file:UNLICENSE} file.
|
|
636
636
|
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
|
637
637
|
[PDD]: https://unlicense.org/#unlicensing-contributions
|
638
638
|
[RDF.rb]: https://rubygems.org/gems/rdf
|
639
|
-
[JSON-LD
|
639
|
+
[JSON-LD-star]: https://json-ld.github.io/json-ld-star/
|
640
640
|
[Rack::LinkedData]: https://rubygems.org/gems/rack-linkeddata
|
641
641
|
[Backports]: https://rubygems.org/gems/backports
|
642
642
|
[JSON-LD]: https://www.w3.org/TR/json-ld11/ "JSON-LD 1.1"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.9
|
data/bin/jsonld
CHANGED
@@ -26,34 +26,34 @@ def run(input, options, parser_options)
|
|
26
26
|
if options[:expand]
|
27
27
|
parser_options = parser_options.merge(expandContext: parser_options.delete(:context)) if parser_options.key?(:context)
|
28
28
|
input = JSON::LD::API.fromRdf(reader) if reader
|
29
|
-
output = JSON::LD::API.expand(input, parser_options)
|
29
|
+
output = JSON::LD::API.expand(input, **parser_options)
|
30
30
|
secs = Time.new - start
|
31
31
|
options[:output].puts output.to_json(JSON::LD::JSON_STATE)
|
32
32
|
STDERR.puts "Expanded in #{secs} seconds." unless options[:quiet]
|
33
33
|
elsif options[:compact]
|
34
34
|
input = JSON::LD::API.fromRdf(reader) if reader
|
35
|
-
output = JSON::LD::API.compact(input, parser_options[:context], parser_options)
|
35
|
+
output = JSON::LD::API.compact(input, parser_options[:context], **parser_options)
|
36
36
|
secs = Time.new - start
|
37
37
|
options[:output].puts output.to_json(JSON::LD::JSON_STATE)
|
38
38
|
STDERR.puts "Compacted in #{secs} seconds." unless options[:quiet]
|
39
39
|
elsif options[:flatten]
|
40
40
|
input = JSON::LD::API.fromRdf(reader) if reader
|
41
|
-
output = JSON::LD::API.flatten(input, parser_options[:context], parser_options)
|
41
|
+
output = JSON::LD::API.flatten(input, parser_options[:context], **parser_options)
|
42
42
|
secs = Time.new - start
|
43
43
|
options[:output].puts output.to_json(JSON::LD::JSON_STATE)
|
44
44
|
STDERR.puts "Flattened in #{secs} seconds." unless options[:quiet]
|
45
45
|
elsif options[:frame]
|
46
46
|
input = JSON::LD::API.fromRdf(reader) if reader
|
47
|
-
output = JSON::LD::API.frame(input, parser_options[:frame], parser_options)
|
47
|
+
output = JSON::LD::API.frame(input, parser_options[:frame], **parser_options)
|
48
48
|
secs = Time.new - start
|
49
49
|
options[:output].puts output.to_json(JSON::LD::JSON_STATE)
|
50
50
|
STDERR.puts "Framed in #{secs} seconds." unless options[:quiet]
|
51
51
|
else
|
52
52
|
parser_options = parser_options.merge(expandContext: parser_options.delete(:context)) if parser_options.key?(:context)
|
53
53
|
parser_options[:standard_prefixes] = true
|
54
|
-
reader ||= JSON::LD::Reader.new(input, parser_options)
|
54
|
+
reader ||= JSON::LD::Reader.new(input, **parser_options)
|
55
55
|
num = 0
|
56
|
-
RDF::Writer.for(options[:output_format]).new(options[:output], parser_options) do |w|
|
56
|
+
RDF::Writer.for(options[:output_format]).new(options[:output], **parser_options) do |w|
|
57
57
|
reader.each do |statement|
|
58
58
|
num += 1
|
59
59
|
w << statement
|
@@ -113,6 +113,7 @@ OPT_ARGS = [
|
|
113
113
|
["--processingMode",GetoptLong::REQUIRED_ARGUMENT,"Set processing mode, defaults to json-ld-1.1"],
|
114
114
|
["--quiet", GetoptLong::NO_ARGUMENT, "Supress most output other than progress indicators"],
|
115
115
|
["--rename_bnodes", GetoptLong::OPTIONAL_ARGUMENT,"Rename bnodes as part of expansion, or keep them the same"],
|
116
|
+
["--rdfstar", GetoptLong::NO_ARGUMENT, "Parse JSON-LD-star"],
|
116
117
|
["--requireAll", GetoptLong::OPTIONAL_ARGUMENT,"Rename bnodes as part of expansion, or keep them the same"],
|
117
118
|
["--stream", GetoptLong::NO_ARGUMENT, "Use Streaming reader/writer"],
|
118
119
|
["--unique_bnodes", GetoptLong::OPTIONAL_ARGUMENT,"Use unique bnode identifiers"],
|
@@ -140,7 +141,7 @@ opts = GetoptLong.new(*OPT_ARGS.map {|o| o[0..-2]})
|
|
140
141
|
opts.each do |opt, arg|
|
141
142
|
case opt
|
142
143
|
when '--debug' then logger.level = Logger::DEBUG
|
143
|
-
when '--compact' then
|
144
|
+
when '--compact' then options[:compact] = true
|
144
145
|
when "--compactArrays" then parser_options[:compactArrays] = (arg || 'true') == 'true'
|
145
146
|
when '--context' then parser_options[:context] = RDF::URI(arg).absolute? ? arg : File.open(arg)
|
146
147
|
when '--evaluate' then input = arg
|
@@ -158,6 +159,7 @@ opts.each do |opt, arg|
|
|
158
159
|
when '--quiet'
|
159
160
|
options[:quiet] = true
|
160
161
|
logger.level = Logger::FATAL
|
162
|
+
when "--rdfstar" then parser_options[:rdfstar] = true
|
161
163
|
when "--rename_bnodes" then parser_options[:rename_bnodes] = (arg || 'true') == 'true'
|
162
164
|
when "--requireAll" then parser_options[:requireAll] = (arg || 'true') == 'true'
|
163
165
|
when '--stream' then parser_options[:stream] = true
|
@@ -193,7 +195,7 @@ if ARGV.empty?
|
|
193
195
|
else
|
194
196
|
ARGV.each do |file|
|
195
197
|
# Call with opened files
|
196
|
-
RDF::Util::File.open_file(file, options) {|f| run(f, options, parser_options)}
|
198
|
+
RDF::Util::File.open_file(file, **options) {|f| run(f, options, parser_options)}
|
197
199
|
end
|
198
200
|
end
|
199
201
|
puts
|
data/lib/json/ld/api.rb
CHANGED
@@ -90,7 +90,7 @@ module JSON::LD
|
|
90
90
|
# Processing mode, json-ld-1.0 or json-ld-1.1.
|
91
91
|
# If `processingMode` is not specified, a mode of `json-ld-1.0` or `json-ld-1.1` is set, the context used for `expansion` or `compaction`.
|
92
92
|
# @option options [Boolean] rdfstar (false)
|
93
|
-
# support parsing JSON-LD
|
93
|
+
# support parsing JSON-LD-star statement resources.
|
94
94
|
# @option options [Boolean] :rename_bnodes (true)
|
95
95
|
# Rename bnodes as part of expansion, or keep them the same.
|
96
96
|
# @option options [Boolean] :unique_bnodes (false)
|
@@ -253,6 +253,8 @@ module JSON::LD
|
|
253
253
|
# @param [Boolean] expanded (false) Input is already expanded
|
254
254
|
# @param [Hash{Symbol => Object}] options
|
255
255
|
# @option options (see #initialize)
|
256
|
+
# @option options [Boolean] :createAnnotations
|
257
|
+
# Unfold embedded nodes which can be represented using `@annotation`.
|
256
258
|
# @yield jsonld
|
257
259
|
# @yieldparam [Hash] jsonld
|
258
260
|
# The flattened JSON-LD document
|
@@ -284,6 +286,13 @@ module JSON::LD
|
|
284
286
|
graph_maps = {'@default' => {}}
|
285
287
|
create_node_map(value, graph_maps)
|
286
288
|
|
289
|
+
# If create annotations flag is set, then update each node map in graph maps with the result of calling the create annotations algorithm.
|
290
|
+
if options[:createAnnotations]
|
291
|
+
graph_maps.values.each do |node_map|
|
292
|
+
create_annotations(node_map)
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
287
296
|
default_graph = graph_maps['@default']
|
288
297
|
graph_maps.keys.opt_sort(ordered: @options[:ordered]).each do |graph_name|
|
289
298
|
next if graph_name == '@default'
|
@@ -302,7 +311,7 @@ module JSON::LD
|
|
302
311
|
if context && !flattened.empty?
|
303
312
|
# Otherwise, return the result of compacting flattened according the Compaction algorithm passing context ensuring that the compaction result uses the @graph keyword (or its alias) at the top-level, even if the context is empty or if there is only one element to put in the @graph array. This ensures that the returned document has a deterministic structure.
|
304
313
|
compacted = as_array(compact(flattened))
|
305
|
-
kwgraph = self.context.compact_iri('@graph')
|
314
|
+
kwgraph = self.context.compact_iri('@graph', vocab: true)
|
306
315
|
flattened = self.context.
|
307
316
|
serialize(provided_context: context).
|
308
317
|
merge(kwgraph => compacted)
|
@@ -448,7 +457,7 @@ module JSON::LD
|
|
448
457
|
result = if !compacted.is_a?(Array)
|
449
458
|
compacted
|
450
459
|
else
|
451
|
-
kwgraph = context.compact_iri('@graph')
|
460
|
+
kwgraph = context.compact_iri('@graph', vocab: true)
|
452
461
|
{kwgraph => compacted}
|
453
462
|
end
|
454
463
|
# Only add context if one was provided
|
data/lib/json/ld/compact.rb
CHANGED
@@ -100,7 +100,7 @@ module JSON::LD
|
|
100
100
|
if expanded_property == '@id'
|
101
101
|
compacted_value = as_array(expanded_value).map do |expanded_id|
|
102
102
|
if node?(expanded_id) && @options[:rdfstar]
|
103
|
-
# This can only really happen for valid RDF
|
103
|
+
# This can only really happen for valid RDF-star
|
104
104
|
compact(expanded_id, base: base,
|
105
105
|
property: '@id',
|
106
106
|
log_depth: log_depth.to_i + 1)
|
@@ -145,7 +145,7 @@ module JSON::LD
|
|
145
145
|
end
|
146
146
|
|
147
147
|
unless compacted_value.empty?
|
148
|
-
al = context.compact_iri('@reverse')
|
148
|
+
al = context.compact_iri('@reverse', vocab: true)
|
149
149
|
log_debug("", depth: log_depth.to_i) {"remainder: #{al} => #{compacted_value.inspect}"}
|
150
150
|
result[al] = compacted_value
|
151
151
|
end
|
data/lib/json/ld/context.rb
CHANGED
@@ -1455,6 +1455,8 @@ module JSON::LD
|
|
1455
1455
|
if !vocab
|
1456
1456
|
# transform iri to a relative IRI using the document's base IRI
|
1457
1457
|
iri = remove_base(self.base || base, iri)
|
1458
|
+
# Make . relative if it has the form of a keyword.
|
1459
|
+
iri = "./#{iri}" if iri.match?(/^@[a-zA-Z]+$/)
|
1458
1460
|
return iri
|
1459
1461
|
else
|
1460
1462
|
return iri
|
data/lib/json/ld/flatten.rb
CHANGED
@@ -9,7 +9,7 @@ module JSON::LD
|
|
9
9
|
##
|
10
10
|
# This algorithm creates a JSON object node map holding an indexed representation of the graphs and nodes represented in the passed expanded document. All nodes that are not uniquely identified by an IRI get assigned a (new) blank node identifier. The resulting node map will have a member for every graph in the document whose value is another object with a member for every node represented in the document. The default graph is stored under the @default member, all other graphs are stored under their graph name.
|
11
11
|
#
|
12
|
-
# For RDF
|
12
|
+
# For RDF-star/JSON-LD-star:
|
13
13
|
# * Values of `@id` can be an object (embedded node); when these are used as keys in a Node Map, they are serialized as canonical JSON, and de-serialized when flattening.
|
14
14
|
# * The presence of `@annotation` implies an embedded node and the annotation object is removed from the node/value object in which it appears.
|
15
15
|
#
|
@@ -191,6 +191,51 @@ module JSON::LD
|
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
194
|
+
##
|
195
|
+
# Create annotations
|
196
|
+
#
|
197
|
+
# Updates a node map from which annotations have been folded into embedded triples to re-extract the annotations.
|
198
|
+
#
|
199
|
+
# Map entries where the key is of the form of a canonicalized JSON object are used to find keys with the `@id` and property components. If found, the original map entry is removed and entries added to an `@annotation` property of the associated value.
|
200
|
+
#
|
201
|
+
# * Keys which are of the form of a canonicalized JSON object are examined in inverse order of length.
|
202
|
+
# * Deserialize the key into a map, and re-serialize the value of `@id`.
|
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
|
+
#
|
205
|
+
# @param [Hash{String => Hash}] input
|
206
|
+
# @return [Hash{String => Hash}]
|
207
|
+
def create_annotations(node_map)
|
208
|
+
node_map.keys.
|
209
|
+
select {|k| k.start_with?('{')}.
|
210
|
+
sort_by(&:length).
|
211
|
+
reverse.each do |key|
|
212
|
+
|
213
|
+
annotation = node_map[key]
|
214
|
+
# Deserialize key, and re-serialize the `@id` value.
|
215
|
+
emb = annotation['@id'].dup
|
216
|
+
id = emb.delete('@id')
|
217
|
+
property, value = emb.to_a.first
|
218
|
+
|
219
|
+
# If id is a map, set it to the result of canonicalizing that value, otherwise to itself.
|
220
|
+
id = id.to_json_c14n if id.is_a?(Hash)
|
221
|
+
|
222
|
+
next unless node_map.key?(id)
|
223
|
+
# If node map has an entry for id and that entry contains the same property and value from entry:
|
224
|
+
node = node_map[id]
|
225
|
+
|
226
|
+
next unless node.key?(property)
|
227
|
+
|
228
|
+
node[property].each do |emb_value|
|
229
|
+
next unless emb_value == value.first
|
230
|
+
|
231
|
+
node_map.delete(key)
|
232
|
+
annotation.delete('@id')
|
233
|
+
add_value(emb_value, '@annotation', annotation, property_is_array: true) unless
|
234
|
+
annotation.empty?
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
194
239
|
##
|
195
240
|
# Rename blank nodes recursively within an embedded object
|
196
241
|
#
|
data/lib/json/ld/format.rb
CHANGED
@@ -174,6 +174,13 @@ module JSON::LD
|
|
174
174
|
use: :required,
|
175
175
|
on: ["--context CONTEXT"],
|
176
176
|
description: "Context to use when compacting.") {|arg| RDF::URI(arg)},
|
177
|
+
RDF::CLI::Option.new(
|
178
|
+
symbol: :createAnnotations,
|
179
|
+
datatype: TrueClass,
|
180
|
+
default: false,
|
181
|
+
control: :checkbox,
|
182
|
+
on: ["--[no-]create-annotations"],
|
183
|
+
description: "Unfold embedded nodes which can be represented using `@annotation`."),
|
177
184
|
]
|
178
185
|
},
|
179
186
|
frame: {
|
data/lib/json/ld/from_rdf.rb
CHANGED
@@ -40,8 +40,10 @@ module JSON::LD
|
|
40
40
|
|
41
41
|
default_graph[name] ||= {'@id' => name} unless name == '@default'
|
42
42
|
|
43
|
-
subject = statement.subject.
|
44
|
-
|
43
|
+
subject = statement.subject.statement? ?
|
44
|
+
resource_representation(statement.subject, useNativeTypes)['@id'].to_json_c14n :
|
45
|
+
statement.subject.to_s
|
46
|
+
node = node_map[subject] ||= resource_representation(statement.subject, useNativeTypes)
|
45
47
|
|
46
48
|
# If predicate is rdf:datatype, note subject in compound literal subjects map
|
47
49
|
if @options[:rdfDirection] == 'compound-literal' && statement.predicate == RDF.to_uri + 'direction'
|
@@ -50,12 +52,14 @@ module JSON::LD
|
|
50
52
|
|
51
53
|
# If object is an IRI, blank node identifier, or statement, and node map does not have an object member, create one and initialize its value to a new JSON object consisting of a single member @id whose value is set to object.
|
52
54
|
unless statement.object.literal?
|
53
|
-
|
55
|
+
object = statement.object.statement? ?
|
56
|
+
resource_representation(statement.object, useNativeTypes)['@id'].to_json_c14n :
|
57
|
+
statement.object.to_s
|
58
|
+
node_map[object] ||=
|
54
59
|
resource_representation(statement.object, useNativeTypes)
|
55
60
|
end
|
56
61
|
|
57
62
|
# If predicate equals rdf:type, and object is an IRI or blank node identifier, append object to the value of the @type member of node. If no such member exists, create one and initialize it to an array whose only item is object. Finally, continue to the next RDF triple.
|
58
|
-
# XXX JSON-LD* does not support embedded value of @type
|
59
63
|
if statement.predicate == RDF.type && statement.object.resource? && !useRdfType
|
60
64
|
merge_value(node, '@type', statement.object.to_s)
|
61
65
|
next
|
@@ -112,8 +116,7 @@ module JSON::LD
|
|
112
116
|
end
|
113
117
|
end
|
114
118
|
|
115
|
-
|
116
|
-
next unless nil_var = graph_object[RDF.nil.to_s]
|
119
|
+
nil_var = graph_object.fetch(RDF.nil.to_s, {})
|
117
120
|
|
118
121
|
# For each item usage in the usages member of nil, perform the following steps:
|
119
122
|
nil_var.fetch(:usages, []).each do |usage|
|
@@ -141,6 +144,9 @@ module JSON::LD
|
|
141
144
|
head['@list'] = list.reverse
|
142
145
|
list_nodes.each {|node_id| graph_object.delete(node_id)}
|
143
146
|
end
|
147
|
+
|
148
|
+
# Create annotations on graph object
|
149
|
+
create_annotations(graph_object)
|
144
150
|
end
|
145
151
|
|
146
152
|
result = []
|
data/spec/compact_spec.rb
CHANGED
data/spec/context_spec.rb
CHANGED
@@ -1148,7 +1148,6 @@ describe JSON::LD::Context do
|
|
1148
1148
|
"nil" => [nil, nil],
|
1149
1149
|
"absolute IRI" => ["http://example.com/", "http://example.com/"],
|
1150
1150
|
"prefix:suffix" => ["ex:suffix", "http://example.org/suffix"],
|
1151
|
-
"keyword" => ["@type", "@type"],
|
1152
1151
|
"unmapped" => ["foo", "foo"],
|
1153
1152
|
"bnode" => [JSON::LD::JsonLdError:: IRIConfusedWithPrefix, RDF::Node("a")],
|
1154
1153
|
"relative" => ["foo/bar", "http://base/foo/bar"],
|
@@ -1338,7 +1337,6 @@ describe JSON::LD::Context do
|
|
1338
1337
|
"nil" => [nil, nil],
|
1339
1338
|
"absolute IRI" => ["http://example.com/", "http://example.com/"],
|
1340
1339
|
"prefix:suffix" => ["ex:suffix", "http://example.org/suffix"],
|
1341
|
-
"keyword" => ["@type", "@type"],
|
1342
1340
|
"unmapped" => ["foo", "foo"],
|
1343
1341
|
"bnode" => [JSON::LD::JsonLdError:: IRIConfusedWithPrefix, RDF::Node("a")],
|
1344
1342
|
"relative" => ["foo/bar", "http://base/foo/bar"],
|
data/spec/expand_spec.rb
CHANGED
data/spec/flatten_spec.rb
CHANGED
data/spec/from_rdf_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -77,7 +77,6 @@ def remap_bnodes(actual, expected)
|
|
77
77
|
bijection = bijection.inject({}) {|memo, (k, v)| memo.merge(k.to_s => v.to_s)}
|
78
78
|
|
79
79
|
# Recursively replace blank nodes in actual with the bijection
|
80
|
-
#require 'byebug'; byebug
|
81
80
|
replace_nodes(actual, bijection)
|
82
81
|
else
|
83
82
|
actual
|
data/spec/suite_to_rdf_spec.rb
CHANGED
@@ -9,7 +9,7 @@ describe JSON::LD do
|
|
9
9
|
m.entries.each do |t|
|
10
10
|
specify "#{t.property('@id')}: #{t.name}#{' (negative test)' unless t.positiveTest?}" do
|
11
11
|
pending "Generalized RDF" if t.options[:produceGeneralizedRdf]
|
12
|
-
pending "RDF
|
12
|
+
pending "RDF-star" if t.property('@id') == '#te122'
|
13
13
|
if %w(#t0118).include?(t.property('@id'))
|
14
14
|
expect {t.run self}.to write(/Statement .* is invalid/).to(:error)
|
15
15
|
elsif %w(#te075).include?(t.property('@id'))
|
data/spec/to_rdf_spec.rb
CHANGED
data/spec/writer_spec.rb
CHANGED
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.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdf
|