diff options
author | Christoph Helma <helma@in-silico.ch> | 2013-07-10 17:49:49 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2013-07-10 17:49:49 +0200 |
commit | 9c9e53fcb550e6ba01a8de965bfaa2c182e5b05f (patch) | |
tree | eaecc93fe645d331e500618565beac43ab6fe188 | |
parent | ddb83b4302e8628b333402d24e3e05fc90b3faef (diff) |
descriptor-long test fixed
-rw-r--r-- | lib/opentox.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/opentox.rb b/lib/opentox.rb index e6fcf63..93e2c52 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -133,7 +133,7 @@ module OpenTox @metadata[RDF.type] ||= RDF::URI.new(eval("RDF::OT."+self.class.to_s.split('::').last)) @metadata[RDF::DC.date] ||= DateTime.now @metadata.each do |predicate,values| - [values].flatten.each{ |value| @rdf << [RDF::URI.new(@uri), predicate, (value == eval("RDF::OT."+self.class.to_s.split('::').last)) ? RDF::URI.new(value) : value] } + [values].flatten.each{ |value| @rdf << [RDF::URI.new(@uri), predicate, (value == eval("RDF::OT."+self.class.to_s.split('::').last)) ? RDF::URI.new(value) : value] unless value.nil? } end @parameters.each do |parameter| p_node = RDF::Node.new @@ -156,7 +156,10 @@ module OpenTox # rdf serialization methods for all formats e.g. to_rdfxml send :define_method, "to_#{format}".to_sym do + puts format + puts self.inspect create_rdf + puts @rdf.to_s RDF::Writer.for(format).buffer(:encoding => Encoding::ASCII) do |writer| writer << @rdf end |