summaryrefslogtreecommitdiff
path: root/lib/parser.rb
diff options
context:
space:
mode:
authormr <mr@mrautenberg.de>2011-05-25 13:37:06 +0200
committermr <mr@mrautenberg.de>2011-05-25 13:37:06 +0200
commitd5bf9fd2b7f4401c36d00ab6afb1a003fdb07d2f (patch)
treedb88d9b1a7f01f7a24a597a05b293d9307dc1d3f /lib/parser.rb
parent796ef9b86fcdcf5f9520b958c09cb37ae1374bf4 (diff)
parent52e73a3da8e99da9a0a973b6ef9934297bc6511e (diff)
Merge branch 'development' of github.com:opentox/opentox-ruby into development
Diffstat (limited to 'lib/parser.rb')
-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