Package com.clarkparsia.pellint.model

Examples of com.clarkparsia.pellint.model.Lint


    assertEquals(0, lints.size());
   
    addAxiom(OWL.differentFrom(m_Ind[3], m_Ind[4]));
    lints = m_Pattern.match(m_Ontology);
    assertEquals(1, lints.size());
    Lint lint = lints.get(0);
    assertNull(lint.getLintFixer());
    assertEquals(6 + 2, lint.getSeverity().doubleValue(), DOUBLE_DELTA);
    assertSame(m_Ontology, lint.getParticipatingOntology());
  }
View Full Code Here


    assertEquals(0, lints.size());
   
    m_Pattern.setMaxTreeSize(EXPECTED_SIZE - 1);
    lints = m_Pattern.match(m_Ontology);
    assertEquals(1, lints.size());
    Lint lint = lints.get(0);
    assertEquals(EXPECTED_SIZE, lint.getSeverity().doubleValue(), DOUBLE_DELTA);
    assertEquals(5, lint.getParticipatingClasses().size());
    assertSame(m_Ontology, lint.getParticipatingOntology());
  }
View Full Code Here

   
    final int EXPECTED_SIZE = 1 * 5;
    m_Pattern.setMaxTreeSize(EXPECTED_SIZE - 1);
    List<Lint> lints = m_Pattern.match(m_Ontology);
    assertEquals(1, lints.size());
    Lint lint = lints.get(0);
    assertEquals(EXPECTED_SIZE, lint.getSeverity().doubleValue(), DOUBLE_DELTA);
    assertEquals(3, lint.getParticipatingClasses().size());
  }
View Full Code Here

   
    final int EXPECTED_SIZE = 3 + 3 + 4;
    m_Pattern.setMaxTreeSize(EXPECTED_SIZE - 1);
    List<Lint> lints = m_Pattern.match(m_Ontology);
    assertEquals(1, lints.size());
    Lint lint = lints.get(0);
    assertEquals(EXPECTED_SIZE, lint.getSeverity().doubleValue(), DOUBLE_DELTA);
    assertEquals(3, lint.getParticipatingClasses().size());
  }
View Full Code Here

    addAxiom(OWL.equivalentClasses(CollectionUtil.<OWLClassExpression>asSet(m_Cls[0], m_Cls[3], m_Cls[4])));
   
    List<Lint> lints = m_Pattern.match(m_Ontology);
    assertEquals(1, lints.size());
   
    Lint lint = lints.get(0);
    Set<OWLClass> participatingClasses = lint.getParticipatingClasses();
    assertEquals(1, participatingClasses.size());
    assertTrue(participatingClasses.contains(m_Cls[0]));
   
    LintFixer fixer = lint.getLintFixer();
    Set<? extends OWLAxiom> axiomsToRemove = fixer.getAxiomsToRemove();
    Set<? extends OWLAxiom> axiomsToAdd = fixer.getAxiomsToAdd();
    assertEquals(1, axiomsToRemove.size());
    assertTrue(axiomsToRemove.contains(badAxiom));
    assertEquals(1, axiomsToAdd.size());
    assertTrue(axiomsToAdd.contains(fixedAxiom));
   
    assertNull(lint.getSeverity());
    assertSame(m_Ontology, lint.getParticipatingOntology());
  }
View Full Code Here

    addAxiom(badAxiom2);
   
    List<Lint> lints = m_Pattern.match(m_Ontology);
    assertEquals(1, lints.size());
   
    Lint lint = lints.get(0);
    Set<OWLClass> participatingClasses = lint.getParticipatingClasses();
    assertEquals(1, participatingClasses.size());
    assertTrue(participatingClasses.contains(m_Cls[0]));
   
    LintFixer fixer = lint.getLintFixer();
    Set<? extends OWLAxiom> axiomsToRemove = fixer.getAxiomsToRemove();
    Set<? extends OWLAxiom> axiomsToAdd = fixer.getAxiomsToAdd();
    assertEquals(2, axiomsToRemove.size());
    assertTrue(axiomsToRemove.contains(badAxiom1));
    assertTrue(axiomsToRemove.contains(badAxiom2));
View Full Code Here

  }
 
  @Test
  public void testSimple() throws OWLException {
    OWLAxiom axiom = OWL.equivalentClasses(CollectionUtil.<OWLClassExpression>asSet(OWL.Thing, m_Cls[0], m_Cls[1]));
    Lint lint = m_Pattern.match(m_Ontology, axiom);
    assertNotNull(lint);
   
    LintFixer fixer = lint.getLintFixer();
    assertTrue(fixer.getAxiomsToRemove().contains(axiom));
    assertTrue(fixer.getAxiomsToAdd().isEmpty());
   
    assertNull(lint.getSeverity());
    assertSame(m_Ontology, lint.getParticipatingOntology());
  }
View Full Code Here

 
  @Test
  public void testComplexEquivalence() throws OWLException {
    OWLAxiom axiom = OWL.equivalentClasses(CollectionUtil.<OWLClassExpression>asSet(m_Cls[0], m_P0AllC0, m_P0SomeC1));
   
    Lint lint = m_Pattern.match(m_Ontology, axiom);
    assertNotNull(lint);
    assertTrue(lint.getParticipatingClasses().isEmpty());
    assertTrue(lint.getParticipatingAxioms().contains(axiom));
   
    assertNull(lint.getSeverity());
    assertSame(m_Ontology, lint.getParticipatingOntology());
  }
View Full Code Here

 
  @Test
  public void testGCI() throws OWLException {
    OWLAxiom axiom = OWL.subClassOf(m_P0AllC0, m_Cls[1]);
   
    Lint lint = m_Pattern.match(m_Ontology, axiom);
    assertNotNull(lint);
    assertTrue(lint.getParticipatingClasses().isEmpty());
    assertTrue(lint.getParticipatingAxioms().contains(axiom));
  }
View Full Code Here

  public void testSimple() throws OWLException {
    m_Pattern.setMaxAllowed(2);

    OWLClassExpression union = OWL.or(m_Cls[1], m_Cls[2], m_Cls[3]);
    OWLAxiom axiom = OWL.subClassOf(m_Cls[0], union);
    Lint lint = m_Pattern.match(m_Ontology, axiom);
    assertNotNull(lint);
    assertSame(m_Pattern, lint.getPattern());
    assertEquals(1, lint.getParticipatingAxioms().size());
    assertNull(lint.getLintFixer());
    assertEquals(3.0, lint.getSeverity().doubleValue(), DOUBLE_DELTA);
    assertSame(m_Ontology, lint.getParticipatingOntology());
  }
View Full Code Here

TOP

Related Classes of com.clarkparsia.pellint.model.Lint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.