summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2011-05-24 16:10:10 +0200
committermguetlein <martin.guetlein@gmail.com>2011-05-24 16:10:10 +0200
commitfe85fafc4b24cc8275ad67536d25d660249bb792 (patch)
tree3770f45b0936d49eccbae64e5451ea0809ff9ece
parent524bda5ac60e07aa0805bfb215da718157849672 (diff)
adjust dataset-parser: predictedVariables may be array, do not request id/features from ambit services as not supported
-rw-r--r--lib/parser.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/parser.rb b/lib/parser.rb
index 5f847c3..a6878a2 100644
--- a/lib/parser.rb
+++ b/lib/parser.rb
@@ -56,7 +56,7 @@ 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 # 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
@@ -228,7 +228,11 @@ module OpenTox
file = Tempfile.new("ot-rdfxml")
# do not concat /features to uri string, this would not work for dataset/R401577?max=3
uri = URI::parse(@uri)
- uri.path = File.join(uri.path,"features")
+ # PENDING
+ # ambit models return http://host/dataset/id?feature_uris[]=sth but
+ # amibt dataset services does not support http://host/dataset/id/features?feature_uris[]=sth
+ # -> load features from complete dataset
+ uri.path = File.join(uri.path,"features") unless @uri=~/\?feature_uris\[\]/
uri = uri.to_s
file.puts OpenTox::RestClientWrapper.get uri,{:subjectid => subjectid,:accept => "application/rdf+xml"},nil,false
file.close