diff options
author | gebele <gebele@in-silico.ch> | 2013-02-08 17:27:39 +0000 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2013-02-08 17:27:39 +0000 |
commit | 8fd10bbf42654d5b367713258b26acdeb47d7c4c (patch) | |
tree | 1e05b1af284668b0cf5219141edd3c5fff90ec26 /lib | |
parent | 2d7909789e3a4ee3c669125fb1f09fe3b4577de8 (diff) |
implemented json support for user uri list
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 c9947a7..c7c4eb3 100644 --- a/lib/4store.rb +++ b/lib/4store.rb @@ -55,10 +55,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/ |