summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2011-05-27 09:57:49 +0200
committermguetlein <martin.guetlein@gmail.com>2011-05-27 09:57:49 +0200
commit2e902d818ac6dc7dff9496f30f1ac7b5acc6ce80 (patch)
tree1ca057d396bb37f1fa9531a494e1072d87816527
parent18893781c93041a2f750814ed5bd2fff3e76addf (diff)
fix predicted model features: return metadata isntead of feature itself as yaml, set content type
-rw-r--r--lazar.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lazar.rb b/lazar.rb
index e1fa05e..65aff16 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -60,11 +60,14 @@ get '/:id/predicted/:prop' do
feature = eval "YAML.load_file(@yaml_file).prediction_#{params[:prop]}_feature"
case @accept
when /yaml/
- feature.to_yaml
- when /rdf/
+ content_type "application/x-yaml"
+ feature.metadata.to_yaml
+ when /rdf/
+ content_type "application/rdf+xml"
feature.to_rdfxml
when /html/
- OpenTox.text_to_html feature.to_yaml
+ content_type "text/html"
+ OpenTox.text_to_html feature.metadata.to_yaml
else
halt 400, "Unsupported MIME type '#{@accept}'"
end