diff options
author | Christoph Helma <helma@in-silico.ch> | 2013-02-11 11:09:00 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2013-02-11 11:09:00 +0100 |
commit | 7d4589e10bc386acb703ce3fcbed3c4540326d51 (patch) | |
tree | 853f3b155211a6559b17dcdba888fbac977ca115 /lib | |
parent | 51db9ac6a532fce91a9e4448db3dae1272a9600c (diff) | |
parent | 8fd10bbf42654d5b367713258b26acdeb47d7c4c (diff) |
Merge branch 'development' of github.com:opentox/opentox-client into development
Diffstat (limited to 'lib')
-rw-r--r-- | lib/4store.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/4store.rb b/lib/4store.rb index 32d8817..e6eb914 100644 --- a/lib/4store.rb +++ b/lib/4store.rb @@ -57,10 +57,12 @@ module OpenTox def self.query sparql, mime_type if sparql =~ /SELECT/i -# return list unless mime_type + # return list unless mime_type case mime_type when 'application/sparql-results+xml' RestClient.get(sparql_uri, :params => { :query => sparql }, :accept => mime_type).body + when 'application/json' + RestClient.get(sparql_uri, :params => { :query => sparql }, :accept => mime_type).body when /(uri-list|html)/ uri_list = RestClient.get(sparql_uri, :params => { :query => sparql }, :accept => "text/plain").body.gsub(/"|<|>/,'').split("\n").drop(1).join("\n") uri_list = OpenTox.text_to_html(uri_list) if mime_type=~/html/ |