lib/json/ld/api.rb in json-ld-1.1.11.1 vs lib/json/ld/api.rb in json-ld-1.99.0
- old
+ new
@@ -419,11 +419,11 @@
debug(".toRdf") {"node map: #{graphs.to_json(JSON_STATE) rescue 'malformed json'}"}
# Start generating statements
graphs.each do |graph_name, graph|
context = as_resource(graph_name) unless graph_name == '@default'
- debug(".toRdf") {"context: #{context ? context.to_ntriples : 'null'}"}
+ debug(".toRdf") {"graph_name: #{context ? context.to_ntriples : 'null'}"}
# Drop results for graphs which are named with relative IRIs
if graph_name.is_a?(RDF::URI) && !graph_name.absolute
debug(".toRdf") {"drop relative graph_name: #{statement.to_ntriples}"}
next
end
@@ -443,10 +443,10 @@
if relative
debug(".toRdf") {"drop statement with relative IRIs: #{statement.to_ntriples}"}
next
end
- statement.context = context if context
+ statement.graph_name = context if context
if block_given?
yield statement
else
results << statement
end