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