summaryrefslogtreecommitdiff
path: root/lib/opentox-client.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2013-07-10 14:36:39 +0200
committerChristoph Helma <helma@in-silico.ch>2013-07-10 14:36:39 +0200
commitddb83b4302e8628b333402d24e3e05fc90b3faef (patch)
tree39c8645d09f6e1ecee1d97ae4faa21e399e17ad4 /lib/opentox-client.rb
parent3262e3cf2ed1ce896dcd11d9c1bde5222ea720ce (diff)
subjectids partially removed
Diffstat (limited to 'lib/opentox-client.rb')
-rw-r--r--lib/opentox-client.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/opentox-client.rb b/lib/opentox-client.rb
index f25f05a..77c6eae 100644
--- a/lib/opentox-client.rb
+++ b/lib/opentox-client.rb
@@ -26,7 +26,6 @@ RDF::TB = RDF::Vocabulary.new "http://onto.toxbank.net/api/"
RDF::ISA = RDF::Vocabulary.new "http://onto.toxbank.net/isa/"
RDF::OWL = RDF::Vocabulary.new "http://www.w3.org/2002/07/owl#"
-#CLASSES = ["Generic", "Compound", "Feature", "Dataset", "Algorithm", "Model", "Validation", "Task", "Investigation"]
CLASSES = ["Compound", "Feature", "Dataset", "Validation", "Task", "Investigation"]
RDF_FORMATS = [:rdfxml,:ntriples,:turtle]
@@ -51,3 +50,12 @@ FALSE_REGEXP = /^(false|inactive|0|0.0|low tox|deactivating|non-carcinogen|non-m
"validation.rb"
].each{ |f| require_relative f }
+module OpenTox
+ if defined?($aa) and $aa[:uri]
+ SUBJECTID = OpenTox::Authorization.authenticate($aa[:user],$aa[:password])
+ unauthorized_error "Failed to authenticate user \"#{$aa[:user]}\"." unless OpenTox::Authorization.is_token_valid(SUBJECTID)
+ else
+ SUBJECTID = nil
+ end
+end
+