From 147e1b7351975f19697e1e6ff4a6106fd38174ae Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Wed, 23 Jan 2013 12:53:43 +0100 Subject: url_for removed auto insertion of RDF::DC.modified --- lib/4store.rb | 10 ++++++---- lib/compound.rb | 4 ++-- lib/opentox.rb | 2 +- lib/utils/html.rb | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) (limited to 'lib') 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 diff --git a/lib/compound.rb b/lib/compound.rb index da16c85..a0d6ec7 100644 --- a/lib/compound.rb +++ b/lib/compound.rb @@ -11,7 +11,7 @@ module OpenTox # @param [String] smiles Smiles string # @return [OpenTox::Compound] Compound def self.from_smiles service_uri, smiles, subjectid=nil - @smiles = smiles + #@smiles = smiles Compound.new RestClientWrapper.post(service_uri, smiles, {:content_type => 'chemical/x-daylight-smiles', :subjectid => subjectid}) end @@ -19,7 +19,7 @@ module OpenTox # @param [String] smiles InChI string # @return [OpenTox::Compound] Compound def self.from_inchi service_uri, inchi, subjectid=nil - @inchi = inchi + #@inchi = inchi Compound.new RestClientWrapper.post(service_uri, inchi, {:content_type => 'chemical/x-inchi', :subjectid => subjectid}) end diff --git a/lib/opentox.rb b/lib/opentox.rb index 0f29c30..877c5d5 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -104,7 +104,7 @@ module OpenTox # Save object at webservice def put wait=true # TODO: RDFXML - append RDF::DC.modified, DateTime.now + #append RDF::DC.modified, DateTime.now uri = RestClientWrapper.put @uri.to_s, self.to_ntriples, { :content_type => "text/plain", :subjectid => @subjectid} wait_for_task uri if wait end diff --git a/lib/utils/html.rb b/lib/utils/html.rb index d1fb323..4a4c9e1 100644 --- a/lib/utils/html.rb +++ b/lib/utils/html.rb @@ -34,7 +34,7 @@ module OpenTox def self.text_to_html( text, subjectid=nil, related_links=nil, description=nil, post_command=nil, png_image=nil ) # TODO add title as parameter - title = nil #$sinatra.url_for($sinatra.request.env['PATH_INFO'], :full) if $sinatra + title = nil #$sinatra.to($sinatra.request.env['PATH_INFO'], :full) if $sinatra html = "" html += ""+title+"" if title #html += "<\/img>" -- cgit v1.2.3