Package com.clarkparsia.pellint.model

Examples of com.clarkparsia.pellint.model.LintFixer


    if (namedClass != null && cardinalityRestriction != null) {
      Lint lint = makeLint();
      lint.addParticipatingClass(namedClass);
      lint.addParticipatingAxiom(axiom);
      OWLAxiom newAxiom = OWL.subClassOf(namedClass, cardinalityRestriction);
      LintFixer fixer = new LintFixer(axiom, newAxiom);
      lint.setLintFixer(fixer);
      setLint(lint);
    }
  }
View Full Code Here


      Lint lint = new Lint(this, ontology);
      lint.addParticipatingClass(owlClass);
      lint.addAllParticipatingAxioms(badEquivalents);
      lint.addAllParticipatingAxioms(subclasses);
      Set<OWLClassAxiom> fixedAxioms = fixEquivalentAxioms(owlClass, badEquivalents);
      LintFixer fixer = new LintFixer(badEquivalents, fixedAxioms);
      lint.setLintFixer(fixer);
      allLints.add(lint);
    }
   
    return allLints;
View Full Code Here

    if (namedClass != null && all != null) {
      Lint lint = makeLint();
      lint.addParticipatingClass(namedClass);
      lint.addParticipatingAxiom(axiom);
      OWLAxiom newAxiom = OWL.subClassOf(namedClass, all);
      LintFixer fixer = new LintFixer(axiom, newAxiom);
      lint.setLintFixer(fixer);
      setLint(lint);
    }
  }
View Full Code Here

    if (namedClass != null && complementOf != null) {
      Lint lint = makeLint();
      lint.addParticipatingClass(namedClass);
      lint.addParticipatingAxiom(axiom);
      OWLAxiom newAxiom = OWL.subClassOf(namedClass, complementOf);
      LintFixer fixer = new LintFixer(axiom, newAxiom);
      lint.setLintFixer(fixer);
      setLint(lint);
    }
  }
View Full Code Here

  public void visit(OWLEquivalentClassesAxiom axiom) {
    if (axiom.getClassExpressions().contains(OWL.Thing)) {
      Lint lint = makeLint();
      lint.addParticipatingAxiom(axiom);
      LintFixer fixer = new LintFixer(Collections.singleton(axiom), new HashSet<OWLAxiom>());
      lint.setLintFixer(fixer);
      setLint(lint);
    }
  }
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

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.