We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba20d10 commit 00b2961Copy full SHA for 00b2961
lib/json/ld/flatten.rb
@@ -210,8 +210,9 @@ def create_annotations(node_map)
210
sort_by(&:length).
211
reverse.each do |key|
212
213
+ annotation = node_map[key]
214
# Deserialize key, and re-serialize the `@id` value.
- emb = JSON.parse(key)
215
+ emb = annotation['@id'].dup
216
id = emb.delete('@id')
217
property, value = emb.to_a.first
218
@@ -227,7 +228,7 @@ def create_annotations(node_map)
227
228
node[property].each do |emb_value|
229
next unless emb_value == value.first
230
- annotation = node_map.delete(key)
231
+ node_map.delete(key)
232
annotation.delete('@id')
233
add_value(emb_value, '@annotation', annotation, property_is_array: true) unless
234
annotation.empty?
0 commit comments