summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2012-06-28 10:11:03 +0000
committerChristoph Helma <helma@in-silico.ch>2012-06-28 10:11:03 +0000
commit81b72e1469ceec8c88e3ca621706dda5ded49f89 (patch)
tree134ea03342ab4da47cb1a5b9baec4a268a97b96a
parent57a231797d45cc328d10fc241a2f8046e87b7e7e (diff)
empty resultURI for running tasks
-rw-r--r--application.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/application.rb b/application.rb
index 072b715..56c297f 100644
--- a/application.rb
+++ b/application.rb
@@ -23,13 +23,15 @@ module OpenTox
get '/task/:id/?' do
uri = uri("/task/#{params[:id]}")
+ code = status_code(uri)
if request.env['HTTP_ACCEPT'] == "text/uri-list" # return resultURI
+ halt code, "" unless code == 200
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
+ halt code, result_uri
else
rdf = FourStore.get(uri, request.env['HTTP_ACCEPT'])
- halt status_code(uri), rdf
+ halt code, rdf
end
end