yowl 0.4.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +15 -0
- data/INSTALL-MACOSX.md +107 -0
- data/README.md +92 -0
- data/Rakefile +76 -0
- data/bin/yowl +14 -0
- data/examples/introduction.html +5 -0
- data/lib/yowl/association.rb +66 -0
- data/lib/yowl/class.rb +296 -0
- data/lib/yowl/generator.rb +96 -0
- data/lib/yowl/import.rb +62 -0
- data/lib/yowl/individual.rb +398 -0
- data/lib/yowl/individual_association.rb +80 -0
- data/lib/yowl/ontology.rb +197 -0
- data/lib/yowl/options.rb +116 -0
- data/lib/yowl/optionsparser.rb +75 -0
- data/lib/yowl/person.rb +26 -0
- data/lib/yowl/property.rb +190 -0
- data/lib/yowl/repository.rb +100 -0
- data/lib/yowl/schema.rb +519 -0
- data/lib/yowl/template/css/jquery.ui.all.css +11 -0
- data/lib/yowl/template/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/yowl/template/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/yowl/template/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/yowl/template/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/yowl/template/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/yowl/template/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/yowl/template/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/yowl/template/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/yowl/template/css/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/lib/yowl/template/css/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/yowl/template/css/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/lib/yowl/template/css/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/lib/yowl/template/css/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/yowl/template/css/smoothness/jquery-ui-1.8.23.custom.css +563 -0
- data/lib/yowl/template/css/yowl.css +414 -0
- data/lib/yowl/template/import-diagram.erb +29 -0
- data/lib/yowl/template/index.erb +56 -0
- data/lib/yowl/template/js/jquery-1.7.2.min.js +4 -0
- data/lib/yowl/template/js/jquery-ui-1.8.23.custom.min.js +125 -0
- data/lib/yowl/template/js/jquery.ui.accordion.js +611 -0
- data/lib/yowl/template/js/yowl.js +72 -0
- data/lib/yowl/template/ontology.erb +598 -0
- data/lib/yowl/template/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/yowl/template/themes/base/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/yowl/template/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/yowl/template/themes/base/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/yowl/template/themes/base/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/yowl/template/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/yowl/template/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/yowl/template/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/yowl/template/themes/base/images/ui-icons_222222_256x240.png +0 -0
- data/lib/yowl/template/themes/base/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/yowl/template/themes/base/images/ui-icons_454545_256x240.png +0 -0
- data/lib/yowl/template/themes/base/images/ui-icons_888888_256x240.png +0 -0
- data/lib/yowl/template/themes/base/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/yowl/template/themes/base/jquery.ui.accordion.css +19 -0
- data/lib/yowl/template/themes/base/jquery.ui.all.css +11 -0
- data/lib/yowl/template/themes/base/jquery.ui.autocomplete.css +53 -0
- data/lib/yowl/template/themes/base/jquery.ui.base.css +11 -0
- data/lib/yowl/template/themes/base/jquery.ui.button.css +38 -0
- data/lib/yowl/template/themes/base/jquery.ui.core.css +38 -0
- data/lib/yowl/template/themes/base/jquery.ui.datepicker.css +66 -0
- data/lib/yowl/template/themes/base/jquery.ui.dialog.css +21 -0
- data/lib/yowl/template/themes/base/jquery.ui.progressbar.css +11 -0
- data/lib/yowl/template/themes/base/jquery.ui.resizable.css +20 -0
- data/lib/yowl/template/themes/base/jquery.ui.selectable.css +10 -0
- data/lib/yowl/template/themes/base/jquery.ui.slider.css +24 -0
- data/lib/yowl/template/themes/base/jquery.ui.tabs.css +18 -0
- data/lib/yowl/template/themes/base/jquery.ui.theme.css +247 -0
- data/lib/yowl/template/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/yowl/template/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/yowl/template/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/yowl/template/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/yowl/template/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/yowl/template/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/yowl/template/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/yowl/template/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/yowl/template/themes/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/lib/yowl/template/themes/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/yowl/template/themes/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/lib/yowl/template/themes/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/lib/yowl/template/themes/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/yowl/template/themes/smoothness/jquery-ui-1.8.23.custom.css +563 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.accordion.css +19 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.all.css +11 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.autocomplete.css +53 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.base.css +11 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.button.css +38 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.core.css +38 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.datepicker.css +66 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.dialog.css +21 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.progressbar.css +11 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.resizable.css +20 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.selectable.css +10 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.slider.css +24 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.tabs.css +18 -0
- data/lib/yowl/template/themes/smoothness/jquery.ui.theme.css +249 -0
- data/lib/yowl/util.rb +221 -0
- data/lib/yowl/version.rb +3 -0
- data/lib/yowl.rb +42 -0
- data/test/input/base-with-comments.ttl +163 -0
- data/test/input/base.ttl +221 -0
- data/test/input/empty.ttl +8 -0
- data/test/input/example.ttl +73 -0
- data/test/test_example_ttl.rb +62 -0
- data/test/test_yowl.rb +4 -0
- data/test/testcases.md +24 -0
- metadata +311 -0
data/test/input/base.ttl
ADDED
@@ -0,0 +1,221 @@
|
|
1
|
+
# baseURI: http://example.org/yowl/tests/ontology/base
|
2
|
+
|
3
|
+
@prefix : <http://example.org/yowl/tests/ontology/base#> .
|
4
|
+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
5
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
6
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
7
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
8
|
+
|
9
|
+
<http://example.org/yowl/tests/ontology/base>
|
10
|
+
rdf:type owl:Ontology ;
|
11
|
+
rdfs:comment "Base test ontology, designed to be imported into other test ontologies to provide a selection of classes, properties & individuals."^^xsd:string .
|
12
|
+
|
13
|
+
:ClassA
|
14
|
+
rdf:type owl:Class ;
|
15
|
+
rdfs:label "Class A"^^xsd:string ;
|
16
|
+
rdfs:subClassOf owl:Thing .
|
17
|
+
|
18
|
+
:ClassB
|
19
|
+
rdf:type owl:Class ;
|
20
|
+
rdfs:label "Class B"^^xsd:string ;
|
21
|
+
rdfs:subClassOf owl:Thing .
|
22
|
+
|
23
|
+
:ClassC
|
24
|
+
rdf:type owl:Class ;
|
25
|
+
rdfs:label "Class C"^^xsd:string ;
|
26
|
+
rdfs:subClassOf owl:Thing .
|
27
|
+
|
28
|
+
:ClassD
|
29
|
+
rdf:type owl:Class ;
|
30
|
+
rdfs:label "Class D"^^xsd:string ;
|
31
|
+
rdfs:subClassOf owl:Thing .
|
32
|
+
|
33
|
+
:ClassE
|
34
|
+
rdf:type owl:Class ;
|
35
|
+
rdfs:label "Class E"^^xsd:string ;
|
36
|
+
rdfs:subClassOf owl:Thing .
|
37
|
+
|
38
|
+
:ClassF
|
39
|
+
rdf:type owl:Class ;
|
40
|
+
rdfs:label "Class F"^^xsd:string ;
|
41
|
+
rdfs:subClassOf owl:Thing .
|
42
|
+
|
43
|
+
:ClassG
|
44
|
+
rdf:type owl:Class ;
|
45
|
+
rdfs:label "Class G"^^xsd:string ;
|
46
|
+
rdfs:subClassOf owl:Thing .
|
47
|
+
|
48
|
+
:ClassH
|
49
|
+
rdf:type owl:Class ;
|
50
|
+
rdfs:label "Class H"^^xsd:string ;
|
51
|
+
rdfs:subClassOf owl:Thing .
|
52
|
+
|
53
|
+
:ClassJ
|
54
|
+
rdf:type owl:Class ;
|
55
|
+
rdfs:label "Class J"^^xsd:string ;
|
56
|
+
rdfs:subClassOf owl:Thing .
|
57
|
+
|
58
|
+
:ClassK
|
59
|
+
rdf:type owl:Class ;
|
60
|
+
rdfs:label "Class K"^^xsd:string ;
|
61
|
+
rdfs:subClassOf owl:Thing .
|
62
|
+
|
63
|
+
:IndividualA1
|
64
|
+
rdf:type :ClassA ;
|
65
|
+
rdfs:label "Individual A1"^^xsd:string .
|
66
|
+
|
67
|
+
:IndividualA2
|
68
|
+
rdf:type :ClassA ;
|
69
|
+
rdfs:label "Individual A2"^^xsd:string .
|
70
|
+
|
71
|
+
:IndividualB1
|
72
|
+
rdf:type :ClassB ;
|
73
|
+
rdfs:label "Individual B1"^^xsd:string .
|
74
|
+
|
75
|
+
:IndividualB2
|
76
|
+
rdf:type :ClassB ;
|
77
|
+
rdfs:label "Individual B2"^^xsd:string .
|
78
|
+
|
79
|
+
:IndividualC1
|
80
|
+
rdf:type :ClassC ;
|
81
|
+
rdfs:label "Individual C1"^^xsd:string .
|
82
|
+
|
83
|
+
:IndividualC2
|
84
|
+
rdf:type :ClassC ;
|
85
|
+
rdfs:label "Individual C2"^^xsd:string .
|
86
|
+
|
87
|
+
:IndividualD1
|
88
|
+
rdf:type :ClassD ;
|
89
|
+
rdfs:label "Individual D1"^^xsd:string .
|
90
|
+
|
91
|
+
:IndividualD2
|
92
|
+
rdf:type :ClassD ;
|
93
|
+
rdfs:label "Individual D2"^^xsd:string .
|
94
|
+
|
95
|
+
:IndividualE1
|
96
|
+
rdf:type :ClassE ;
|
97
|
+
rdfs:label "Individual E1"^^xsd:string .
|
98
|
+
|
99
|
+
:IndividualE2
|
100
|
+
rdf:type :ClassE ;
|
101
|
+
rdfs:label "Individual E2"^^xsd:string .
|
102
|
+
|
103
|
+
:IndividualF1
|
104
|
+
rdf:type :ClassF ;
|
105
|
+
rdfs:label "Individual F1"^^xsd:string .
|
106
|
+
|
107
|
+
:IndividualF2
|
108
|
+
rdf:type :ClassF ;
|
109
|
+
rdfs:label "Individual F2"^^xsd:string .
|
110
|
+
|
111
|
+
:IndividualG1
|
112
|
+
rdf:type :ClassG ;
|
113
|
+
rdfs:label "Individual G1"^^xsd:string .
|
114
|
+
|
115
|
+
:IndividualG2
|
116
|
+
rdf:type :ClassG ;
|
117
|
+
rdfs:label "Individual G2"^^xsd:string .
|
118
|
+
|
119
|
+
:IndividualH1
|
120
|
+
rdf:type :ClassH ;
|
121
|
+
rdfs:label "Individual H1"^^xsd:string .
|
122
|
+
|
123
|
+
:IndividualH2
|
124
|
+
rdf:type :ClassH ;
|
125
|
+
rdfs:label "Individual H2"^^xsd:string .
|
126
|
+
|
127
|
+
:IndividualJ1
|
128
|
+
rdf:type :ClassJ ;
|
129
|
+
rdfs:label "Individual J1"^^xsd:string .
|
130
|
+
|
131
|
+
:IndividualJ2
|
132
|
+
rdf:type :ClassJ ;
|
133
|
+
rdfs:label "Individual J2"^^xsd:string .
|
134
|
+
|
135
|
+
:IndividualK1
|
136
|
+
rdf:type :ClassK ;
|
137
|
+
rdfs:label "Individual K1"^^xsd:string .
|
138
|
+
|
139
|
+
:IndividualK2
|
140
|
+
rdf:type :ClassK ;
|
141
|
+
rdfs:label "Individual K2"^^xsd:string .
|
142
|
+
|
143
|
+
:dPropertyA
|
144
|
+
rdf:type owl:DatatypeProperty ;
|
145
|
+
rdfs:label "datatype property A"^^xsd:string .
|
146
|
+
|
147
|
+
:dPropertyB
|
148
|
+
rdf:type owl:DatatypeProperty ;
|
149
|
+
rdfs:label "datatype property B"^^xsd:string .
|
150
|
+
|
151
|
+
:dPropertyC
|
152
|
+
rdf:type owl:DatatypeProperty ;
|
153
|
+
rdfs:label "datatype property C"^^xsd:string .
|
154
|
+
|
155
|
+
:dPropertyD
|
156
|
+
rdf:type owl:DatatypeProperty ;
|
157
|
+
rdfs:label "datatype property D"^^xsd:string .
|
158
|
+
|
159
|
+
:dPropertyE
|
160
|
+
rdf:type owl:DatatypeProperty ;
|
161
|
+
rdfs:label "datatype property E"^^xsd:string .
|
162
|
+
|
163
|
+
:dPropertyF
|
164
|
+
rdf:type owl:DatatypeProperty ;
|
165
|
+
rdfs:label "datatype property F"^^xsd:string .
|
166
|
+
|
167
|
+
:dPropertyG
|
168
|
+
rdf:type owl:DatatypeProperty ;
|
169
|
+
rdfs:label "datatype property G"^^xsd:string .
|
170
|
+
|
171
|
+
:dPropertyH
|
172
|
+
rdf:type owl:DatatypeProperty ;
|
173
|
+
rdfs:label "datatype property H"^^xsd:string .
|
174
|
+
|
175
|
+
:dPropertyJ
|
176
|
+
rdf:type owl:DatatypeProperty ;
|
177
|
+
rdfs:label "datatype property J"^^xsd:string .
|
178
|
+
|
179
|
+
:dPropertyK
|
180
|
+
rdf:type owl:DatatypeProperty ;
|
181
|
+
rdfs:label "datatype property K"^^xsd:string .
|
182
|
+
|
183
|
+
:oPropertyA
|
184
|
+
rdf:type owl:ObjectProperty ;
|
185
|
+
rdfs:label "object property A"^^xsd:string .
|
186
|
+
|
187
|
+
:oPropertyB
|
188
|
+
rdf:type owl:ObjectProperty ;
|
189
|
+
rdfs:label "object property B"^^xsd:string .
|
190
|
+
|
191
|
+
:oPropertyC
|
192
|
+
rdf:type owl:ObjectProperty ;
|
193
|
+
rdfs:label "object property C"^^xsd:string .
|
194
|
+
|
195
|
+
:oPropertyD
|
196
|
+
rdf:type owl:ObjectProperty ;
|
197
|
+
rdfs:label "object property D"^^xsd:string .
|
198
|
+
|
199
|
+
:oPropertyE
|
200
|
+
rdf:type owl:ObjectProperty ;
|
201
|
+
rdfs:label "object property E"^^xsd:string .
|
202
|
+
|
203
|
+
:oPropertyF
|
204
|
+
rdf:type owl:ObjectProperty ;
|
205
|
+
rdfs:label "object property F"^^xsd:string .
|
206
|
+
|
207
|
+
:oPropertyG
|
208
|
+
rdf:type owl:ObjectProperty ;
|
209
|
+
rdfs:label "object property G"^^xsd:string .
|
210
|
+
|
211
|
+
:oPropertyH
|
212
|
+
rdf:type owl:ObjectProperty ;
|
213
|
+
rdfs:label "object property H"^^xsd:string .
|
214
|
+
|
215
|
+
:oPropertyJ
|
216
|
+
rdf:type owl:ObjectProperty ;
|
217
|
+
rdfs:label "object property J"^^xsd:string .
|
218
|
+
|
219
|
+
:oPropertyK
|
220
|
+
rdf:type owl:ObjectProperty ;
|
221
|
+
rdfs:label "object property K"^^xsd:string .
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# baseURI: http://example.org/yowl/tests/ontology/empty
|
2
|
+
|
3
|
+
@prefix : <http://example.org/yowl/tests/ontology/empty#> .
|
4
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
5
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
6
|
+
|
7
|
+
<http://example.org/yowl/tests/ontology/empty>
|
8
|
+
rdf:type <http://www.w3.org/2002/07/owl#Ontology> .
|
@@ -0,0 +1,73 @@
|
|
1
|
+
#General Namespaces
|
2
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
|
3
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
|
4
|
+
@prefix owl: <http://www.w3.org/2002/07/owl#>.
|
5
|
+
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
|
6
|
+
@prefix dcterms: <http://purl.org/dc/terms/>.
|
7
|
+
@prefix dctypes: <http://purl.org/dc/dcmitype/>.
|
8
|
+
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
|
9
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
|
10
|
+
@prefix ex: <http://www.example.org/yowl/>.
|
11
|
+
|
12
|
+
############################################################################
|
13
|
+
# General description of the schema
|
14
|
+
############################################################################
|
15
|
+
|
16
|
+
<http://www.example.org/yowl/>
|
17
|
+
a owl:Ontology;
|
18
|
+
dcterms:title "An Example"@en ;
|
19
|
+
rdfs:comment "This is a simple example"@en ;
|
20
|
+
foaf:maker <http://www.ldodds.com#me> ;
|
21
|
+
foaf:maker <http://www.example.org/unknown> ;
|
22
|
+
dcterms:created "2010-02-19"^^xsd:date ;
|
23
|
+
dcterms:modified "2010-09-28"^^xsd:date .
|
24
|
+
|
25
|
+
<http://www.ldodds.com#me> a foaf:Person ;
|
26
|
+
foaf:name "Leigh Dodds" .
|
27
|
+
|
28
|
+
<http://www.example.org/unknown> a foaf:Person .
|
29
|
+
|
30
|
+
############################################################################
|
31
|
+
# Classes
|
32
|
+
############################################################################
|
33
|
+
|
34
|
+
ex:SomeClass
|
35
|
+
a owl:Class;
|
36
|
+
rdfs:label "Some Class"@en;
|
37
|
+
rdfs:comment "A Class of Things."@en;
|
38
|
+
rdfs:seeAlso <http://en.wikipedia.org/>;
|
39
|
+
vs:term_status "testing".
|
40
|
+
|
41
|
+
ex:DerivedClass
|
42
|
+
a owl:Class;
|
43
|
+
rdfs:subClassOf ex:SomeClass;
|
44
|
+
rdfs:label "Derived"@en;
|
45
|
+
rdfs:comment "A Derived Class"@en ;
|
46
|
+
rdfs:seeAlso <http://www.google.com>;
|
47
|
+
vs:term_status "testing".
|
48
|
+
|
49
|
+
############################################################################
|
50
|
+
# Object Properties
|
51
|
+
############################################################################
|
52
|
+
|
53
|
+
ex:objectProperty
|
54
|
+
a owl:ObjectProperty;
|
55
|
+
rdfs:label "object property"@en;
|
56
|
+
rdfs:comment "associates Some Class with another thing"@en;
|
57
|
+
rdfs:range ex:SomeClass;
|
58
|
+
rdfs:domain ex:SomeClass;
|
59
|
+
vs:term_status "testing".
|
60
|
+
|
61
|
+
############################################################################
|
62
|
+
# Datatype Properties
|
63
|
+
############################################################################
|
64
|
+
|
65
|
+
ex:datatypeProperty
|
66
|
+
a owl:DatatypeProperty;
|
67
|
+
rdfs:label "datatype property"@en;
|
68
|
+
rdfs:comment "a datatype property"@en;
|
69
|
+
rdfs:range xsd:string;
|
70
|
+
rdfs:domain ex:DerivedClass;
|
71
|
+
vs:term_status "testing".
|
72
|
+
|
73
|
+
|
@@ -0,0 +1,62 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
2
|
+
require 'yowl'
|
3
|
+
require 'test/unit'
|
4
|
+
|
5
|
+
class OntologyTest < Test::Unit::TestCase
|
6
|
+
|
7
|
+
@schema = nil
|
8
|
+
|
9
|
+
def setup
|
10
|
+
|
11
|
+
argv = [
|
12
|
+
'-i', 'test/input/example.ttl',
|
13
|
+
'--no-vann',
|
14
|
+
'--quiet'
|
15
|
+
]
|
16
|
+
options = YOWL::OptionsParser.parse(argv)
|
17
|
+
repository = YOWL::Repository.new(options)
|
18
|
+
repository.ontologies.each() do | ontology |
|
19
|
+
if (ontology.short_name == 'example')
|
20
|
+
@schema = ontology.schema
|
21
|
+
end
|
22
|
+
end
|
23
|
+
assert_not_nil(@schema)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_read_classes_from_sample()
|
27
|
+
classes = @schema.classes()
|
28
|
+
assert_not_nil classes
|
29
|
+
assert_equal(2, classes.length)
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
def test_get_title
|
34
|
+
assert_equal("An Example", @schema.ontology.title)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_get_comment
|
38
|
+
assert_equal("This is a simple example", @schema.ontology.comment)
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_get_created
|
42
|
+
assert_equal("2010-02-19", @schema.ontology.created)
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_get_created
|
46
|
+
assert_equal("2010-09-28", @schema.ontology.modified)
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_get_authors
|
50
|
+
assert_equal(2 , @schema.ontology.authors.length)
|
51
|
+
author = @schema.ontology.authors[0]
|
52
|
+
assert_equal("http://www.ldodds.com#me", author.uri)
|
53
|
+
assert_equal("Leigh Dodds", author.name)
|
54
|
+
|
55
|
+
author = @schema.ontology.authors[1]
|
56
|
+
assert_equal("http://www.example.org/unknown", author.uri)
|
57
|
+
assert_equal("http://www.example.org/unknown", author.name)
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
end
|
data/test/test_yowl.rb
ADDED
data/test/testcases.md
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Ontology Test Cases #
|
2
|
+
|
3
|
+
* [Empty ontology](input/empty.ttl).
|
4
|
+
* [Class/property/individual labels and comments](input/base-with-comments.ttl).
|
5
|
+
* 'sameAs' relationships between classes, properties and/or individuals.
|
6
|
+
* OWL class with one or more keys.
|
7
|
+
* OWL individuals with simple/compound key values.
|
8
|
+
* Multiple individuals with the same key value(s).
|
9
|
+
* Properties with and without domains and ranges.
|
10
|
+
* Properties with multiple domains and/or ranges.
|
11
|
+
* Class hierarchies & property hierarchies.
|
12
|
+
* How clearly are these displayed?
|
13
|
+
* Especially in diagrams.
|
14
|
+
* Display of super/subclasses and super/subproperties in documentation & diagrams.
|
15
|
+
* Classes with constraints on their properties - range and cardinality.
|
16
|
+
* Hierarchical constraints within class hierarchies, i.e. constraints becoming tighter as classes are derived.
|
17
|
+
* Class with huge number of subclasses, property with huge number of sub properties.
|
18
|
+
* Class with huge number of constraints.
|
19
|
+
* Property with huge number of domains, property with huge number of ranges.
|
20
|
+
* Classes with annotations.
|
21
|
+
* Use of namespace prefixes in documentation & diagrams.
|
22
|
+
* OWL property chains.
|
23
|
+
* Hyperlinking of diagrams to class/property/individual definitions.
|
24
|
+
* Index/search facility for documentation.
|