diff options
author | Christoph Helma <helma@in-silico.ch> | 2011-06-22 13:02:49 +0000 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2011-06-22 13:02:49 +0000 |
commit | 5d5db79f2b1833e77b9cb5ded5b74835bc99f9c7 (patch) | |
tree | 88202960547cd0531d287d27ccdbdc74f210bf13 | |
parent | c6754d38f7c2e653d523c323d50fa0b690fd6968 (diff) |
attempt fo fix load_metadata
-rw-r--r-- | lib/parser.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/parser.rb b/lib/parser.rb index 90a997b..79c2017 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -57,12 +57,12 @@ module OpenTox `rapper -i rdfxml -o ntriples #{file.path} 2>/dev/null`.each_line do |line| triple = line.to_triple if triple[0] == @uri - if triple[1] == RDF.type || triple[1]==OT.predictedVariables # allow multiple types + #if triple[1] == RDF.type || triple[1]==OT.predictedVariables # 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 + #else + #@metadata[triple[1]] = triple[2].split('^^').first + #end end statements << triple parameter_ids << triple[2] if triple[1] == OT.parameters @@ -76,6 +76,9 @@ module OpenTox @metadata[OT.parameters] << parameter end end + @metadata.each do |k,v| + v = v.first if v.size == 1 + end @metadata end |