opentox-ruby-api-wrapper 1.6.2 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.2
1
+ 1.6.3
data/lib/algorithm.rb CHANGED
@@ -1,7 +1,25 @@
1
- LOGGER.progname = File.expand_path(__FILE__)
2
1
 
3
2
  module OpenTox
4
3
  module Algorithm
4
+
5
+
6
+ class Generic
7
+
8
+ attr_accessor :uri, :title, :date
9
+
10
+ def self.find(uri)
11
+ owl = OpenTox::Owl.from_uri(uri, "Algorithm")
12
+ return self.new(owl)
13
+ end
14
+
15
+ protected
16
+ def initialize(owl)
17
+ @title = owl.get("title")
18
+ @date = owl.get("date")
19
+ @uri = owl.uri
20
+ end
21
+
22
+ end
5
23
 
6
24
  class Fminer
7
25
 
data/lib/dataset.rb CHANGED
@@ -1,5 +1,3 @@
1
- LOGGER.progname = File.expand_path(__FILE__)
2
-
3
1
  module OpenTox
4
2
 
5
3
  class Dataset
data/lib/model.rb CHANGED
@@ -21,9 +21,8 @@ module OpenTox
21
21
 
22
22
  protected
23
23
  def initialize(owl)
24
- [:date, :creator, :title, :format, :algorithm, :dependentVariables,
25
- :independentVariables, :predictedVariables, :trainingDataset].each do |a|
26
- self.send("#{a.to_s}=".to_sym, owl.get(a.to_s))
24
+ MODEL_ATTRIBS.each do |a|
25
+ self.send("#{a.to_s}=".to_sym, owl.get(a.to_s)) unless a==:uri
27
26
  end
28
27
  @uri = owl.uri
29
28
  if ENV['RACK_ENV'] =~ /test|debug/
data/lib/ot-logger.rb CHANGED
@@ -14,7 +14,7 @@ class MyLogger < Logger
14
14
  n = 2
15
15
  line = lines[n]
16
16
 
17
- while (line =~ /spork.rb/ or line =~ /as_task/ or line =~ /environment.rb/)
17
+ while (line =~ /spork.rb/ or line =~ /as_task/ or line =~ /ot-logger.rb/)
18
18
  n += 1
19
19
  line = lines[n]
20
20
  end
data/lib/owl.rb CHANGED
@@ -240,7 +240,7 @@ module OpenTox
240
240
  unless owl.root_node
241
241
  types = []
242
242
  owl.model.find(nil, RDF_TYPE, nil){ |s,p,o| types << o.to_s }
243
- raise "root node for class '"+ot_class+"' not found (available type nodes: "+types.inspect+")"
243
+ raise "root node for class '"+owl.node(ot_class).to_s+"' not found (available type nodes: "+types.inspect+")"
244
244
  end
245
245
  raise "no uri in rdf: '"+owl.uri+"'" unless owl.uri and Utils.is_uri?(owl.uri)
246
246
  owl.ot_class = ot_class
@@ -251,7 +251,7 @@ module OpenTox
251
251
  end
252
252
 
253
253
  def self.from_uri(uri, ot_class)
254
- return from_data(RestClientWrapper.get(uri,:accept => "application/rdf+xml").to_s, uri, ot_class)
254
+ return from_data(RestClientWrapper.get(uri,:accept => "application/rdf+xml").to_s, uri, ot_class)
255
255
  end
256
256
 
257
257
  def rdf
data/lib/task.rb CHANGED
@@ -1,5 +1,3 @@
1
- LOGGER.progname = File.expand_path(__FILE__)
2
-
3
1
  $self_task=nil
4
2
 
5
3
  module OpenTox
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentox-ruby-api-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 6
9
- - 2
10
- version: 1.6.2
9
+ - 3
10
+ version: 1.6.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christoph Helma, Martin Guetlein
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-09 00:00:00 +02:00
18
+ date: 2010-08-18 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency