blob: 8032533283b8115d69028c4668262069dc0ee89a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
module OpenTox
# Ruby wrapper for OpenTox Dataset Webservices (http://opentox.org/dev/apis/api-1.2/dataset).
class Dataset
def data_entries
# TODO fix for api 1.2
data_entries = []
pull
@reload = false
metadata[RDF::OT1.dataEntry].collect{|data_entry|
data_entries << @rdf.to_hash[data_entry]
}
@reload = true
data_entries
end
def compounds
uri = File.join(@uri,"compounds")
RestClientWrapper.get(uri,{},{:accept => "text/uri-list", :subjectid => @subjectid}).split("\n").collect{|uri| OpenTox::Compound.new uri}
end
def features
uri = File.join(@uri,"features")
RestClientWrapper.get(uri,{},{:accept => "text/uri-list", :subjectid => @subjectid}).split("\n").collect{|uri| OpenTox::Feature.new uri}
end
end
end
|