opentox-ruby-api-wrapper 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/owl.rb +10 -3
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
data/lib/owl.rb
CHANGED
@@ -12,6 +12,8 @@ module OpenTox
|
|
12
12
|
|
13
13
|
# explicit typing
|
14
14
|
# this should come from http://opentox.org/data/documents/development/RDF%20files/OpenToxOntology/at_download/file (does not pass OWL-DL validation)
|
15
|
+
@parser.parse_into_model(@model,"http://opentox.org/data/documents/development/RDF%20files/OpenToxOntology/at_download/file")
|
16
|
+
=begin
|
15
17
|
@model.add @uri, RDF['type'], OWL['Ontology']
|
16
18
|
# annotation properties
|
17
19
|
@model.add DC['source'], RDF['type'], OWL["AnnotationProperty"]
|
@@ -37,6 +39,7 @@ module OpenTox
|
|
37
39
|
@model.add OT['DataEntry'], RDF['type'], OWL["Class"]
|
38
40
|
@model.add OT['Parameter'], RDF['type'], OWL["Class"]
|
39
41
|
@model.add OT['Algorithm'], RDF['type'], OWL["Class"]
|
42
|
+
=end
|
40
43
|
end
|
41
44
|
|
42
45
|
def owl_class
|
@@ -67,7 +70,7 @@ module OpenTox
|
|
67
70
|
end
|
68
71
|
|
69
72
|
def title
|
70
|
-
puts OT[self.owl_class]
|
73
|
+
#puts OT[self.owl_class]
|
71
74
|
@model.object(OT[self.owl_class], DC['title']).to_s
|
72
75
|
end
|
73
76
|
|
@@ -83,14 +86,18 @@ module OpenTox
|
|
83
86
|
|
84
87
|
def create_owl_statement(name,value)
|
85
88
|
r = @model.create_resource
|
86
|
-
|
89
|
+
dc_class = DC[name.gsub(/^[a-z]/) { |a| a.upcase }] # capitalize only the first letter
|
90
|
+
@model.add dc_class, RDF['type'], OWL["Class"]
|
91
|
+
@model.add r, RDF['type'], dc_class
|
87
92
|
@model.add r, DC[name], value
|
93
|
+
#puts r
|
94
|
+
#puts DC[name.gsub(/^[a-z]/) { |a| a.upcase }] # capitalize only the first letter
|
95
|
+
#puts DC[name] # capitalize only the first letter
|
88
96
|
end
|
89
97
|
|
90
98
|
def method_missing(name, *args)
|
91
99
|
# create magic setter methods
|
92
100
|
if /=/ =~ name.to_s
|
93
|
-
puts "create_owl_statement #{name.to_s.sub(/=/,'')}, #{args.first}"
|
94
101
|
create_owl_statement name.to_s.sub(/=/,''), args.first
|
95
102
|
else
|
96
103
|
raise "No method #{name}"
|