summaryrefslogtreecommitdiff
path: root/lib/4store.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2013-01-23 12:53:43 +0100
committerChristoph Helma <helma@in-silico.ch>2013-01-23 12:53:43 +0100
commit147e1b7351975f19697e1e6ff4a6106fd38174ae (patch)
treebfae2caf360efdc9631a376f4341a9b9c3ecbf7b /lib/4store.rb
parentcc8dfb6c1344c2d37fafa932ac945468cbd00b2a (diff)
url_for removed
auto insertion of RDF::DC.modified
Diffstat (limited to 'lib/4store.rb')
-rw-r--r--lib/4store.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/4store.rb b/lib/4store.rb
index c9947a7..32d8817 100644
--- a/lib/4store.rb
+++ b/lib/4store.rb
@@ -29,6 +29,7 @@ module OpenTox
mime_type = "application/x-turtle" if mime_type == "text/plain" # ntriples is turtle in 4store
begin
RestClient.post File.join(four_store_uri,"data")+"/", :data => rdf, :graph => uri, "mime-type" => mime_type
+ update "INSERT DATA { GRAPH <#{uri}> { <#{uri}> <#{RDF::DC.modified}> \"#{DateTime.now}\" } }"
rescue
bad_request_error $!.message, File.join(four_store_uri,"data")+"/"
end
@@ -38,11 +39,12 @@ module OpenTox
bad_request_error "'#{mime_type}' is not a supported content type. Please use one of #{@@content_type_formats.join(", ")}." unless @@content_type_formats.include? mime_type
bad_request_error "Reqest body empty." unless rdf
mime_type = "application/x-turtle" if mime_type == "text/plain"
- #begin
+ begin
RestClientWrapper.put File.join(four_store_uri,"data",uri), rdf, :content_type => mime_type
- #rescue
- #bad_request_error $!.message, File.join(four_store_uri,"data",uri)
- #end
+ update "INSERT DATA { GRAPH <#{uri}> { <#{uri}> <#{RDF::DC.modified}> \"#{DateTime.now}\" } }"
+ rescue
+ bad_request_error $!.message, File.join(four_store_uri,"data",uri)
+ end
end
def self.delete uri