diff options
author | Christoph Helma <helma@in-silico.ch> | 2012-05-09 15:41:42 +0000 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2012-05-09 15:41:42 +0000 |
commit | 577766d62353ea9c57b0459417aea25703882021 (patch) | |
tree | 61e030c4c6478af4a90e96d1b2fb292453928c56 | |
parent | bb118c23c0f1eee3aa7dfc913f2a964393f6aa50 (diff) | |
parent | ec48b70d5af790b61203e694f34aa8cadfaf6725 (diff) |
Merge branch 'feature/task' of github.com:opentox/opentox-server into feature/task
-rw-r--r-- | lib/4store.rb | 1 | ||||
-rw-r--r-- | lib/opentox.rb | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/4store.rb b/lib/4store.rb index 5ccc8a2..f2e3fcd 100644 --- a/lib/4store.rb +++ b/lib/4store.rb @@ -122,6 +122,7 @@ module OpenTox end def self.available? uri + #sparql = "SELECT DISTINCT ?s WHERE {GRAPH <#{uri}> {?s ?p ?o} }" sparql = "SELECT DISTINCT ?s WHERE {GRAPH <#{uri}> {?s <#{RDF.type}> <#{klass}>} }" r = query(sparql, nil) r.size == 1 and r.first == uri diff --git a/lib/opentox.rb b/lib/opentox.rb index 86fcd9c..31a6e82 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -64,13 +64,13 @@ module OpenTox # Create a new resource post "/#{SERVICE}/?" do uri = uri("/#{SERVICE}/#{SecureRandom.uuid}") - FourStore.post(uri, @body, @content_type) + FourStore.put(uri, @body, @content_type) response['Content-Type'] = "text/uri-list" uri end # Get resource representation - get "/#{SERVICE}/id/?" do + get "/#{SERVICE}/:id/?" do FourStore.get(uri("/#{SERVICE}/#{params[:id]}"), request.env['HTTP_ACCEPT']) end |