lib/json/ld/compact.rb in json-ld-3.1.9 vs lib/json/ld/compact.rb in json-ld-3.1.10
- old
+ new
@@ -295,9 +295,10 @@
when container.include?('@index')
index_key = context.term_definitions[item_active_property].index || '@index'
if index_key == '@index'
map_key = expanded_item['@index']
else
+ index_key = context.expand_iri(index_key, vocab: true)
container_key = context.compact_iri(index_key, vocab: true)
map_key, *others = Array(compacted_item[container_key])
if map_key.is_a?(String)
case others.length
when 0 then compacted_item.delete(container_key)