diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-05-27 09:57:49 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-05-27 09:57:49 +0200 |
commit | 2e902d818ac6dc7dff9496f30f1ac7b5acc6ce80 (patch) | |
tree | 1ca057d396bb37f1fa9531a494e1072d87816527 | |
parent | 18893781c93041a2f750814ed5bd2fff3e76addf (diff) |
fix predicted model features: return metadata isntead of feature itself as yaml, set content type
-rw-r--r-- | lazar.rb | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 |