diff options
author | Christoph Helma <helma@in-silico.ch> | 2013-06-10 11:50:58 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2013-06-10 11:50:58 +0200 |
commit | 4dba36635f5d214c4453d2d0d67426d6f14f5b6b (patch) | |
tree | 9437ee36472f7e158414062032b0eabf02dc576c /lib/opentox.rb | |
parent | 128ef342e71337fc53b980e549d0a477a768c294 (diff) | |
parent | d1059d024ac3f87af041626b1ade3a928e8099e4 (diff) |
Merge branch 'development' of github.com:opentox/opentox-client into development
Diffstat (limited to 'lib/opentox.rb')
-rw-r--r-- | lib/opentox.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/opentox.rb b/lib/opentox.rb index 0e44426..95dca04 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -167,15 +167,17 @@ module OpenTox end end + # @return [String] converts object to turtle-string def to_turtle # redefined to use prefixes (not supported by RDF::Writer) 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::Writer.for(:turtle).buffer(:prefixes => prefixes) do |writer| + RDF::Turtle::Writer.for(:turtle).buffer(:prefixes => prefixes) do |writer| writer << @rdf end end + # @return [String] converts OpenTox object into html document (by first converting it to a string) def to_html to_turtle.to_html end |