summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2013-06-05 19:41:48 +0200
committerChristoph Helma <helma@in-silico.ch>2013-06-05 19:41:48 +0200
commit128ef342e71337fc53b980e549d0a477a768c294 (patch)
tree41ec6a61110a2741152da8c52bfa8c2386a7b67e
parent183ccb509592f4a9cf0c473c5a3ebcd957f7bb70 (diff)
parent5dab9d972bedb4319de39ee17253902fb37f8667 (diff)
Merge branch 'development' of github.com:opentox/opentox-client into development
-rw-r--r--lib/opentox.rb10
-rw-r--r--lib/overwrite.rb2
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/opentox.rb b/lib/opentox.rb
index 8817798..0e44426 100644
--- a/lib/opentox.rb
+++ b/lib/opentox.rb
@@ -135,7 +135,9 @@ module OpenTox
@metadata[RDF.type] ||= 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] }
+ [values].flatten.each do |value|
+ predicate =~ /#{RDF::DC.date}|#{RDF::DC.title}|#{RDF::DC.description}/ ? @rdf.update([RDF::URI.new(@uri), predicate, value]) : @rdf << [RDF::URI.new(@uri), predicate, value]
+ end
end
@parameters.each do |parameter|
p_node = RDF::Node.new
@@ -160,7 +162,7 @@ module OpenTox
send :define_method, "to_#{format}".to_sym do
create_rdf
RDF::Writer.for(format).buffer(:encoding => Encoding::ASCII) do |writer|
- @rdf.each{|statement| writer << statement}
+ writer << @rdf
end
end
end
@@ -169,8 +171,8 @@ module OpenTox
prefixes = {:rdf => "http://www.w3.org/1999/02/22-rdf-syntax-ns#"}
['OT', 'DC', 'XSD', 'OLO'].each{|p| prefixes[p.downcase.to_sym] = eval("RDF::#{p}.to_s") }
create_rdf
- RDF::Turtle::Writer.for(:turtle).buffer(:prefixes => prefixes) do |writer|
- @rdf.each{|statement| writer << statement}
+ RDF::Writer.for(:turtle).buffer(:prefixes => prefixes) do |writer|
+ writer << @rdf
end
end
diff --git a/lib/overwrite.rb b/lib/overwrite.rb
index 3317c79..04de58d 100644
--- a/lib/overwrite.rb
+++ b/lib/overwrite.rb
@@ -53,7 +53,7 @@ class String
html << "<h3>Description</h3><pre><p>"+description.link_urls+"</p></pre>" if description
html << "<h3>Related links</h3><pre><p>"+related_links.link_urls+"</p></pre>" if related_links
html << "<h3>Content</h3>" if description || related_links
- html << "<pre><p style=\"padding:15px; border:10px solid \#B9DCFF\">"
+ html << "<pre><p style=\"padding:15px; border:10px solid \#DBC87B\">"
html << "<img src=\"data:image/png;base64,#{Base64.encode64(png_image)}\">\n" if png_image
html << self.link_urls
html << "</p></pre></body></html>"