diff options
author | Christoph Helma <helma@in-silico.ch> | 2011-04-04 18:46:22 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2011-04-04 18:46:22 +0200 |
commit | 1daec5badcff31c591377017b32055aac775dbb7 (patch) | |
tree | a9dc4c5a1df87d13dd5127528b366081b403a1e2 /lib/parser.rb | |
parent | 2fcaf3cd3c68b8e679ecf77f70285778495d78c2 (diff) |
OT.isA substituted by RDF.type, identification of feature_types by RDF.type
Diffstat (limited to 'lib/parser.rb')
-rw-r--r-- | lib/parser.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/parser.rb b/lib/parser.rb index f33017d..cc5f1c8 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -55,7 +55,14 @@ module OpenTox parameter_ids = [] `rapper -i rdfxml -o ntriples #{file.path} 2>/dev/null`.each_line do |line| triple = line.to_triple - @metadata[triple[1]] = triple[2].split('^^').first if triple[0] == @uri and triple[1] != RDF['type'] + if triple[0] == @uri + if triple[1] == RDF.type # allow multiple types + @metadata[triple[1]] = [] unless @metadata[triple[1]] + @metadata[triple[1]] << triple[2].split('^^').first + else + @metadata[triple[1]] = triple[2].split('^^').first + end + end statements << triple parameter_ids << triple[2] if triple[1] == OT.parameters end @@ -289,7 +296,7 @@ module OpenTox else type = types.first end - @dataset.add_feature_metadata(feature,{OT.isA => type}) + @dataset.add_feature_metadata(feature,{RDF.type => [type]}) info += "\"#{@dataset.feature_name(feature)}\" detected as #{type.split('#').last}." # TODO: rewrite feature values |