summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2012-05-09 15:41:42 +0000
committerChristoph Helma <helma@in-silico.ch>2012-05-09 15:41:42 +0000
commit577766d62353ea9c57b0459417aea25703882021 (patch)
tree61e030c4c6478af4a90e96d1b2fb292453928c56
parentbb118c23c0f1eee3aa7dfc913f2a964393f6aa50 (diff)
parentec48b70d5af790b61203e694f34aa8cadfaf6725 (diff)
Merge branch 'feature/task' of github.com:opentox/opentox-server into feature/task
-rw-r--r--lib/4store.rb1
-rw-r--r--lib/opentox.rb4
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