diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-05-26 12:19:50 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-05-26 12:19:50 +0200 |
commit | 645045dc2afe3323d5bf9968ffe842665398bd67 (patch) | |
tree | 7246273ef081b392fec00f196eba935afc38dd9d /lazar.rb | |
parent | 4dac8a5e47a4cc85c4bafc805cd3e52be2a53669 (diff) |
fix html for algorithms
Diffstat (limited to 'lazar.rb')
-rw-r--r-- | lazar.rb | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -3,7 +3,6 @@ # Get RDF/XML representation of the lazar algorithm # @return [application/rdf+xml] OWL-DL representation of the lazar algorithm get '/lazar/?' do - response['Content-Type'] = 'application/rdf+xml' algorithm = OpenTox::Algorithm::Generic.new(url_for('/lazar',:full)) algorithm.metadata = { DC.title => 'lazar', @@ -17,7 +16,17 @@ get '/lazar/?' do { DC.description => "Further parameters for the feaature generation service", OT.paramScope => "optional" } ] } - algorithm.to_rdfxml + case request.env['HTTP_ACCEPT'] + when /text\/html/ + content_type "text/html" + OpenTox.text_to_html algorithm.to_yaml + when /application\/x-yaml/ + content_type "application/x-yaml" + algorithm.to_yaml + else + response['Content-Type'] = 'application/rdf+xml' + algorithm.to_rdfxml + end end # Create a lazar prediction model |