summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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