Esempio n. 1
0
  @Test
  public void testFunctionalSomeTermNoGovTerm()
      throws ENodeMergeException, ParseException, EReasonerException, EInconsistencyException {
    final IIndividualABoxNode<String, String, String, String> node = _abox.createIndividualNode();
    _abox.getAssertedRBox().addRole("r", RoleType.OBJECT_PROPERTY);
    _abox.getAssertedRBox().setRoleProperty("r", RoleProperty.FUNCTIONAL);

    node.addClassTerm(_parser.parse("(some r A)"));

    assertFalse(_abox.getDependencyMap().hasGoverningTerm(node, _parser.parse("(some r A)")));
    _reasoner.getReasonerOptions().setSemanticBranching(false);
    final Collection<? extends IReasonerResult<String, String, String, String>> results =
        _reasoner.checkConsistency(_abox, false);
    assertEquals(1, results.size());

    for (IReasonerResult<String, String, String, String> result : results) {
      final IABox<String, String, String, String> abox = result.getABox();
      final IABoxNode<String, String, String, String> node2 = abox.getNode(node.getNodeID());
      assertEquals(1, node2.getRABox().getSuccessorNodes().size());
      final IABoxNode<String, String, String, String> succ =
          node2.getRABox().getSuccessorNodes().iterator().next();
      assertFalse(abox.getDependencyMap().hasGoverningTerm(succ, _parser.parse("A")));
      assertFalse(abox.getDependencyMap().hasGoverningTerm(node2, _parser.parse("(some r A)")));
    }
  }
Esempio n. 2
0
  @Test
  public void testUnionGovTermIntroductionWasGovTerm()
      throws ENodeMergeException, ParseException, EReasonerException, EInconsistencyException {
    final IIndividualABoxNode<String, String, String, String> node = _abox.createIndividualNode();
    node.addClassTerm(_parser.parse("(or A B)"));

    _reasoner.getReasonerOptions().setSemanticBranching(false);
    final Collection<? extends IReasonerResult<String, String, String, String>> results =
        _reasoner.checkConsistency(_abox, false);
    assertEquals(2, results.size());

    for (IReasonerResult<String, String, String, String> result : results) {
      final IABox<String, String, String, String> abox = result.getABox();
      assertTrue(
          abox.getDependencyMap().hasGoverningTerm(node, _parser.parse("A"))
              ^ abox.getDependencyMap().hasGoverningTerm(node, _parser.parse("B")));
      assertFalse(abox.getDependencyMap().hasGoverningTerm(node, _parser.parse("(or A B)")));
    }
  }