summaryrefslogtreecommitdiff
path: root/lazar.rb
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2011-05-26 12:19:50 +0200
committermguetlein <martin.guetlein@gmail.com>2011-05-26 12:19:50 +0200
commit645045dc2afe3323d5bf9968ffe842665398bd67 (patch)
tree7246273ef081b392fec00f196eba935afc38dd9d /lazar.rb
parent4dac8a5e47a4cc85c4bafc805cd3e52be2a53669 (diff)
fix html for algorithms
Diffstat (limited to 'lazar.rb')
-rw-r--r--lazar.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/lazar.rb b/lazar.rb
index 0ed8f3f..403d99c 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -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