diff options
author | mguetlein <martin.guetlein@gmail.com> | 2011-02-10 17:39:17 +0100 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2011-02-10 17:39:17 +0100 |
commit | 1e2d28baa88f3a021604787c1356d6be1077be7e (patch) | |
tree | 792fad10aca0c42a7a79c71d4b24757a4eb36427 | |
parent | 85096197c1618cea45d7a1a8d5e4810ce1166083 (diff) |
adjust rdf dataset parsing: take XSD type into account
-rw-r--r-- | lib/parser.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/parser.rb b/lib/parser.rb index a2a96be..c8a573f 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -165,7 +165,13 @@ module OpenTox File.delete(file.path) data.each do |id,entry| entry[:values].each do |value_id| - value = feature_values[value_id].split(/\^\^/).first # remove XSD.type + split = feature_values[value_id].split(/\^\^/) + case split[-1] + when XSD.double + value = split.first.to_f + else + value = split.first + end @dataset.add entry[:compound],feature[value_id],value end end |