diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-02-09 14:06:12 +0100 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-02-09 14:06:12 +0100 |
commit | 9a523f0fb2d5ee0058af5b5b82e01f39549f68fb (patch) | |
tree | 5e50e6630112c3b647ea13ba27c2c919772d155c /lib/model.rb | |
parent | f907690dc7d3f82c75a51718a3abfa7750dedaa5 (diff) |
fix rdf parsing to work with ambit dataset service with a&a, minor changes
Diffstat (limited to 'lib/model.rb')
-rw-r--r-- | lib/model.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/model.rb b/lib/model.rb index 64d178f..9622d65 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -43,9 +43,11 @@ module OpenTox @algorithm = OpenTox::Algorithm::Generic.find(@metadata[OT.algorithm], subjectid) unless @algorithm algorithm_title = @algorithm ? @algorithm.metadata[DC.title] : nil + algorithm_type = @algorithm ? @algorithm.metadata[OT.isA] : nil @dependentVariable = OpenTox::Feature.find( @metadata[OT.dependentVariables],subjectid ) unless @dependentVariable - - [@dependentVariable.feature_type, @metadata[OT.isA], @metadata[DC.title], @uri, algorithm_title].each do |type| + type_indicators = [@dependentVariable.feature_type, @metadata[OT.isA], @metadata[DC.title], + @uri, algorithm_type, algorithm_title] + type_indicators.each do |type| case type when /(?i)classification/ return "classification" @@ -53,8 +55,7 @@ module OpenTox return "regression" end end - raise "unknown model "+[@dependentVariable.feature_type, @metadata[OT.isA], - @metadata[DC.title], @uri, algorithm_title].inspect + raise "unknown model "+type_indicators.inspect end end |