Skip to content

Commit

Permalink
Bug in fromRDF when subject is empty, which makes it look like a an i…
Browse files Browse the repository at this point in the history
…ncluded graph equivalent to the default graph.
  • Loading branch information
gkellogg committed May 14, 2012
1 parent 7f0098f commit 05aad91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/json/ld/from_rdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ def from_statements(input)
debug("=> default") {entry.to_json(JSON_STATE)}

# If subject is a named graph, add serialized subject defintions
if graphs.has_key?(subject)
if graphs.has_key?(subject) && !subject.empty?
entry['@graph'] = graphs[subject][:subjects].keys.sort.map do |s|
debug("=> #{subject}") {entry.to_json(JSON_STATE)}
debug("=> #{s.inspect}")
graphs[subject][:subjects][s]
end
end

debug("default graph") {entry.to_json(JSON_STATE)}
debug("default graph") {entry.inspect}
entry
end

Expand Down

0 comments on commit 05aad91

Please sign in to comment.