protected void refillInferred() {
   getOWLModelManager()
       .getReasonerPreferences()
       .executeTask(
           OptionalInferenceTask.SHOW_INFERRED_EQUIVALENT_OBJECT_PROPERTIES,
           () -> {
             if (!getOWLModelManager().getReasoner().isConsistent()) {
               return;
             }
             Node<OWLObjectPropertyExpression> equivalentObjectProperties =
                 getReasoner().getEquivalentObjectProperties(getRootObject());
             if (!equivalentObjectProperties.getEntitiesMinus(getRootObject()).isEmpty()) {
               OWLEquivalentObjectPropertiesAxiom ax =
                   getOWLDataFactory()
                       .getOWLEquivalentObjectPropertiesAxiom(
                           equivalentObjectProperties.getEntities());
               if (!added.contains(ax)) {
                 addInferredRowIfNontrivial(
                     new OWLEquivalentObjectPropertiesAxiomFrameSectionRow(
                         getOWLEditorKit(),
                         OWLEquivalentObjectPropertiesAxiomFrameSection.this,
                         null,
                         getRootObject(),
                         ax));
               }
             }
           });
 }
예제 #2
0
 private static void printNode(Node<OWLClass> node) {
   // Print out a node as a list of class names in curly brackets
   System.out.print("{");
   for (Iterator<OWLClass> it = node.getEntities().iterator(); it.hasNext(); ) {
     OWLClass cls = it.next();
     // User a prefix manager to provide a slightly nicer shorter name
     System.out.print(pm.getShortForm(cls));
     if (it.hasNext()) {
       System.out.print(" ");
     }
   }
   System.out.println("}");
 }
예제 #3
0
 public Set<OWLClass> getEquivalentClasses(String classExpressionString) {
   if (classExpressionString.trim().length() == 0) {
     return Collections.emptySet();
   }
   OWLClassExpression classExpression = parser.parseClassExpression(classExpressionString);
   Node<OWLClass> equivalentClasses = reasoner.getEquivalentClasses(classExpression);
   Set<OWLClass> result = null;
   if (classExpression.isAnonymous()) {
     result = equivalentClasses.getEntities();
   } else {
     result = equivalentClasses.getEntitiesMinus(classExpression.asOWLClass());
   }
   return result;
 }
예제 #4
0
 @Test
 public void shouldGetBottomDataPropertyNode() {
   Node<OWLDataProperty> node = reasoner.getBottomDataPropertyNode();
   assertThat(node.getEntities(), is(Collections.singleton(owlBottomDataProperty)));
 }
예제 #5
0
 @Test
 public void shouldGetTopObjectPropertyNode() {
   Node<OWLObjectPropertyExpression> node = reasoner.getTopObjectPropertyNode();
   assertThat(node.getEntities(), is(Collections.singleton(owlTopObjectProperty)));
 }
예제 #6
0
 @Test
 public void shouldGetBottomClassNode() {
   Node<OWLClass> node = reasoner.getBottomClassNode();
   assertThat(node.getEntities(), is(Collections.singleton(owlNothing)));
 }