summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.de>2010-02-15 10:14:43 +0100
committerChristoph Helma <helma@in-silico.de>2010-02-15 10:14:43 +0100
commit33d59523b3340d213b2bee58cde5de9ff4bffe99 (patch)
tree1026f79ad3d597417d048c967d1097fa789103b1 /lib
parent658a73f4648f179f4f9073e0011e71085ee3e733 (diff)
OWL-DL partially fixed according to Ninas suggestions
Diffstat (limited to 'lib')
-rw-r--r--lib/dataset.rb8
-rw-r--r--lib/environment.rb1
-rw-r--r--lib/model.rb2
-rw-r--r--lib/owl.rb1
4 files changed, 8 insertions, 4 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb
index 3971537..65e1e6b 100644
--- a/lib/dataset.rb
+++ b/lib/dataset.rb
@@ -14,6 +14,8 @@ module OpenTox
data_entry = @model.subject OT['compound'], compound
if data_entry.nil?
data_entry = @model.create_resource
+ dataset = @model.subject(RDF['type'],OT[self.owl_class])
+ @model.add dataset, RDF['dataEntry'], data_entry
@model.add data_entry, RDF['type'], OT["DataEntry"]
@model.add data_entry, OT['compound'], compound
end
@@ -29,6 +31,8 @@ module OpenTox
data_entry = @model.subject OT['compound'], compound
if data_entry.nil?
data_entry = @model.create_resource
+ dataset = @model.subject(RDF['type'],OT[self.owl_class])
+ @model.add dataset, RDF['dataEntry'], data_entry
@model.add data_entry, RDF['type'], OT["DataEntry"]
@model.add data_entry, OT['compound'], compound
end
@@ -57,7 +61,7 @@ module OpenTox
def find_or_create_compound(uri)
compound = @model.subject(DC["identifier"], uri)
if compound.nil?
- compound = @model.create_resource
+ compound = @model.create_resource(uri)
@model.add compound, RDF['type'], OT["Compound"]
@model.add compound, DC["identifier"], uri
end
@@ -68,7 +72,7 @@ module OpenTox
def find_or_create_feature(uri)
feature = @model.subject(DC["identifier"], uri)
if feature.nil?
- feature = @model.create_resource
+ feature = @model.create_resource(uri)
@model.add feature, RDF['type'], OT["Feature"]
@model.add feature, DC["identifier"], uri
@model.add feature, DC["title"], File.basename(uri).split(/#/)[1]
diff --git a/lib/environment.rb b/lib/environment.rb
index fedc3cf..814e5c0 100644
--- a/lib/environment.rb
+++ b/lib/environment.rb
@@ -15,6 +15,7 @@ if File.exist?(config_file)
else
FileUtils.mkdir_p TMP_DIR
FileUtils.mkdir_p LOG_DIR
+ FileUtils.mkdir_p config_dir
FileUtils.cp(File.join(File.dirname(__FILE__), 'templates/config.yaml'), config_file)
puts "Please edit #{config_file} and restart your application."
exit
diff --git a/lib/model.rb b/lib/model.rb
index a585b59..976efac 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -24,7 +24,7 @@ module OpenTox
lazar.algorithm = File.join(@@config[:services]["opentox-algorithm"],"lazar")
lazar.trainingDataset = yaml[:activity_dataset]
lazar.dependentVariables = yaml[:endpoint]
- lazar.predictedVariables = yaml[:endpoint] #+ " lazar prediction"
+ lazar.predictedVariables = yaml[:endpoint] + "_lazar_prediction"
lazar
end
diff --git a/lib/owl.rb b/lib/owl.rb
index a843e59..82d6e0e 100644
--- a/lib/owl.rb
+++ b/lib/owl.rb
@@ -16,7 +16,6 @@ module OpenTox
# reate an anonymous resource for metadata
# this has to be rewritten with an URI as soon as the resource has been saved at an definitive location
tmp = @model.create_resource
- @model.add tmp, RDF['type'], OWL['Ontology']
@model.add tmp, RDF['type'], OT[self.owl_class]
end