aboutsummaryrefslogtreecommitdiff
path: root/src/org/semanticweb/karma2/profile/MyOWLOntologyWalker.java
diff options
context:
space:
mode:
authoryzhou <yujiao.zhou@gmail.com>2015-04-21 10:34:27 +0100
committeryzhou <yujiao.zhou@gmail.com>2015-04-21 10:34:27 +0100
commit9ce65c5a963b03ee97fe9cb6c5aa65a3c04a80a8 (patch)
tree47511c0fb89dccff0db4b5990522e04f294d795b /src/org/semanticweb/karma2/profile/MyOWLOntologyWalker.java
parentb1ac207612ee8b045244253fb94b866104bc34f2 (diff)
downloadACQuA-9ce65c5a963b03ee97fe9cb6c5aa65a3c04a80a8.tar.gz
ACQuA-9ce65c5a963b03ee97fe9cb6c5aa65a3c04a80a8.zip
initial version
Diffstat (limited to 'src/org/semanticweb/karma2/profile/MyOWLOntologyWalker.java')
-rw-r--r--src/org/semanticweb/karma2/profile/MyOWLOntologyWalker.java913
1 files changed, 913 insertions, 0 deletions
diff --git a/src/org/semanticweb/karma2/profile/MyOWLOntologyWalker.java b/src/org/semanticweb/karma2/profile/MyOWLOntologyWalker.java
new file mode 100644
index 0000000..508632f
--- /dev/null
+++ b/src/org/semanticweb/karma2/profile/MyOWLOntologyWalker.java
@@ -0,0 +1,913 @@
1package org.semanticweb.karma2.profile;
2
3import java.util.ArrayList;
4import java.util.Collection;
5import java.util.HashSet;
6import java.util.Set;
7
8import org.semanticweb.owlapi.model.IRI;
9import org.semanticweb.owlapi.model.OWLAnnotation;
10import org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom;
11import org.semanticweb.owlapi.model.OWLAnnotationProperty;
12import org.semanticweb.owlapi.model.OWLAnnotationPropertyDomainAxiom;
13import org.semanticweb.owlapi.model.OWLAnnotationPropertyRangeAxiom;
14import org.semanticweb.owlapi.model.OWLAnonymousIndividual;
15import org.semanticweb.owlapi.model.OWLAsymmetricObjectPropertyAxiom;
16import org.semanticweb.owlapi.model.OWLAxiom;
17import org.semanticweb.owlapi.model.OWLClass;
18import org.semanticweb.owlapi.model.OWLClassAssertionAxiom;
19import org.semanticweb.owlapi.model.OWLClassExpression;
20import org.semanticweb.owlapi.model.OWLDataAllValuesFrom;
21import org.semanticweb.owlapi.model.OWLDataComplementOf;
22import org.semanticweb.owlapi.model.OWLDataExactCardinality;
23import org.semanticweb.owlapi.model.OWLDataHasValue;
24import org.semanticweb.owlapi.model.OWLDataIntersectionOf;
25import org.semanticweb.owlapi.model.OWLDataMaxCardinality;
26import org.semanticweb.owlapi.model.OWLDataMinCardinality;
27import org.semanticweb.owlapi.model.OWLDataOneOf;
28import org.semanticweb.owlapi.model.OWLDataProperty;
29import org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom;
30import org.semanticweb.owlapi.model.OWLDataPropertyDomainAxiom;
31import org.semanticweb.owlapi.model.OWLDataPropertyExpression;
32import org.semanticweb.owlapi.model.OWLDataPropertyRangeAxiom;
33import org.semanticweb.owlapi.model.OWLDataRange;
34import org.semanticweb.owlapi.model.OWLDataSomeValuesFrom;
35import org.semanticweb.owlapi.model.OWLDataUnionOf;
36import org.semanticweb.owlapi.model.OWLDatatype;
37import org.semanticweb.owlapi.model.OWLDatatypeDefinitionAxiom;
38import org.semanticweb.owlapi.model.OWLDatatypeRestriction;
39import org.semanticweb.owlapi.model.OWLDeclarationAxiom;
40import org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom;
41import org.semanticweb.owlapi.model.OWLDisjointClassesAxiom;
42import org.semanticweb.owlapi.model.OWLDisjointDataPropertiesAxiom;
43import org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom;
44import org.semanticweb.owlapi.model.OWLDisjointUnionAxiom;
45import org.semanticweb.owlapi.model.OWLEquivalentClassesAxiom;
46import org.semanticweb.owlapi.model.OWLEquivalentDataPropertiesAxiom;
47import org.semanticweb.owlapi.model.OWLEquivalentObjectPropertiesAxiom;
48import org.semanticweb.owlapi.model.OWLFacetRestriction;
49import org.semanticweb.owlapi.model.OWLFunctionalDataPropertyAxiom;
50import org.semanticweb.owlapi.model.OWLFunctionalObjectPropertyAxiom;
51import org.semanticweb.owlapi.model.OWLHasKeyAxiom;
52import org.semanticweb.owlapi.model.OWLIndividual;
53import org.semanticweb.owlapi.model.OWLInverseFunctionalObjectPropertyAxiom;
54import org.semanticweb.owlapi.model.OWLInverseObjectPropertiesAxiom;
55import org.semanticweb.owlapi.model.OWLIrreflexiveObjectPropertyAxiom;
56import org.semanticweb.owlapi.model.OWLLiteral;
57import org.semanticweb.owlapi.model.OWLNamedIndividual;
58import org.semanticweb.owlapi.model.OWLNegativeDataPropertyAssertionAxiom;
59import org.semanticweb.owlapi.model.OWLNegativeObjectPropertyAssertionAxiom;
60import org.semanticweb.owlapi.model.OWLObject;
61import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom;
62import org.semanticweb.owlapi.model.OWLObjectComplementOf;
63import org.semanticweb.owlapi.model.OWLObjectExactCardinality;
64import org.semanticweb.owlapi.model.OWLObjectHasSelf;
65import org.semanticweb.owlapi.model.OWLObjectHasValue;
66import org.semanticweb.owlapi.model.OWLObjectIntersectionOf;
67import org.semanticweb.owlapi.model.OWLObjectInverseOf;
68import org.semanticweb.owlapi.model.OWLObjectMaxCardinality;
69import org.semanticweb.owlapi.model.OWLObjectMinCardinality;
70import org.semanticweb.owlapi.model.OWLObjectOneOf;
71import org.semanticweb.owlapi.model.OWLObjectProperty;
72import org.semanticweb.owlapi.model.OWLObjectPropertyAssertionAxiom;
73import org.semanticweb.owlapi.model.OWLObjectPropertyDomainAxiom;
74import org.semanticweb.owlapi.model.OWLObjectPropertyExpression;
75import org.semanticweb.owlapi.model.OWLObjectPropertyRangeAxiom;
76import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom;
77import org.semanticweb.owlapi.model.OWLObjectUnionOf;
78import org.semanticweb.owlapi.model.OWLObjectVisitor;
79import org.semanticweb.owlapi.model.OWLObjectVisitorEx;
80import org.semanticweb.owlapi.model.OWLOntology;
81import org.semanticweb.owlapi.model.OWLReflexiveObjectPropertyAxiom;
82import org.semanticweb.owlapi.model.OWLSameIndividualAxiom;
83import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom;
84import org.semanticweb.owlapi.model.OWLSubClassOfAxiom;
85import org.semanticweb.owlapi.model.OWLSubDataPropertyOfAxiom;
86import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom;
87import org.semanticweb.owlapi.model.OWLSubPropertyChainOfAxiom;
88import org.semanticweb.owlapi.model.OWLSymmetricObjectPropertyAxiom;
89import org.semanticweb.owlapi.model.OWLTransitiveObjectPropertyAxiom;
90import org.semanticweb.owlapi.model.SWRLAtom;
91import org.semanticweb.owlapi.model.SWRLBuiltInAtom;
92import org.semanticweb.owlapi.model.SWRLClassAtom;
93import org.semanticweb.owlapi.model.SWRLDArgument;
94import org.semanticweb.owlapi.model.SWRLDataPropertyAtom;
95import org.semanticweb.owlapi.model.SWRLDataRangeAtom;
96import org.semanticweb.owlapi.model.SWRLDifferentIndividualsAtom;
97import org.semanticweb.owlapi.model.SWRLIndividualArgument;
98import org.semanticweb.owlapi.model.SWRLLiteralArgument;
99import org.semanticweb.owlapi.model.SWRLObjectPropertyAtom;
100import org.semanticweb.owlapi.model.SWRLRule;
101import org.semanticweb.owlapi.model.SWRLSameIndividualAtom;
102import org.semanticweb.owlapi.model.SWRLVariable;
103import org.semanticweb.owlapi.util.OWLOntologyWalker;
104
105
106public class MyOWLOntologyWalker extends OWLOntologyWalker {
107
108 private final Collection<OWLOntology> ontologies;
109
110 /**
111 * @param objects the set of objects to visit
112 */
113 public MyOWLOntologyWalker(Set<OWLOntology> objects) {
114 this(objects, true);
115 }
116 /**
117 * @param visitDuplicates true if duplicates should be visited
118 * @param objects the set of objects to visit
119 */
120 public MyOWLOntologyWalker(Set<OWLOntology> objects, boolean visitDuplicates) {
121 super(objects);
122 this.ontologies = new ArrayList<OWLOntology>(objects);
123 }
124
125 /**
126 * @param v visitor to use over the objects
127 */
128 public void walkStructure(OWLObjectVisitorEx<?> v) {
129 this.visitor = v;
130 StructureWalker walker = new StructureWalker();
131 for (OWLOntology o : ontologies) {
132 o.accept(walker);
133 }
134 }
135
136 private class StructureWalker implements OWLObjectVisitor {
137
138 private final Set<OWLObject> visited = new HashSet<OWLObject>();
139
140 public StructureWalker() {}
141
142 private void process(OWLObject object) {
143 if (!visitDuplicates) {
144 if (!visited.contains(object)) {
145 visited.add(object);
146 object.accept(visitor);
147 }
148 }
149 else {
150 object.accept(visitor);
151 }
152 }
153
154 @Override
155 public void visit(IRI iri) {
156 process(iri);
157 }
158
159 @Override
160 public void visit(OWLOntology ontologyToVisit) {
161 MyOWLOntologyWalker.this.ontology = ontologyToVisit;
162 MyOWLOntologyWalker.this.ax = null;
163 process(ontologyToVisit);
164 for (OWLAnnotation anno : ontologyToVisit.getAnnotations()) {
165 anno.accept(this);
166 }
167 for (OWLAxiom a : ontologyToVisit.getAxioms()) {
168 a.accept(this);
169 }
170 }
171
172
173 @Override
174 public void visit(OWLAsymmetricObjectPropertyAxiom axiom) {
175 MyOWLOntologyWalker.this.ax = axiom;
176 process(axiom);
177 axiom.getProperty().accept(this);
178 }
179
180
181 @Override
182 public void visit(OWLClassAssertionAxiom axiom) {
183 MyOWLOntologyWalker.this.ax = axiom;
184 process(axiom);
185 axiom.getIndividual().accept(this);
186 axiom.getClassExpression().accept(this);
187 }
188
189
190 @Override
191 public void visit(OWLDataPropertyAssertionAxiom axiom) {
192 MyOWLOntologyWalker.this.ax = axiom;
193 process(axiom);
194 axiom.getSubject().accept(this);
195 axiom.getProperty().accept(this);
196 axiom.getObject().accept(this);
197 }
198
199
200 @Override
201 public void visit(OWLDataPropertyDomainAxiom axiom) {
202 MyOWLOntologyWalker.this.ax = axiom;
203 process(axiom);
204 axiom.getDomain().accept(this);
205 axiom.getProperty().accept(this);
206 }
207
208
209 @Override
210 public void visit(OWLDataPropertyRangeAxiom axiom) {
211 MyOWLOntologyWalker.this.ax = axiom;
212 process(axiom);
213 axiom.getRange().accept(this);
214 axiom.getProperty().accept(this);
215 }
216
217
218 @Override
219 public void visit(OWLSubDataPropertyOfAxiom axiom) {
220 MyOWLOntologyWalker.this.ax = axiom;
221 process(axiom);
222 axiom.getSubProperty().accept(this);
223 axiom.getSuperProperty().accept(this);
224 }
225
226
227 @Override
228 public void visit(OWLDeclarationAxiom axiom) {
229 MyOWLOntologyWalker.this.ax = axiom;
230 process(axiom);
231 axiom.getEntity().accept(this);
232 }
233
234
235 @Override
236 public void visit(OWLDifferentIndividualsAxiom axiom) {
237 MyOWLOntologyWalker.this.ax = axiom;
238 process(axiom);
239 for (OWLIndividual ind : axiom.getIndividuals()) {
240 ind.accept(this);
241 }
242 }
243
244
245 @Override
246 public void visit(OWLDisjointClassesAxiom axiom) {
247 MyOWLOntologyWalker.this.ax = axiom;
248 process(axiom);
249 for (OWLClassExpression desc : axiom.getClassExpressions()) {
250 desc.accept(this);
251 }
252 }
253
254
255 @Override
256 public void visit(OWLDisjointDataPropertiesAxiom axiom) {
257 MyOWLOntologyWalker.this.ax = axiom;
258 process(axiom);
259 for (OWLDataPropertyExpression prop : axiom.getProperties()) {
260 prop.accept(this);
261 }
262 }
263
264
265 @Override
266 public void visit(OWLDisjointObjectPropertiesAxiom axiom) {
267 MyOWLOntologyWalker.this.ax = axiom;
268 process(axiom);
269 for (OWLObjectPropertyExpression prop : axiom.getProperties()) {
270 prop.accept(this);
271 }
272 }
273
274
275 @Override
276 public void visit(OWLDisjointUnionAxiom axiom) {
277 MyOWLOntologyWalker.this.ax = axiom;
278 process(axiom);
279 axiom.getOWLClass().accept(this);
280 for (OWLClassExpression desc : axiom.getClassExpressions()) {
281 desc.accept(this);
282 }
283 }
284
285
286 @Override
287 public void visit(OWLAnnotationAssertionAxiom axiom) {
288 MyOWLOntologyWalker.this.ax = axiom;
289 process(axiom);
290 axiom.getSubject().accept(this);
291 axiom.getAnnotation().accept(this);
292 }
293
294 @Override
295 public void visit(OWLAnnotationPropertyDomainAxiom axiom) {
296 MyOWLOntologyWalker.this.ax = axiom;
297 process(axiom);
298 axiom.getProperty().accept(this);
299 axiom.getDomain().accept(this);
300 }
301
302 @Override
303 public void visit(OWLAnnotationPropertyRangeAxiom axiom) {
304 MyOWLOntologyWalker.this.ax = axiom;
305 process(axiom);
306 axiom.getProperty().accept(this);
307 axiom.getRange().accept(this);
308 }
309
310 @Override
311 public void visit(OWLSubAnnotationPropertyOfAxiom axiom) {
312 MyOWLOntologyWalker.this.ax = axiom;
313 process(axiom);
314 axiom.getSubProperty().accept(this);
315 axiom.getSuperProperty().accept(this);
316 }
317
318 @Override
319 public void visit(OWLAnnotation node) {
320 process(node);
321 annotation = node;
322 node.getProperty().accept(this);
323 node.getValue().accept(this);
324 }
325
326 @Override
327 public void visit(OWLEquivalentClassesAxiom axiom) {
328 MyOWLOntologyWalker.this.ax = axiom;
329 process(axiom);
330 for (OWLClassExpression desc : axiom.getClassExpressions()) {
331 desc.accept(this);
332 }
333 }
334
335
336 @Override
337 public void visit(OWLEquivalentDataPropertiesAxiom axiom) {
338 MyOWLOntologyWalker.this.ax = axiom;
339 process(axiom);
340 for (OWLDataPropertyExpression prop : axiom.getProperties()) {
341 prop.accept(this);
342 }
343 }
344
345
346 @Override
347 public void visit(OWLEquivalentObjectPropertiesAxiom axiom) {
348 MyOWLOntologyWalker.this.ax = axiom;
349 process(axiom);
350 for (OWLObjectPropertyExpression prop : axiom.getProperties()) {
351 prop.accept(this);
352 }
353 }
354
355
356 @Override
357 public void visit(OWLFunctionalDataPropertyAxiom axiom) {
358 MyOWLOntologyWalker.this.ax = axiom;
359 process(axiom);
360 axiom.getProperty().accept(this);
361 }
362
363
364 @Override
365 public void visit(OWLFunctionalObjectPropertyAxiom axiom) {
366 MyOWLOntologyWalker.this.ax = axiom;
367 process(axiom);
368 axiom.getProperty().accept(this);
369 }
370
371 @Override
372 public void visit(OWLInverseFunctionalObjectPropertyAxiom axiom) {
373 MyOWLOntologyWalker.this.ax = axiom;
374 process(axiom);
375 axiom.getProperty().accept(this);
376 }
377
378
379 @Override
380 public void visit(OWLInverseObjectPropertiesAxiom axiom) {
381 MyOWLOntologyWalker.this.ax = axiom;
382 process(axiom);
383 axiom.getFirstProperty().accept(this);
384 axiom.getSecondProperty().accept(this);
385 }
386
387
388 @Override
389 public void visit(OWLIrreflexiveObjectPropertyAxiom axiom) {
390 MyOWLOntologyWalker.this.ax = axiom;
391 process(axiom);
392 axiom.getProperty().accept(this);
393 }
394
395
396 @Override
397 public void visit(OWLNegativeDataPropertyAssertionAxiom axiom) {
398 MyOWLOntologyWalker.this.ax = axiom;
399 process(axiom);
400 axiom.getSubject().accept(this);
401 axiom.getProperty().accept(this);
402 axiom.getObject().accept(this);
403 }
404
405
406 @Override
407 public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
408 MyOWLOntologyWalker.this.ax = axiom;
409 process(axiom);
410 axiom.getSubject().accept(this);
411 axiom.getProperty().accept(this);
412 axiom.getObject().accept(this);
413 }
414
415
416 @Override
417 public void visit(OWLObjectPropertyAssertionAxiom axiom) {
418 MyOWLOntologyWalker.this.ax = axiom;
419 process(axiom);
420 axiom.getSubject().accept(this);
421 axiom.getProperty().accept(this);
422 axiom.getObject().accept(this);
423 }
424
425
426 @Override
427 public void visit(OWLSubPropertyChainOfAxiom axiom) {
428 MyOWLOntologyWalker.this.ax = axiom;
429 process(axiom);
430 for (OWLObjectPropertyExpression prop : axiom.getPropertyChain()) {
431 prop.accept(this);
432 }
433 axiom.getSuperProperty().accept(this);
434 }
435
436
437 @Override
438 public void visit(OWLObjectPropertyDomainAxiom axiom) {
439 MyOWLOntologyWalker.this.ax = axiom;
440 process(axiom);
441 axiom.getDomain().accept(this);
442 axiom.getProperty().accept(this);
443 }
444
445
446 @Override
447 public void visit(OWLObjectPropertyRangeAxiom axiom) {
448 MyOWLOntologyWalker.this.ax = axiom;
449 process(axiom);
450 axiom.getProperty().accept(this);
451 axiom.getRange().accept(this);
452 }
453
454
455 @Override
456 public void visit(OWLSubObjectPropertyOfAxiom axiom) {
457 MyOWLOntologyWalker.this.ax = axiom;
458 process(axiom);
459 axiom.getSubProperty().accept(this);
460 axiom.getSuperProperty().accept(this);
461 }
462
463
464 @Override
465 public void visit(OWLReflexiveObjectPropertyAxiom axiom) {
466 MyOWLOntologyWalker.this.ax = axiom;
467 process(axiom);
468 axiom.getProperty().accept(this);
469 }
470
471
472 @Override
473 public void visit(OWLSameIndividualAxiom axiom) {
474 MyOWLOntologyWalker.this.ax = axiom;
475 process(axiom);
476 for (OWLIndividual ind : axiom.getIndividuals()) {
477 ind.accept(this);
478 }
479 }
480
481
482 @Override
483 public void visit(OWLSubClassOfAxiom axiom) {
484 MyOWLOntologyWalker.this.ax = axiom;
485 process(axiom);
486 // -ve polarity
487 axiom.getSubClass().accept(this);
488 // +ve polarity
489 axiom.getSuperClass().accept(this);
490 }
491
492
493 @Override
494 public void visit(OWLSymmetricObjectPropertyAxiom axiom) {
495 MyOWLOntologyWalker.this.ax = axiom;
496 process(axiom);
497 axiom.getProperty().accept(this);
498 }
499
500
501 @Override
502 public void visit(OWLTransitiveObjectPropertyAxiom axiom) {
503 MyOWLOntologyWalker.this.ax = axiom;
504 process(axiom);
505 axiom.getProperty().accept(this);
506 }
507
508
509 @Override
510 public void visit(SWRLRule rule) {
511 MyOWLOntologyWalker.this.ax = rule;
512 process(rule);
513 for (SWRLAtom at : rule.getBody()) {
514 at.accept(this);
515 }
516 for (SWRLAtom at : rule.getHead()) {
517 at.accept(this);
518 }
519 }
520
521 @Override
522 public void visit(OWLHasKeyAxiom axiom) {
523 MyOWLOntologyWalker.this.ax = axiom;
524 process(axiom);
525 axiom.getClassExpression().accept(this);
526 for (OWLObjectPropertyExpression prop : axiom.getObjectPropertyExpressions()) {
527 prop.accept(this);
528 }
529 for (OWLDataPropertyExpression prop : axiom.getDataPropertyExpressions()) {
530 prop.accept(this);
531 }
532 }
533
534 @Override
535 public void visit(OWLClass desc) {
536 pushClassExpression(desc);
537 process(desc);
538 desc.getIRI().accept(this);
539 popClassExpression();
540 }
541
542
543 @Override
544 public void visit(OWLDataAllValuesFrom desc) {
545 pushClassExpression(desc);
546 process(desc);
547 desc.getProperty().accept(this);
548 desc.getFiller().accept(this);
549 popClassExpression();
550 }
551
552
553 @Override
554 public void visit(OWLDataExactCardinality desc) {
555 pushClassExpression(desc);
556 process(desc);
557 desc.getProperty().accept(this);
558 desc.getFiller().accept(this);
559 popClassExpression();
560 }
561
562
563 @Override
564 public void visit(OWLDataMaxCardinality desc) {
565 pushClassExpression(desc);
566 process(desc);
567 desc.getProperty().accept(this);
568 desc.getFiller().accept(this);
569 popClassExpression();
570 }
571
572
573 @Override
574 public void visit(OWLDataMinCardinality desc) {
575 pushClassExpression(desc);
576 process(desc);
577 desc.getProperty().accept(this);
578 desc.getFiller().accept(this);
579 popClassExpression();
580 }
581
582
583 @Override
584 public void visit(OWLDataSomeValuesFrom desc) {
585 pushClassExpression(desc);
586 process(desc);
587 desc.getProperty().accept(this);
588 desc.getFiller().accept(this);
589 popClassExpression();
590 }
591
592
593 @Override
594 public void visit(OWLDataHasValue desc) {
595 pushClassExpression(desc);
596 process(desc);
597 desc.getProperty().accept(this);
598 desc.getValue().accept(this);
599 popClassExpression();
600 }
601
602
603 @Override
604 public void visit(OWLObjectAllValuesFrom desc) {
605 pushClassExpression(desc);
606 process(desc);
607 desc.getProperty().accept(this);
608 desc.getFiller().accept(this);
609 popClassExpression();
610 }
611
612
613 @Override
614 public void visit(OWLObjectComplementOf desc) {
615 pushClassExpression(desc);
616 process(desc);
617 desc.getOperand().accept(this);
618 popClassExpression();
619 }
620
621
622 @Override
623 public void visit(OWLObjectExactCardinality desc) {
624 pushClassExpression(desc);
625 process(desc);
626 desc.getProperty().accept(this);
627 desc.getFiller().accept(this);
628 popClassExpression();
629 }
630
631
632 @Override
633 public void visit(OWLObjectIntersectionOf desc) {
634 pushClassExpression(desc);
635 process(desc);
636
637 for (OWLClassExpression op : desc.getOperands()) {
638 op.accept(this);
639 }
640 popClassExpression();
641 }
642
643
644 @Override
645 public void visit(OWLObjectMaxCardinality desc) {
646 pushClassExpression(desc);
647 process(desc);
648 desc.getProperty().accept(this);
649 desc.getFiller().accept(this);
650 popClassExpression();
651 }
652
653
654 @Override
655 public void visit(OWLObjectMinCardinality desc) {
656 pushClassExpression(desc);
657 process(desc);
658 desc.getProperty().accept(this);
659 desc.getFiller().accept(this);
660 popClassExpression();
661 }
662
663
664 @Override
665 public void visit(OWLObjectOneOf desc) {
666 pushClassExpression(desc);
667 process(desc);
668 for (OWLIndividual ind : desc.getIndividuals()) {
669 ind.accept(this);
670 }
671 popClassExpression();
672 }
673
674
675 @Override
676 public void visit(OWLObjectHasSelf desc) {
677 pushClassExpression(desc);
678 process(desc);
679 desc.getProperty().accept(this);
680 popClassExpression();
681 }
682
683
684 @Override
685 public void visit(OWLObjectSomeValuesFrom desc) {
686 pushClassExpression(desc);
687 process(desc);
688 desc.getProperty().accept(this);
689 desc.getFiller().accept(this);
690 popClassExpression();
691 }
692
693
694 @Override
695 public void visit(OWLObjectUnionOf desc) {
696 pushClassExpression(desc);
697 process(desc);
698 for (OWLClassExpression op : desc.getOperands()) {
699 op.accept(this);
700 }
701 popClassExpression();
702 }
703
704
705 @Override
706 public void visit(OWLObjectHasValue desc) {
707 pushClassExpression(desc);
708 process(desc);
709 desc.getProperty().accept(this);
710 desc.getValue().accept(this);
711 popClassExpression();
712 }
713
714
715 @Override
716 public void visit(OWLDataComplementOf node) {
717 pushDataRange(node);
718 process(node);
719 node.getDataRange().accept(this);
720 popDataRange();
721 }
722
723
724 @Override
725 public void visit(OWLDataOneOf node) {
726 pushDataRange(node);
727 process(node);
728 for (OWLLiteral con : node.getValues()) {
729 con.accept(this);
730 }
731 popDataRange();
732 }
733
734 @Override
735 public void visit(OWLDataIntersectionOf node) {
736 pushDataRange(node);
737 process(node);
738 for (OWLDataRange rng : node.getOperands()) {
739 rng.accept(this);
740 }
741 popDataRange();
742 }
743
744 @Override
745 public void visit(OWLDataUnionOf node) {
746 pushDataRange(node);
747 process(node);
748 for (OWLDataRange rng : node.getOperands()) {
749 rng.accept(this);
750 }
751 popDataRange();
752 }
753
754 @Override
755 public void visit(OWLFacetRestriction node) {
756 process(node);
757 node.getFacetValue().accept(this);
758 }
759
760
761 @Override
762 public void visit(OWLDatatypeRestriction node) {
763 pushDataRange(node);
764 process(node);
765 node.getDatatype().accept(this);
766 for (OWLFacetRestriction fr : node.getFacetRestrictions()) {
767 fr.accept(this);
768 }
769 popDataRange();
770 }
771
772
773 @Override
774 public void visit(OWLDatatype node) {
775 pushDataRange(node);
776 process(node);
777 popDataRange();
778 }
779
780 @Override
781 public void visit(OWLLiteral node) {
782 process(node);
783 node.getDatatype().accept(this);
784 popDataRange();
785 }
786
787 @Override
788 public void visit(OWLAnnotationProperty property) {
789 process(property);
790 property.getIRI().accept(this);
791 }
792
793 @Override
794 public void visit(OWLDataProperty property) {
795 process(property);
796 property.getIRI().accept(this);
797 }
798
799
800 @Override
801 public void visit(OWLObjectProperty property) {
802 process(property);
803 property.getIRI().accept(this);
804 }
805
806
807 @Override
808 public void visit(OWLObjectInverseOf property) {
809 process(property);
810 property.getInverse().accept(this);
811 }
812
813
814 @Override
815 public void visit(OWLNamedIndividual individual) {
816 process(individual);
817 individual.getIRI().accept(this);
818 }
819
820 @Override
821 public void visit(OWLAnonymousIndividual individual) {
822 process(individual);
823 }
824
825 @Override
826 public void visit(SWRLLiteralArgument node) {
827 process(node);
828 node.getLiteral().accept(this);
829 }
830
831
832 @Override
833 public void visit(SWRLVariable node) {
834 process(node);
835 }
836
837
838 @Override
839 public void visit(SWRLIndividualArgument node) {
840 process(node);
841 node.getIndividual().accept(this);
842 }
843
844
845 @Override
846 public void visit(SWRLBuiltInAtom node) {
847 process(node);
848 for (SWRLDArgument at : node.getArguments()) {
849 at.accept(this);
850 }
851 }
852
853
854 @Override
855 public void visit(SWRLClassAtom node) {
856 process(node);
857 node.getArgument().accept(this);
858 node.getPredicate().accept(this);
859 }
860
861
862 @Override
863 public void visit(SWRLDataRangeAtom node) {
864 process(node);
865 node.getArgument().accept(this);
866 node.getPredicate().accept(this);
867 }
868
869
870 @Override
871 public void visit(SWRLDataPropertyAtom node) {
872 process(node);
873 node.getPredicate().accept(this);
874 node.getFirstArgument().accept(this);
875 node.getSecondArgument().accept(this);
876 }
877
878
879 @Override
880 public void visit(SWRLDifferentIndividualsAtom node) {
881 process(node);
882 node.getFirstArgument().accept(this);
883 node.getSecondArgument().accept(this);
884 }
885
886
887 @Override
888 public void visit(SWRLObjectPropertyAtom node) {
889 process(node);
890 node.getPredicate().accept(this);
891 node.getFirstArgument().accept(this);
892 node.getSecondArgument().accept(this);
893 }
894
895
896 @Override
897 public void visit(SWRLSameIndividualAtom node) {
898 process(node);
899 node.getFirstArgument().accept(this);
900 node.getSecondArgument().accept(this);
901 }
902
903
904 @Override
905 public void visit(OWLDatatypeDefinitionAxiom axiom) {
906 MyOWLOntologyWalker.this.ax = axiom;
907 process(axiom);
908 axiom.getDatatype().accept(this);
909 axiom.getDataRange().accept(this);
910 }
911 }
912}
913