diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-11-19 14:42:29 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-11-19 14:42:29 +0100 |
commit | 6d9653546115e73b732eaadfcb3d1dbe9ab7d99a (patch) | |
tree | 71aa6ce076873969290497aea70ea124f2aab854 /application.rb | |
parent | 5334912982dd06f61103025504a6f78438847ee0 (diff) |
lazar predictions and toxcreate are working
Diffstat (limited to 'application.rb')
-rw-r--r-- | application.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/application.rb b/application.rb index d0d12af..94c6039 100644 --- a/application.rb +++ b/application.rb @@ -2,28 +2,28 @@ require 'rubygems' gem "opentox-ruby-api-wrapper", "= 1.6.6" require 'opentox-ruby-api-wrapper' -class Model +class ModelStore include DataMapper::Resource + attr_accessor :prediction_dataset property :id, Serial property :uri, String, :length => 255 - property :owl, Text, :length => 2**32-1 property :yaml, Text, :length => 2**32-1 property :created_at, DateTime end -class Prediction +class PredictionCache # cache predictions include DataMapper::Resource property :id, Serial property :compound_uri, String, :length => 255 property :model_uri, String, :length => 255 - property :yaml, Text, :length => 2**32-1 + property :dataset_uri, String, :length => 255 end DataMapper.auto_upgrade! require 'lazar.rb' -require 'property_lazar.rb' +#require 'property_lazar.rb' helpers do @@ -42,12 +42,12 @@ end get '/?' do # get index of models response['Content-Type'] = 'text/uri-list' - Model.all(params).collect{|m| m.uri}.join("\n") + "\n" + ModelStore.all(params).collect{|m| m.uri}.join("\n") + "\n" end delete '/:id/?' do begin - Model.get(params[:id]).destroy! + ModelStore.get(params[:id]).destroy! "Model #{params[:id]} deleted." rescue halt 404, "Model #{params[:id]} does not exist." @@ -57,8 +57,8 @@ end delete '/?' do # TODO delete datasets - Model.auto_migrate! - Prediction.auto_migrate! + ModelStore.auto_migrate! + #Prediction.auto_migrate! response['Content-Type'] = 'text/plain' "All models and cached predictions deleted." end |