コード例 #1
0
 @Override
 public void visit(OWLDisjointClassesAxiom axiom) {
   if (axiom.getClassExpressions().size() != 2) {
     for (OWLClassExpression left : axiom.getClassExpressions()) {
       for (OWLClassExpression right : axiom.getClassExpressions()) {
         if (left != right) {
           if (left.equals(subject)) {
             left.accept(this);
             writeSpace();
             write(SUBCLASS);
             writeSpace();
             write(NOT);
             writeSpace();
             right.accept(this);
           } else {
             right.accept(this);
             writeSpace();
             write(SUBCLASS);
             writeSpace();
             write(NOT);
             writeSpace();
             left.accept(this);
           }
           writer.writeNewLine();
         }
       }
     }
   } else {
     Iterator<OWLClassExpression> it = axiom.getClassExpressions().iterator();
     OWLClassExpression descA = it.next();
     OWLClassExpression descB = it.next();
     OWLClassExpression lhs;
     OWLClassExpression rhs;
     if (descA.equals(subject)) {
       lhs = descA;
       rhs = descB;
     } else {
       lhs = descB;
       rhs = descA;
     }
     lhs.accept(this);
     writeSpace();
     write(SUBCLASS);
     writeSpace();
     write(NOT);
     writeSpace();
     rhs.accept(this);
   }
 }
コード例 #2
0
 private void writeCloseBrace() {
   writer.writeCloseBrace();
 }
コード例 #3
0
 private void write(Object o) {
   writer.write(o);
 }
コード例 #4
0
 private void writeOpenBrace() {
   writer.writeOpenBrace();
 }
コード例 #5
0
 private void writeSpace() {
   writer.writeSpace();
 }