summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.de>2010-03-15 13:41:07 +0100
committerChristoph Helma <helma@in-silico.de>2010-03-15 13:41:07 +0100
commite4a1f0b1c7444cb3fd6218c115e0f414d9b68958 (patch)
tree4ef1b6a212c6ae6ae3b0d9ed84743fe8aa2a7a99 /lib
parent8657902cae694470dc316b60a186a8dcc9f84f07 (diff)
small modification to internal yaml representation
Diffstat (limited to 'lib')
-rw-r--r--lib/dataset.rb35
-rw-r--r--lib/owl.rb2
2 files changed, 16 insertions, 21 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb
index 5caaa2c..468af04 100644
--- a/lib/dataset.rb
+++ b/lib/dataset.rb
@@ -11,17 +11,11 @@ module OpenTox
@data = {}
@features = []
@compounds = []
- #super
end
def self.find(uri)
- #dataset = Dataset.new
- LOGGER.debug "Getting data from #{uri}"
- YAML.load RestClient.get(uri, :accept => 'application/x-yaml').to_s # unclear why this does not work for complex uris, Dataset.find works from irb
- #data = `curl "#{uri}"`
- #LOGGER.debug data
- #dataset.rdf = data
- #dataset
+ #LOGGER.debug "Getting data from #{uri}"
+ YAML.load RestClient.get(uri, :accept => 'application/x-yaml').to_s
end
@@ -29,18 +23,19 @@ module OpenTox
LOGGER.debug "Saving dataset"
@features.uniq!
@compounds.uniq!
- #task_uri = RestClient.post(@@config[:services]["opentox-dataset"], self.rdf, :content_type => "application/rdf+xml").to_s
- task_uri = RestClient::Resource.new(@@config[:services]["opentox-dataset"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0]).post(self.to_yaml, :content_type => "application/x-yaml").chomp.to_s
- task = OpenTox::Task.find(task_uri)
- LOGGER.debug "Waiting for task #{task_uri}"
- task.wait_for_completion
- LOGGER.debug "Dataset task #{task_uri} completed"
- if task.failed?
- LOGGER.error "Saving dataset failed"
- task.failed
- exit
- end
- task.resource
+ #task_uri = RestClient::Resource.new(@@config[:services]["opentox-dataset"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0]).post(self.to_yaml, :content_type => "application/x-yaml").chomp.to_s
+ uri = RestClient::Resource.new(@@config[:services]["opentox-dataset"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0]).post(self.to_yaml, :content_type => "application/x-yaml").chomp.to_s
+ #task = OpenTox::Task.find(task_uri)
+ #LOGGER.debug "Waiting for task #{task_uri}"
+ #task.wait_for_completion
+ #LOGGER.debug "Dataset task #{task_uri} completed"
+ #if task.failed?
+ #LOGGER.error "Saving dataset failed"
+ #task.failed
+ #exit
+ #end
+ #task.resource
+ uri
end
=begin
diff --git a/lib/owl.rb b/lib/owl.rb
index f8958cd..146bce7 100644
--- a/lib/owl.rb
+++ b/lib/owl.rb
@@ -8,7 +8,7 @@ module OpenTox
@model = Redland::Model.new Redland::MemoryStore.new
@parser = Redland::Parser.new
- @serializer = Redland::Serializer.ntriples
+ #@serializer = Redland::Serializer.ntriples
# read OT Ontology
#@parser.parse_into_model(@model,"http://opentox.org/data/documents/development/RDF%20files/OpenToxOntology/at_download/file")