summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/dataset.rb13
-rw-r--r--lib/opentox.rb1
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb
index 8032533..1367d3f 100644
--- a/lib/dataset.rb
+++ b/lib/dataset.rb
@@ -4,13 +4,18 @@ module OpenTox
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]
- }
+ begin
+ metadata[RDF::OT.dataEntry].collect{|data_entry| data_entries << @rdf.to_hash[data_entry] }
+ rescue
+ end
+ begin
+ # TODO: remove API 1.1
+ metadata[RDF::OT1.dataEntry].collect{|data_entry| data_entries << @rdf.to_hash[data_entry] }
+ rescue
+ end
@reload = true
data_entries
end
diff --git a/lib/opentox.rb b/lib/opentox.rb
index f79b51b..b282ed2 100644
--- a/lib/opentox.rb
+++ b/lib/opentox.rb
@@ -120,6 +120,7 @@ module OpenTox
def from_file service_uri, filename, subjectid=nil
file = File.new filename
+ # TODO: sdf files are incorrectly detected
from_uri RestClientWrapper.post(service_uri, {:file => file}, {:subjectid => subjectid, :content_type => file.mime_type, :accept => "text/uri-list"}), subjectid
end