summaryrefslogtreecommitdiff
path: root/lib/model.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2011-04-04 18:46:22 +0200
committerChristoph Helma <helma@in-silico.ch>2011-04-04 18:46:22 +0200
commit1daec5badcff31c591377017b32055aac775dbb7 (patch)
treea9dc4c5a1df87d13dd5127528b366081b403a1e2 /lib/model.rb
parent2fcaf3cd3c68b8e679ecf77f70285778495d78c2 (diff)
OT.isA substituted by RDF.type, identification of feature_types by RDF.type
Diffstat (limited to 'lib/model.rb')
-rw-r--r--lib/model.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/model.rb b/lib/model.rb
index 74408d8..422acd2 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -44,11 +44,10 @@ module OpenTox
load_metadata(subjectid) if @metadata==nil or @metadata.size==0 or (@metadata.size==1 && @metadata.values[0]==@uri)
algorithm = OpenTox::Algorithm::Generic.find(@metadata[OT.algorithm], subjectid)
algorithm_title = algorithm ? algorithm.metadata[DC.title] : nil
- algorithm_type = algorithm ? algorithm.metadata[OT.isA] : nil
+ algorithm_type = algorithm ? algorithm.metadata[RDF.type] : nil
dependent_variable = OpenTox::Feature.find( @metadata[OT.dependentVariables],subjectid )
dependent_variable_type = dependent_variable ? dependent_variable.feature_type : nil
- type_indicators = [dependent_variable_type, @metadata[OT.isA], @metadata[DC.title],
- @uri, algorithm_type, algorithm_title]
+ type_indicators = [dependent_variable_type, @metadata[RDF.type], @metadata[DC.title], @uri, algorithm_type, algorithm_title].flatten
type_indicators.each do |type|
case type
when /(?i)classification/
@@ -187,7 +186,7 @@ module OpenTox
if @neighbors.size == 0
@prediction_dataset.add_feature(prediction_feature_uri, {
- OT.isA => OT.MeasuredFeature,
+ RDF.type => [OT.MeasuredFeature],
OT.hasSource => @uri,
DC.creator => @uri,
DC.title => URI.decode(File.basename( @metadata[OT.dependentVariables] )),
@@ -198,7 +197,7 @@ module OpenTox
else
@prediction_dataset.add_feature(prediction_feature_uri, {
- OT.isA => OT.ModelPrediction,
+ RDF.type => [OT.ModelPrediction],
OT.hasSource => @uri,
DC.creator => @uri,
DC.title => URI.decode(File.basename( @metadata[OT.dependentVariables] )),
@@ -215,7 +214,7 @@ module OpenTox
feature_uri = File.join( @prediction_dataset.uri, "feature", "descriptor", f.to_s)
features[feature] = feature_uri
@prediction_dataset.add_feature(feature_uri, {
- OT.isA => OT.Substructure,
+ RDF.type => [OT.Substructure],
OT.smarts => feature,
OT.pValue => @p_values[feature],
OT.effect => @effects[feature]
@@ -236,7 +235,7 @@ module OpenTox
OT.compound => neighbor[:compound],
OT.similarity => neighbor[:similarity],
OT.measuredActivity => neighbor[:activity],
- OT.isA => OT.Neighbor
+ RDF.type => [OT.Neighbor]
})
@prediction_dataset.add @compound.uri, neighbor_uri, true
f = 0 unless f
@@ -250,7 +249,7 @@ module OpenTox
unless features.has_key? feature
features[feature] = feature_uri
@prediction_dataset.add_feature(feature_uri, {
- OT.isA => OT.Substructure,
+ RDF.type => [OT.Substructure],
OT.smarts => feature,
OT.pValue => @p_values[feature],
OT.effect => @effects[feature]