From 84417ada7c4d0a3b44ed35a8eee60db2e1e751f6 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Wed, 27 Mar 2013 17:11:50 +0100 Subject: validation tests ok --- lib/opentox.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/opentox.rb') diff --git a/lib/opentox.rb b/lib/opentox.rb index 1251f33..db7ba5c 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -25,8 +25,8 @@ module OpenTox # Object metadata (lazy loading) # @return [Hash] Object metadata def metadata force_update=false - if (@metadata.empty? or force_update) and URI.accessible? @uri - get if @rdf.empty? or force_update + if (@metadata.nil? or @metadata.empty? or force_update) and URI.accessible? @uri + get if @rdf.nil? or @rdf.empty? or force_update # return values as plain strings instead of RDF objects @metadata = @rdf.to_hash[RDF::URI.new(@uri)].inject({}) { |h, (predicate, values)| h[predicate] = values.collect{|v| v.to_s}; h } end -- cgit v1.2.3