diff options
author | Andreas Maunz <andreas@maunz.de> | 2012-10-10 14:59:21 +0200 |
---|---|---|
committer | Andreas Maunz <andreas@maunz.de> | 2012-10-10 14:59:21 +0200 |
commit | 86dc7c291f06035b2b10df8605417cc14346f22d (patch) | |
tree | 324d207d18fc97c06cdfbde0aa22d05e16a0f439 /application.rb | |
parent | 96234eff3ea35c528eea524eb39afa8624177fd8 (diff) |
Metadata, params for PC
Diffstat (limited to 'application.rb')
-rw-r--r-- | application.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/application.rb b/application.rb index b8243d2..a42bc01 100644 --- a/application.rb +++ b/application.rb @@ -163,17 +163,20 @@ module OpenTox feature[RDF::DC.title] = f features << feature values = table.collect{|row| row[i+1].strip unless row[i+1].nil?}.uniq.compact # skip compound column + low_diff_values=false if values.size <= 3 # max classes feature.append RDF.type, RDF::OT.NominalFeature feature.append RDF.type, RDF::OT.StringFeature feature[RDF::OT.acceptValue] = values + low_diff_values=true + end + types = values.collect{|v| feature_type(v)}.uniq + if types.include? RDF::OT.NominalFeature and !low_diff_values + feature.append RDF.type, RDF::OT.NominalFeature else - types = values.collect{|v| feature_type(v)} - if types.include?(RDF::OT.NominalFeature) - @warnings << "Feature #{f} contains nominal and numeric values." - else - feature.append RDF.type, RDF::OT.NumericFeature - end + types.each { |t| + feature.append RDF.type, t unless t.nil? + } end feature.put ntriples << "<#{feature.uri}> <#{RDF.type}> <#{RDF::OT.Feature}>." |