summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2012-02-21 16:35:07 +0100
committerAndreas Maunz <andreas@maunz.de>2012-02-21 16:35:07 +0100
commit5b53700d63ee55ed2e47331fa30723e873f204eb (patch)
treeffbea0641f8f4d8f47f7ff6db2b2c0ad1ddcd083
parent2b54733514e1c6e91b0397c70b441fc7c92e1db5 (diff)
Added description of pcdesc
-rw-r--r--application.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/application.rb b/application.rb
index 735a4d1..122361d 100644
--- a/application.rb
+++ b/application.rb
@@ -357,6 +357,32 @@ end
#
# @param [String] pc_type
# @return [text/uri-list] Task ID
+get '/:id/pcdesc' do
+algorithm = OpenTox::Algorithm::Generic.new(url_for('/dataset/id/pcdesc',:full))
+ algorithm.metadata = {
+ DC.title => 'Physico-chemical (PC) descriptor calculation',
+ DC.creator => "andreas@maunz.de, vorgrimmlerdavid@gmx.de",
+ RDF.type => [OT.Algorithm,OTA.PatternMiningSupervised],
+ OT.parameters => [
+ { DC.description => "Dataset URI", OT.paramScope => "mandatory", DC.title => "dataset_uri" },
+ { DC.description => "PC type", OT.paramScope => "mandatory", DC.title => "pc_type" },
+ ]
+ }
+ case request.env['HTTP_ACCEPT']
+ when /text\/html/
+ content_type "text/html"
+ OpenTox.text_to_html algorithm.to_yaml
+ when /application\/x-yaml/
+ content_type "application/x-yaml"
+ algorithm.to_yaml
+ else
+ response['Content-Type'] = 'application/rdf+xml'
+ algorithm.to_rdfxml
+ end
+end
+
+
+
post '/:id/pcdesc' do
response['Content-Type'] = 'text/uri-list'
raise "No PC type given" unless params["pc_type"]