From 1daec5badcff31c591377017b32055aac775dbb7 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 4 Apr 2011 18:46:22 +0200 Subject: OT.isA substituted by RDF.type, identification of feature_types by RDF.type --- lib/model.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/model.rb') 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] -- cgit v1.2.3