diff options
Diffstat (limited to 'lib/4store.rb')
-rw-r--r-- | lib/4store.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/4store.rb b/lib/4store.rb index 77fa045..b8aaca9 100644 --- a/lib/4store.rb +++ b/lib/4store.rb @@ -35,18 +35,21 @@ module OpenTox bad_request_error "Request body empty." unless rdf mime_type = "application/x-turtle" if mime_type == "text/plain" # ntriples is turtle in 4store RestClient.post File.join(four_store_uri,"data")+"/", :data => rdf.gsub(/\\C/,'C'), :graph => uri, "mime-type" => mime_type # remove backslashes in SMILES (4store interprets them as UTF-8 \C even within single quoates) - update "INSERT DATA { GRAPH <#{uri}> { <#{uri}> <#{RDF::DC.modified}> \"#{DateTime.now}\" } }" + #update "INSERT DATA { GRAPH <#{uri}> { <#{uri}> <#{RDF::DC.modified}> \"#{DateTime.now}\" } }" end def self.put uri, rdf, mime_type 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" - RestClientWrapper.put File.join(four_store_uri,"data",uri), rdf, :content_type => mime_type - update "WITH <#{uri}> - DELETE {<#{uri}> <{RDF::DC.modified}> ?o} - WHERE {<#{uri}> <{RDF::DC.modified}> ?o}; - INSERT DATA { GRAPH <#{uri}> { <#{uri}> <#{RDF::DC.modified}> \"#{DateTime.now}\" } }" + RestClientWrapper.put File.join(four_store_uri,"data",uri), rdf, :content_type => mime_type +# update moved to opentox-client to improve performance + #update "INSERT DATA { GRAPH <#{uri}> { <#{uri}> <#{RDF::DC.modified}> \"#{DateTime.now}\" } }" +# RestClientWrapper.put File.join(four_store_uri,"data",uri), rdf, :content_type => mime_type +# update "WITH <#{uri}> +# DELETE {<#{uri}> <{RDF::DC.modified}> ?o} +# WHERE {<#{uri}> <{RDF::DC.modified}> ?o}; +# INSERT DATA { GRAPH <#{uri}> { <#{uri}> <#{RDF::DC.modified}> \"#{DateTime.now}\" } }" end def self.delete uri |