diff options
author | Christoph Helma <helma@in-silico.ch> | 2011-04-04 18:46:22 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2011-04-04 18:46:22 +0200 |
commit | 1daec5badcff31c591377017b32055aac775dbb7 (patch) | |
tree | a9dc4c5a1df87d13dd5127528b366081b403a1e2 /lib/ontology.rb | |
parent | 2fcaf3cd3c68b8e679ecf77f70285778495d78c2 (diff) |
OT.isA substituted by RDF.type, identification of feature_types by RDF.type
Diffstat (limited to 'lib/ontology.rb')
-rw-r--r-- | lib/ontology.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/ontology.rb b/lib/ontology.rb index c3952c3..fa4ea6f 100644 --- a/lib/ontology.rb +++ b/lib/ontology.rb @@ -1,6 +1,7 @@ module OpenTox module Ontology module Echa +=begin require 'sparql/client' @sparql = SPARQL::Client.new("http://apps.ideaconsult.net:8080/ontology") def self.qs(classname="Endpoints") @@ -38,17 +39,16 @@ module OpenTox out += "</select>\n" return out end +=end - def self.endpoints#(endpoint="Endpoints") - endpoint_datasets = {} - RestClientWrapper.get("http://apps.ideaconsult.net:8080/ambit2/query/ndatasets_endpoint",:accept => "text/csv").each do |line| - if line.match(/^http/) - e = line.split(',') - endpoint_datasets["#{e.first} (#{e[1]})"] = RestClientWrapper.get(e.last, :accept => "text/uri-list").split("\n")#[0..e[1].to_i-1] # hack to get only the first count entries - end - end - endpoint_datasets + def self.endpoints + RestClientWrapper.get("http://apps.ideaconsult.net:8080/ambit2/query/ndatasets_endpoint",:accept => "text/csv").collect { |line| line.split(',').first if line.match(/^http/) }.compact + end + + def self.datasets(endpoint) + RestClientWrapper.get("http://apps.ideaconsult.net:8080/ambit2/dataset?feature_sameas=#{URI.encode endpoint}", :accept => "text/uri-list").split("\n") end + end end |