diff options
author | Christoph Helma <helma@in-silico.ch> | 2012-06-28 09:24:33 +0000 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2012-06-28 09:24:33 +0000 |
commit | 57a231797d45cc328d10fc241a2f8046e87b7e7e (patch) | |
tree | 930b0bc29a8bbd234c1878eb421ca7d8686f8122 /application.rb | |
parent | ac948c6aa7a5d27cb8c6d2e2e5587b6337dc0f41 (diff) |
resultURI for text/uri-list
Diffstat (limited to 'application.rb')
-rw-r--r-- | application.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/application.rb b/application.rb index e0a33ab..072b715 100644 --- a/application.rb +++ b/application.rb @@ -23,8 +23,14 @@ module OpenTox get '/task/:id/?' do uri = uri("/task/#{params[:id]}") - rdf = FourStore.get(uri, request.env['HTTP_ACCEPT']) - halt status_code(uri), rdf + if request.env['HTTP_ACCEPT'] == "text/uri-list" # return resultURI + sparql = "SELECT ?o WHERE { GRAPH <#{uri}> { <#{uri}> <#{RDF::OT.resultURI}> ?o. } }" + result_uri = Backend::FourStore.query(sparql,nil).last.gsub(/"|'/,'').gsub(/\^\^.*$/,'') + halt status_code(uri), result_uri + else + rdf = FourStore.get(uri, request.env['HTTP_ACCEPT']) + halt status_code(uri), rdf + end end put '/task/:id/:status/?' do |