From 9a523f0fb2d5ee0058af5b5b82e01f39549f68fb Mon Sep 17 00:00:00 2001 From: mguetlein Date: Wed, 9 Feb 2011 14:06:12 +0100 Subject: fix rdf parsing to work with ambit dataset service with a&a, minor changes --- lib/model.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/model.rb') 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 -- cgit v1.2.3