From ddb83b4302e8628b333402d24e3e05fc90b3faef Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Wed, 10 Jul 2013 14:36:39 +0200 Subject: subjectids partially removed --- lib/opentox-client.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/opentox-client.rb') 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 + -- cgit v1.2.3