From 8fd10bbf42654d5b367713258b26acdeb47d7c4c Mon Sep 17 00:00:00 2001 From: gebele Date: Fri, 8 Feb 2013 17:27:39 +0000 Subject: implemented json support for user uri list --- lib/4store.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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/ -- cgit v1.2.3