Package com.clarkparsia.pellint.model

Examples of com.clarkparsia.pellint.model.Lint


  private void visitNaryClassAxiom(OWLClassAxiom axiom) {
    m_Visitor.reset();
    axiom.accept(m_Visitor);
    int cardinalitySize = m_Visitor.getCardinalitySize();
    if (cardinalitySize > m_MaxAllowed) {
      Lint lint = makeLint();
      lint.addParticipatingAxiom(axiom);
      lint.setSeverity(new Severity(cardinalitySize));
      setLint(lint);
    }
  }
View Full Code Here


        all = owlDesc;
      }
    }
   
    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

        complementOf = owlDesc;
      }
    }
   
    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 abstract class AxiomLintPattern extends OWLAxiomVisitorAdapter implements LintPattern {
  private Lint m_Lint;
  private OWLOntology m_Ontology;
 
  protected Lint makeLint() {
    return new Lint(this, m_Ontology);
  }
View Full Code Here

    return DEFAULT_LINT_FORMAT;
  }

  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

    m_MockPattern = new MockLintPattern();
  }
 
  @Test
  public void testWithoutFixer() throws OWLOntologyChangeException {
    Lint lint = new Lint(m_MockPattern, m_Ontology);
    assertSame(m_MockPattern, lint.getPattern());
    assertSame(m_Ontology, lint.getParticipatingOntology());
    assertFalse(lint.applyFix(m_Manager));
  }
View Full Code Here

    assertFalse(lint.applyFix(m_Manager));
  }

  @Test
  public void testWithFixer() throws OWLOntologyChangeException {
    Lint lint = new Lint(m_MockPattern, m_Ontology);
    MockLintFixer fixer = new MockLintFixer();
    lint.setLintFixer(fixer);
    assertTrue(lint.applyFix(m_Manager));
    assertTrue(fixer.applyCalled);
  }
View Full Code Here

  @Test
  public void testComplementOfItself() throws OWLException {
    OWLClassExpression comp = OWL.not(m_Cls[0]);
    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));

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

 
  @Test
  public void testComplementOfOthers() throws OWLException {
    OWLClassExpression comp = OWL.not(OWL.or(m_Cls[1], m_Cls[2]));
    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

  }
 
  @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

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.