Skip to content

Commit db345f2

Browse files
committed
Some list santity checking in fromRdf.
1 parent 079ae65 commit db345f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/json/ld/from_rdf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def from_statements(input, useRdfType: false, useNativeTypes: false)
7878
# If property equals rdf:rest, the value associated to the usages member of node has exactly 1 entry, node has a rdf:first and rdf:rest property, both of which have as value an array consisting of a single element, and node has no other members apart from an optional @type member whose value is an array with a single item equal to rdf:List, node represents a well-formed list node. Continue with the following steps:
7979
#log_debug("list element?") {node.to_json(JSON_STATE) rescue 'malformed json'}
8080
while property == RDF.rest.to_s &&
81-
node_usages_map[node['@id']].uniq.length == 1 &&
81+
Array(node_usages_map[node['@id']]).uniq.length == 1 &&
8282
blank_node?(node) &&
8383
node.keys.none? {|k| !["@id", '@type', :usages, RDF.first.to_s, RDF.rest.to_s].include?(k)} &&
8484
Array(node[:usages]).length == 1 &&

0 commit comments

Comments
 (0)