コード例 #1
0
 @Override
 public void visit(OWLEquivalentClassesAxiom axiom) {
   if (axiom.getClassExpressions().size() > 2) {
     Set<Set<OWLClassExpression>> rendered = new HashSet<Set<OWLClassExpression>>();
     for (OWLClassExpression left : axiom.getClassExpressions()) {
       for (OWLClassExpression right : axiom.getClassExpressions()) {
         if (left != right) {
           Set<OWLClassExpression> cur = CollectionFactory.createSet(left, right);
           if (!rendered.contains(cur)) {
             rendered.add(cur);
             left.accept(this);
             writeSpace();
             write(EQUIV);
             writeSpace();
             right.accept(this);
           }
         }
       }
     }
   } else if (axiom.getClassExpressions().size() == 2) {
     Iterator<OWLClassExpression> it = axiom.getClassExpressions().iterator();
     OWLClassExpression descA = it.next();
     OWLClassExpression descB = it.next();
     OWLClassExpression lhs;
     OWLClassExpression rhs;
     if (subject.equals(descA)) {
       lhs = descA;
       rhs = descB;
     } else {
       lhs = descB;
       rhs = descA;
     }
     lhs.accept(this);
     writeSpace();
     write(EQUIV);
     writeSpace();
     rhs.accept(this);
   }
 }
コード例 #2
0
 public void actionPerformed(ActionEvent e) {
   OWLClass selClass = getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass();
   List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>();
   Set<OWLClassExpression> operands = new HashSet<OWLClassExpression>();
   for (OWLOntology ont : getOWLModelManager().getActiveOntologies()) {
     for (OWLSubClassOfAxiom ax : ont.getSubClassAxiomsForSubClass(selClass)) {
       changes.add(new RemoveAxiom(ont, ax));
       operands.add(ax.getSuperClass());
     }
   }
   if (operands.isEmpty()) {
     return;
   }
   OWLDataFactory df = getOWLModelManager().getOWLDataFactory();
   OWLClassExpression equCls;
   if (operands.size() == 1) {
     equCls = operands.iterator().next();
   } else {
     equCls = df.getOWLObjectIntersectionOf(operands);
   }
   OWLAxiom ax = df.getOWLEquivalentClassesAxiom(CollectionFactory.createSet(selClass, equCls));
   changes.add(new AddAxiom(getOWLModelManager().getActiveOntology(), ax));
   getOWLModelManager().applyChanges(changes);
 }
コード例 #3
0
 @Override
 public Set<OWLDataRange> getOperands() {
   return CollectionFactory.getCopyOnRequestSetFromImmutableCollection(operands);
 }
コード例 #4
0
 /** @return the resulting owl objects */
 public Set<OWLObject> getResult() {
   return CollectionFactory.getCopyOnRequestSetFromMutableCollection(result);
 }
コード例 #5
0
 @Override
 public Set<OWLClassExpression> getClassExpressions() {
   return CollectionFactory.getCopyOnRequestSetFromImmutableCollection(classExpressions);
 }
コード例 #6
0
ファイル: MapPointer.java プロジェクト: rita-zgheib/owl-api
 public Set<V> getValues(K key) {
   return CollectionFactory.getCopyOnRequestSetFromMutableCollection(map.get(key));
 }
コード例 #7
0
ファイル: MapPointer.java プロジェクト: rita-zgheib/owl-api
 public Set<K> keySet() {
   return CollectionFactory.getCopyOnRequestSetFromMutableCollection(map.keySet());
 }
コード例 #8
0
 @Override
 public Set<OWLFacetRestriction> getFacetRestrictions() {
   return CollectionFactory.getCopyOnRequestSetFromImmutableCollection(facetRestrictions);
 }
 protected OWLEquivalentObjectPropertiesAxiom createAxiom(OWLObjectPropertyExpression object) {
   return getOWLDataFactory()
       .getOWLEquivalentObjectPropertiesAxiom(
           CollectionFactory.createSet(getRootObject(), object));
 }
コード例 #10
0
ファイル: SWRLRuleImpl.java プロジェクト: Ganesh1238/owlapi
 @Override
 public Set<SWRLAtom> getHead() {
   return CollectionFactory.getCopyOnRequestSetFromImmutableCollection(head);
 }