summaryrefslogtreecommitdiff
path: root/lib/model.rb
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2010-06-25 20:44:49 +0200
committermguetlein <martin.guetlein@gmail.com>2010-06-25 20:44:49 +0200
commit5cdd09a98b1edfb8be3e4693a4b129b9b35ad9f2 (patch)
treefa70316a483282d7f77306c04bc4aca6dc72ad7a /lib/model.rb
parente5838e7607533b5087a89949fea15f694f184b17 (diff)
parentba287d744cdc929df7e3ed3986151b813ddf8fb1 (diff)
resolved conflicts, replace text/x-yaml with application/x-yaml, acceess classification values w/o confidence
Diffstat (limited to 'lib/model.rb')
-rw-r--r--lib/model.rb69
1 files changed, 1 insertions, 68 deletions
diff --git a/lib/model.rb b/lib/model.rb
index 3553919..e3ddeb0 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -96,79 +96,12 @@ module OpenTox
def save
@features.uniq!
resource = RestClient::Resource.new(@@config[:services]["opentox-model"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
- resource.post(self.to_yaml, :content_type => "text/x-yaml").chomp.to_s
+ resource.post(self.to_yaml, :content_type => "application/x-yaml").chomp.to_s
end
def self.find_all
RestClientWrapper.get(@@config[:services]["opentox-model"]).chomp.split("\n")
end
-=begin
-
- # Predict a compound
- def predict(compound)
- # nicht absichern??
- resource = RestClient::Resource.new(@uri, :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
- resource.post(:compound_uri => compound.uri)
- end
-
- def self.base_uri
- File.join @@config[:services]["opentox-model"],'lazar'
- end
-
- def self.create(data)
- resource = RestClient::Resource.new(@@config[:services]["opentox-model"], :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
- resource.post(data, :content_type => "text/x-yaml").chomp.to_s
- end
-
- def delete
- resource = RestClient::Resource.new(self.uri, :user => @@users[:users].keys[0], :password => @@users[:users].values[0])
- resource.delete
- #RestClient.delete @uri if @uri
- #RestClient.delete model.task_uri if model.task_uri
- end
-
-# def self.create(task)
-# @uri = RestClient.post(@@config[:services]["opentox-model"], :task_uri => task.uri)
-# end
-
-# def yaml=(data)
-# RestClient.put(@@uri, data, :content_type => "text/x-yaml").to_s
-# end
-
- def endpoint
- YAML.load(RestClient.get(uri))[:endpoint]
- end
-
- def algorithm=(algorithm)
- me = @model.subject(RDF['type'],OT[self.owl_class])
- @model.add me, OT['algorithm'], Redland::Uri.new(algorithm) # untyped individual comes from this line, why??
- @model.add Redland::Uri.new(algorithm), RDF['type'], OT['Algorithm']
- end
-
- def trainingDataset=(trainingDataset)
- me = @model.subject(RDF['type'],OT[self.owl_class])
- @model.add me, OT['trainingDataset'], Redland::Uri.new(trainingDataset) # untyped individual comes from this line, why??
- @model.add Redland::Uri.new(trainingDataset), RDF['type'], OT['Dataset']
- end
-
- def dependentVariables=(dependentVariables)
- me = @model.subject(RDF['type'],OT[self.owl_class])
- @model.add me, OT['dependentVariables'], Redland::Uri.new(dependentVariables) # untyped individual comes from this line, why??
- @model.add Redland::Uri.new(dependentVariables), RDF['type'], OT['Feature']
- end
-
- def independentVariables=(independentVariables)
- me = @model.subject(RDF['type'],OT[self.owl_class])
- @model.add me, OT['independentVariables'], Redland::Uri.new(independentVariables) # untyped individual comes from this line, why??
- @model.add Redland::Uri.new(independentVariables), RDF['type'], OT['Feature']
- end
-
- def predictedVariables=(predictedVariables)
- me = @model.subject(RDF['type'],OT[self.owl_class])
- @model.add me, OT['predictedVariables'], Redland::Uri.new(predictedVariables) # untyped individual comes from this line, why??
- @model.add Redland::Uri.new(predictedVariables), RDF['type'], OT['Feature']
- end
-=end
end
end
end