Examples of PelletExplanation


Examples of com.clarkparsia.owlapi.explanation.PelletExplanation

    // Create the reasoner and load the ontology
    PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner( ontology );

    // Create an explanation generator
    PelletExplanation expGen = new PelletExplanation( reasoner );

    // Create some concepts
    OWLClass madCow = OWL.Class( NS + "mad+cow" );
    OWLClass animalLover = OWL.Class( NS + "animal+lover" );
    OWLClass petOwner = OWL.Class( NS + "pet+owner" );

    // Explain why mad cow is an unsatisfiable concept
    Set<Set<OWLAxiom>> exp = expGen.getUnsatisfiableExplanations( madCow );
    out.println( "Why is " + madCow + " concept unsatisfiable?" );   
    renderer.render( exp );

    // Now explain why animal lover is a sub class of pet owner
    exp = expGen.getSubClassExplanations( animalLover, petOwner );
    out.println( "Why is " + animalLover + " subclass of " + petOwner + "?" );
    renderer.render( exp );
   
    renderer.endRendering();
  }
View Full Code Here

Examples of com.clarkparsia.owlapi.explanation.PelletExplanation

    // Create the reasoner and load the ontology
    PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner( ontology );

    // Create an explanation generator
    PelletExplanation expGen = new PelletExplanation( reasoner );

    // Create some concepts
    OWLClass madCow = OWL.Class( NS + "mad+cow" );
    OWLClass animalLover = OWL.Class( NS + "animal+lover" );
    OWLClass petOwner = OWL.Class( NS + "pet+owner" );

    // Explain why mad cow is an unsatisfiable concept
    Set<Set<OWLAxiom>> exp = expGen.getUnsatisfiableExplanations( madCow );
    out.println( "Why is " + madCow + " concept unsatisfiable?" );   
    renderer.render( exp );

    // Now explain why animal lover is a sub class of pet owner
    exp = expGen.getSubClassExplanations( animalLover, petOwner );
    out.println( "Why is " + animalLover + " subclass of " + petOwner + "?" );
    renderer.render( exp );
   
    renderer.endRendering();
  }
View Full Code Here

Examples of com.clarkparsia.owlapi.explanation.PelletExplanation

    axioms.add(OWL.classAssertion(j, B));
    axioms.add(OWL.sameAs(i, j));

    OWLOntology ontology = OWL.Ontology(axioms);
    PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);
    PelletExplanation explain = new PelletExplanation(reasoner);

    assertFalse(explain.getInconsistencyExplanations().isEmpty());
  }
View Full Code Here

Examples of com.clarkparsia.owlapi.explanation.PelletExplanation

    Set<OWLAxiom> axioms = new HashSet<OWLAxiom>();
    axioms.add(OWL.equivalentClasses(A, OWL.oneOf(a, b)));

    OWLOntology ontology = OWL.Ontology(axioms);
    PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);
    PelletExplanation explain = new PelletExplanation(reasoner);

    assertEquals( axioms, explain.getEntailmentExplanation(OWL.classAssertion(a, A)) );
  }
View Full Code Here

Examples of com.clarkparsia.owlapi.explanation.PelletExplanation

    Set<OWLAxiom> axioms = new HashSet<OWLAxiom>();
    axioms.add(OWL.equivalentClasses(A, OWL.oneOf(a)));

    OWLOntology ontology = OWL.Ontology(axioms);
    PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);
    PelletExplanation explain = new PelletExplanation(reasoner);

    assertEquals( axioms, explain.getEntailmentExplanation(OWL.classAssertion(a, A)) );
  }
View Full Code Here

Examples of com.clarkparsia.owlapi.explanation.PelletExplanation

                    OWL.subClassOf(Mountain, UplandArea), OWL.subClassOf(UplandArea, OWL.not(Volcano)),
                    OWL.disjointClasses(UplandArea, Volcano) };

    OWLOntology ontology = OWL.Ontology(axioms);
    PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);
    PelletExplanation explain = new PelletExplanation(reasoner);

    // bug 453 manifested by throwing an OWLRuntimeException from the following statement
    // (number of explanations is important -- there are two explanations in this case, and the problem
    // only occurs if both of them are produced)
    Set<Set<OWLAxiom>> actual = explain.getUnsatisfiableExplanations(VolcanicMountain, 0);

    Set<OWLAxiom> f = SetUtils.create(axioms[0], axioms[1], axioms[2], axioms[3]);
    Set<OWLAxiom> s = SetUtils.create(axioms[0], axioms[1], axioms[2], axioms[4]);
    @SuppressWarnings("unchecked")
    Set<Set<OWLAxiom>> expected = SetUtils.create(f, s);
View Full Code Here

Examples of com.clarkparsia.owlapi.explanation.PelletExplanation

    axioms.add( OWL.classAssertion( i, B ) );
    axioms.add( OWL.classAssertion( j, C ) );

    OWLOntology ontology = OWL.Ontology( axioms );
    PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner( ontology );
    PelletExplanation explain = new PelletExplanation( reasoner );

    Set<Set<OWLAxiom>> actual = explain.getInconsistencyExplanations();

    Set<OWLAxiom> f = new HashSet<OWLAxiom>();
    f.add( OWL.classAssertion( i, B ) );
    f.add( OWL.classAssertion( i, A ) );
    f.add( OWL.disjointClasses( A, B ) );
View Full Code Here

Examples of com.clarkparsia.owlapi.explanation.PelletExplanation

    axioms.add(OWL.classAssertion(i, A));
    axioms.add(OWL.classAssertion(i, B));

    OWLOntology ontology = OWL.Ontology(axioms);
    PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);
    PelletExplanation explain = new PelletExplanation(reasoner);

    assertFalse(explain.getInconsistencyExplanations().isEmpty());
  }
View Full Code Here

Examples of com.clarkparsia.owlapi.explanation.PelletExplanation

    axioms.add(OWL.propertyAssertion(i, P, i));
    axioms.add(OWL.propertyAssertion(i, S, i));

    OWLOntology ontology = OWL.Ontology(axioms);
    PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner(ontology);
    PelletExplanation explain = new PelletExplanation(reasoner);

    assertFalse(explain.getInconsistencyExplanations().isEmpty());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.