diff options
author | gebele <gebele@in-silico.ch> | 2012-06-14 16:41:52 +0200 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2012-06-14 16:41:52 +0200 |
commit | bc9a8df2f200ecdb4fe4dc7de8cc644b3a038105 (patch) | |
tree | 1dfeddb3782ff2b12dcd76a5b90cde52ac0cb998 | |
parent | ca0ac867535d38c0f6e59332b85c8da6f23f372d (diff) |
uri-list selector host/service
-rw-r--r-- | lib/4store.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/4store.rb b/lib/4store.rb index f2e3fcd..11c8f27 100644 --- a/lib/4store.rb +++ b/lib/4store.rb @@ -81,8 +81,9 @@ module OpenTox def self.query sparql, mime_type if sparql =~ /SELECT/i return RestClient.get(sparql_uri, :params => { :query => sparql }, :accept => mime_type).body.gsub(/<|>/,'').split("\n") if mime_type == 'application/sparql-results+xml' - list = RestClient.get(sparql_uri, :params => { :query => sparql }, :accept => "text/plain").body.gsub(/<|>/,'').split("\n") - list.shift + list = RestClient.get(sparql_uri, :params => { :query => sparql }, :accept => "text/plain").body.gsub(/<|>/,'').split("\n") + h = `hostname -f`.strip + list.keep_if{|v| v =~ /#{h}\/#{SERVICE}/} return list unless mime_type case mime_type when /json/ |