diff options
author | Martin Gütlein <martin.guetlein@gmail.com> | 2010-01-07 08:56:18 +0100 |
---|---|---|
committer | Martin Gütlein <martin.guetlein@gmail.com> | 2010-01-07 08:56:18 +0100 |
commit | be07d3be0cc3236a22a47f0905c99f96508c9587 (patch) | |
tree | 177d8226a8196b5937232c710bbbd161c7197ed2 /lib/dataset.rb | |
parent | 89bc8a67e63cf8e752f3b89aa52f7db87ce7ea7f (diff) |
minor changes: no nil classification, fix create datasets (no my librdf version)
Diffstat (limited to 'lib/dataset.rb')
-rw-r--r-- | lib/dataset.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb index 30f9644..0e7df13 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -47,8 +47,9 @@ module OpenTox @model.add tuple, OT['complexValue'], complex_value @model.add complex_value, RDF['type'], OT["FeatureValue"] @model.add complex_value, OT['feature'], f - @model.add complex_value, OT['value'], value.to_s - end + @model.add complex_value, OT['value'], value.to_s + end + tuple end @@ -77,7 +78,7 @@ module OpenTox end def self.create(data, content_type = 'application/rdf+xml') - uri = RestClient.post @@config[:services]["opentox-dataset"], data, :content_type => content_type + uri = RestClient.post @@config[:services]["opentox-dataset"], data, :content_type => content_type dataset = Dataset.new dataset.read uri.to_s dataset @@ -85,9 +86,10 @@ module OpenTox def self.find(uri) begin - RestClient.get uri, :accept => 'application/rdf+xml' # check if the resource is available - dataset = Dataset.new - dataset.read uri.to_s + data = RestClient.get uri, :accept => 'application/rdf+xml' # check if the resource is available + dataset = Dataset.new + dataset.rdf= data + dataset rescue nil @@ -222,8 +224,7 @@ module OpenTox :source => self.source, :identifier => self.identifier, :compounds => self.compounds.collect{|c| c.to_s.to_s.sub(/^\[(.*)\]$/,'\1')}, - :features => self.features.collect{|f| f.to_s }, - :data_entries => self.data_entries, + :features => self.features.collect{|f| f.to_s } }.to_yaml end |