summaryrefslogtreecommitdiff
path: root/lazar.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.de>2010-03-18 20:54:24 +0100
committerChristoph Helma <helma@in-silico.de>2010-03-18 20:54:24 +0100
commitae21e1dcb471832e96b90904e8c29c5febd7a74e (patch)
tree7802df42f23c93f2ee8eb49ba37fa3b5894e065b /lazar.rb
parentcdd37344f4e8c5280aa10a72a9a281c7ccf172cd (diff)
more detailed model information in toxcreate
Diffstat (limited to 'lazar.rb')
-rw-r--r--lazar.rb30
1 files changed, 18 insertions, 12 deletions
diff --git a/lazar.rb b/lazar.rb
index 0f65ade..da255cf 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -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