diff options
author | mguetlein <martin.guetlein@gmail.com> | 2010-08-23 15:49:04 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2010-08-23 15:49:04 +0200 |
commit | b06b7c7d3312e6b913ee9e6c35d0cfe93137756c (patch) | |
tree | 829cab30f9cc973567c568e7c998d7c49d0f00fc /lib | |
parent | e8188766495356ef156c957316ab2fea368dd271 (diff) |
owl-fix for nil-compounds
Diffstat (limited to 'lib')
-rw-r--r-- | lib/model.rb | 6 | ||||
-rw-r--r-- | lib/owl.rb | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/model.rb b/lib/model.rb index e8f6048..fb25126 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -28,13 +28,13 @@ module OpenTox if ENV['RACK_ENV'] =~ /test|debug/ begin raise "uri invalid" unless Utils.is_uri?(@uri) - raise "no algorithm" unless @algorithm and @algorithm.size>0 - raise "no dependent variables" unless @dependentVariables and @dependentVariables.size>0 - raise "no indenpendent variables" unless @independentVariables raise "no predicted variables" unless @predictedVariables and @predictedVariables.size>0 rescue => ex RestClientWrapper.raise_uri_error "invalid model: '"+ex.message+"'\n"+self.to_yaml+"\n",@uri.to_s end + LOGGER.warn "model has no dependent variable" unless @dependentVariables and @dependentVariables.size>0 + LOGGER.warn "model has no algorithm" unless @algorithm and @algorithm.size>0 + LOGGER.warn "model has no indenpendent variables" unless @independentVariables end end end @@ -518,6 +518,11 @@ module OpenTox value_node = value_nodes[0] compound_uri = get_value( @model.object(value_node, node('compound')) ) + unless compound_uri + LOGGER.warn "'compound' missing for data-entry of feature "+feature_uri.to_s+ + ", value: "+@model.object(feature_value_node,node("value")).to_s + next + end value_node_type = @model.object(feature_value_node, RDF_TYPE) if (value_node_type == node('FeatureValue')) |