summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2015-07-23 16:31:29 +0200
committergebele <gebele@in-silico.ch>2015-07-23 16:31:29 +0200
commit47a011106462791afc7d091cf612e3c7fa53c145 (patch)
tree22864b63e63e5734ca376dfa4f3b1a0be928e19c
parent9eb81dec2bdcfd7b5d2c9471006e9b428347de9d (diff)
escape \C characters
-rw-r--r--lib/4store.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/4store.rb b/lib/4store.rb
index 98bd575..dcc4d38 100644
--- a/lib/4store.rb
+++ b/lib/4store.rb
@@ -35,7 +35,7 @@ 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 or mime_type == "multipart/form-data"
bad_request_error "Request body empty." unless rdf
mime_type = "application/x-turtle" if mime_type == "text/plain" # ntriples is turtle in 4store
- RestClientWrapper.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)
+ RestClientWrapper.post File.join(four_store_uri,"data")+"/", :data => rdf.gsub(/\\C|\\\\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}\" } }"
end
@@ -43,7 +43,7 @@ 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"
- RestClientWrapper.put File.join(four_store_uri,"data",uri), rdf.gsub(/\\C/,'C'), :content_type => mime_type # remove backslashes in SMILES (4store interprets them as UTF-8 \C even within single quoates)
+ RestClientWrapper.put File.join(four_store_uri,"data",uri), rdf.gsub(/\\C|\\\\C/,'C'), :content_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}\" } }"
end