diff options
-rw-r--r-- | application.rb | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | lazar.rb | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/application.rb b/application.rb index e111673..7538196 100644 --- a/application.rb +++ b/application.rb @@ -18,7 +18,7 @@ require 'lazar.rb' get '/?' do # get index of models response['Content-Type'] = 'text/uri-list' - Model.all.collect{|m| m.uri}.join("\n") + "\n" + Model.all(params).collect{|m| m.uri}.join("\n") + "\n" end delete '/:id/?' do @@ -80,8 +80,8 @@ class Lazar < Model def to_owl data = YAML.load(yaml) - activity_dataset = YAML.load(RestClient.get(data.trainingDataset, :accept => 'application/x-yaml').body) - feature_dataset = YAML.load(RestClient.get(data.feature_dataset_uri, :accept => 'application/x-yaml').body) + activity_dataset = YAML.load(RestClient.get(data.trainingDataset, :accept => 'text/x-yaml').to_s) + feature_dataset = YAML.load(RestClient.get(data.feature_dataset_uri, :accept => 'text/x-yaml').to_s) owl = OpenTox::Owl.create 'Model', uri owl.set("creator","http://github.com/helma/opentox-model") owl.set("title","#{URI.decode(activity_dataset.title)} lazar classification") @@ -112,7 +112,7 @@ get '/:id/?' do case params[:id] when /.yaml$/ params[:id].sub!(/.yaml$/,'') - accept = 'application/x-yaml' + accept = 'text/x-yaml' when /.rdf$/ params[:id].sub!(/.rdf$/,'') accept = 'application/rdf+xml' @@ -128,7 +128,7 @@ get '/:id/?' do end model.owl when /yaml/ - response['Content-Type'] = 'application/x-yaml' + response['Content-Type'] = 'text/x-yaml' model.yaml else halt 400, "Unsupported MIME type '#{accept}'" |