From 2e902d818ac6dc7dff9496f30f1ac7b5acc6ce80 Mon Sep 17 00:00:00 2001 From: mguetlein Date: Fri, 27 May 2011 09:57:49 +0200 Subject: fix predicted model features: return metadata isntead of feature itself as yaml, set content type --- lazar.rb | 9 ++++++--- 1 file 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 -- cgit v1.2.3