diff options
author | Christoph Helma <helma@in-silico.de> | 2010-03-18 20:54:24 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.de> | 2010-03-18 20:54:24 +0100 |
commit | ae21e1dcb471832e96b90904e8c29c5febd7a74e (patch) | |
tree | 7802df42f23c93f2ee8eb49ba37fa3b5894e065b /lazar.rb | |
parent | cdd37344f4e8c5280aa10a72a9a281c7ccf172cd (diff) |
more detailed model information in toxcreate
Diffstat (limited to 'lazar.rb')
-rw-r--r-- | lazar.rb | 30 |
1 files changed, 18 insertions, 12 deletions
@@ -1,17 +1,23 @@ get '/lazar/?' do - owl = OpenTox::Owl.new 'Algorithm', url_for('/lazar',:full) - owl.title = "lazar" - owl.source = "http://github.com/helma/opentox-algorithm" - owl.parameters = { - "Dataset URI" => - { :scope => "mandatory", :value => "dataset_uri" }, - "Feature URI for dependent variable" => - { :scope => "mandatory", :value => "feature_uri" }, - "Feature generation URI" => - { :scope => "mandatory", :value => "feature_generation_uri" } - } + if File.exists?('public/lazar.owl') + rdf = File.read('public/lazar.owl') + else + owl = OpenTox::Owl.new 'Algorithm', url_for('/lazar',:full) + owl.title = "lazar" + owl.source = "http://github.com/helma/opentox-algorithm" + owl.parameters = { + "Dataset URI" => + { :scope => "mandatory", :value => "dataset_uri" }, + "Feature URI for dependent variable" => + { :scope => "mandatory", :value => "feature_uri" }, + "Feature generation URI" => + { :scope => "mandatory", :value => "feature_generation_uri" } + } + rdf = owl.rdf + File.open('public/lazar.owl', 'w') {|f| f.print rdf} + end response['Content-Type'] = 'application/rdf+xml' - owl.rdf + rdf end post '/lazar/?' do # create a model |