Package com.clarkparsia.pellint.model

Examples of com.clarkparsia.pellint.model.LintFixer


  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


   
    Lint lint = m_Pattern.match(m_Ontology, axiom);
    assertNotNull(lint);
    assertTrue(lint.getParticipatingClasses().contains(m_Cls[0]));
   
    LintFixer fixer = lint.getLintFixer();
    assertTrue(fixer.getAxiomsToRemove().contains(axiom));
    OWLAxiom expectedAxiom = OWL.subClassOf(m_Cls[0], m_P0AllC0);
    assertTrue(fixer.getAxiomsToAdd().contains(expectedAxiom));
   
    assertNull(lint.getSeverity());
    assertSame(m_Ontology, lint.getParticipatingOntology());
  }
View Full Code Here

    addAxiom(m_Axioms[0]);
    addAxiom(m_Axioms[1]);
   
    Set<OWLAxiom> axiomsToRemove = CollectionUtil.asSet(m_Axioms[0], m_Axioms[1]);
    Set<OWLAxiom> axiomsToAdd = CollectionUtil.asSet(m_Axioms[2]);
    LintFixer fixer = new LintFixer(axiomsToRemove, axiomsToAdd);
    assertTrue(fixer.apply(m_Manager, m_Ontology));
   
    Set<OWLAxiom> axioms = m_Ontology.getAxioms();
    assertEquals(1, axioms.size());
    assertTrue(axioms.contains(m_Axioms[2]));
  }
View Full Code Here

  public void testOldAxiomsDontExist() throws OWLException {
    addAxiom(m_Axioms[0]);
   
    Set<OWLAxiom> axiomsToRemove = CollectionUtil.asSet(m_Axioms[0], m_Axioms[1]);
    Set<OWLAxiom> axiomsToAdd = CollectionUtil.asSet(m_Axioms[2]);
    LintFixer fixer = new LintFixer(axiomsToRemove, axiomsToAdd);
    assertFalse(fixer.apply(m_Manager, m_Ontology));
   
    Set<OWLAxiom> axioms = m_Ontology.getAxioms();
    assertEquals(1, axioms.size());
    assertTrue(axioms.contains(m_Axioms[0]));
  }
View Full Code Here

    addAxiom(m_Axioms[1]);
    addAxiom(m_Axioms[2]);
   
    Set<OWLAxiom> axiomsToRemove = CollectionUtil.asSet(m_Axioms[0], m_Axioms[1]);
    Set<OWLAxiom> axiomsToAdd = CollectionUtil.asSet(m_Axioms[2]);
    LintFixer fixer = new LintFixer(axiomsToRemove, axiomsToAdd);
    assertTrue(fixer.apply(m_Manager, m_Ontology));
   
    Set<OWLAxiom> axioms = m_Ontology.getAxioms();
    assertEquals(1, axioms.size());
    assertTrue(axioms.contains(m_Axioms[2]));
  }
View Full Code Here

   
    Lint lint = m_Pattern.match(m_Ontology, axiom);
    assertNotNull(lint);
    assertTrue(lint.getParticipatingClasses().contains(m_Cls[0]));
   
    LintFixer fixer = lint.getLintFixer();
    assertTrue(fixer.getAxiomsToRemove().contains(axiom));
    OWLAxiom expectedAxiom = OWL.subClassOf(m_Cls[0], comp);
    assertTrue(fixer.getAxiomsToAdd().contains(expectedAxiom));

    assertNull(lint.getSeverity());
    assertSame(m_Ontology, lint.getParticipatingOntology());
  }
View Full Code Here

    OWLAxiom axiom = OWL.equivalentClasses(m_Cls[0], comp);
    Lint lint = m_Pattern.match(m_Ontology, axiom);
    assertNotNull(lint);
    assertTrue(lint.getParticipatingClasses().contains(m_Cls[0]));
   
    LintFixer fixer = lint.getLintFixer();
    assertTrue(fixer.getAxiomsToRemove().contains(axiom));
    OWLAxiom expectedAxiom = OWL.subClassOf(m_Cls[0], comp);
    assertTrue(fixer.getAxiomsToAdd().contains(expectedAxiom));
  }
View Full Code Here

    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));
   
View Full Code Here

    OWLAxiom fixedAxiom2 = OWL.subClassOf(m_Cls[0], OWL.and(restOf));
           
    List<Lint> lints = m_Pattern.match(m_Ontology);
    assertEquals(1, lints.size());
   
    LintFixer fixer = lints.get(0).getLintFixer();
    Set<? extends OWLAxiom> axiomsToRemove = fixer.getAxiomsToRemove();
    Set<? extends OWLAxiom> axiomsToAdd = fixer.getAxiomsToAdd();
    assertEquals(1, axiomsToRemove.size());
    assertTrue(axiomsToRemove.contains(badAxiom));
    assertEquals(2, axiomsToAdd.size());
    assertTrue(axiomsToAdd.contains(fixedAxiom1));
    assertTrue(axiomsToAdd.contains(fixedAxiom2));
View Full Code Here

    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));
    assertEquals(2, axiomsToAdd.size());
    assertTrue(axiomsToAdd.contains(fixedAxiom1));
View Full Code Here

TOP

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

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.