diff options
Diffstat (limited to 'lib/4store.rb')
-rw-r--r-- | lib/4store.rb | 10 |
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 |