Class: OpenTox::Model::Generic

Inherits:
Object
  • Object
show all
Defined in:
lib/model.rb

Direct Known Subclasses

Lazar, PredictionModel, PropertyLazar

Constant Summary collapse

MODEL_ATTRIBS =
[:uri, :title, :creator, :date, :format, :predictedVariables, :independentVariables, :dependentVariables, :trainingDataset, :algorithm]

Class Method Summary collapse

Class Method Details

.find(uri) ⇒ Object



9
10
11
12
# File 'lib/model.rb', line 9

def self.find(uri)
  owl = OpenTox::Owl.from_uri(uri, "Model")
  return self.new(owl)
end

.to_rdf(model) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/model.rb', line 14

def self.to_rdf(model)
  owl = OpenTox::Owl.create 'Model', model.uri
  (MODEL_ATTRIBS - [:uri]).each do |a|
    owl.set(a.to_s,model.send(a.to_s))
  end
  owl.rdf
end