Package com.clarkparsia.owlapi.explanation

Examples of com.clarkparsia.owlapi.explanation.SatisfiabilityConverter$AxiomConverter


    // USE_TRACING should be turned on for glass box explanation which is done by
    // ExplanationTestSuite that calls this class. We don't set this value here to
    // avoid repeating the clean up code that sets it bakc to the old value
    assertTrue( !useGlassBox || PelletOptions.USE_TRACING );
   
    converter = new SatisfiabilityConverter(OWL.factory);
    renderer = new ConciseExplanationRenderer();
   
    OWLOntology ontology = OWL.Ontology( ontologyAxioms );     

    PelletReasonerFactory reasonerFactory = PelletReasonerFactory.getInstance();
View Full Code Here


  private int              axiomCount  = 0;

  public ExplanationTester(ExplanationGenerator expGen) {
    this.expGen = expGen;

    converter = new SatisfiabilityConverter(OntologyUtils.getOWLOntologyManager().getOWLDataFactory());
    renderer = new ConciseExplanationRenderer();
  }
View Full Code Here

    // USE_TRACING should be turned on for glass box explanation which is done by
    // ExplanationTestSuite that calls this class. We don't set this value here to
    // avoid repeating the clean up code that sets it bakc to the old value
    assertTrue( !useGlassBox || PelletOptions.USE_TRACING );
   
    converter = new SatisfiabilityConverter(OWL.factory);
    renderer = new ConciseExplanationRenderer();
   
    OWLOntology ontology = OWL.Ontology( ontologyAxioms );     

    PelletReasonerFactory reasonerFactory = PelletReasonerFactory.getInstance();
View Full Code Here

    loader = (OWLAPILoader) getLoader( "OWLAPIv3" );

    getKB();
   
    converter = new SatisfiabilityConverter( loader.getManager().getOWLDataFactory() );

    reasoner = loader.getReasoner();
   
    loadMethod();
   
View Full Code Here

  }
   
  public GlassBoxExplanation(PelletReasonerFactory factory, PelletReasoner reasoner) {
    super( reasoner.getRootOntology(), factory, reasoner );
   
    axiomConverter = new AxiomConverter( reasoner );
  }
View Full Code Here

  }

  @Test
  public void testAxiomConverterRules1() {
    KnowledgeBase kb = new KnowledgeBase();
    AxiomConverter converter = new AxiomConverter( kb, OWL.manager.getOWLDataFactory() );

    ATermAppl C = ATermUtils.makeTermAppl( "C" );
    ATermAppl D = ATermUtils.makeTermAppl( "D" );
    ATermAppl x = ATermUtils.makeVar( "x" );

    kb.addClass( C );
    kb.addClass( D );

    ATermAppl[] head = new ATermAppl[] { ATermUtils.makeTypeAtom( x, D ) };
    ATermAppl[] body = new ATermAppl[] { ATermUtils.makeTypeAtom( x, C ) };

    ATermAppl rule = ATermUtils.makeRule( head, body );

    OWLAxiom actual = converter.convert( rule );

    Set<SWRLAtom> antecedent = new HashSet<SWRLAtom>();
    Set<SWRLAtom> consequent = new HashSet<SWRLAtom>();

    antecedent.add( classAtom( Class( "C" ), variable( "x" ) ) );
View Full Code Here


  @Test
  public void testAxiomConverterRules1b() {
    KnowledgeBase kb = new KnowledgeBase();
    AxiomConverter converter = new AxiomConverter( kb, OWL.manager.getOWLDataFactory() );

    ATermAppl C = ATermUtils.makeTermAppl( "C" );
    ATermAppl D = ATermUtils.makeTermAppl( "D" );
    ATermAppl x = ATermUtils.makeVar( "x" );
    ATermAppl name = ATermUtils.makeTermAppl( "MyRule" );

    kb.addClass( C );
    kb.addClass( D );

    ATermAppl[] head = new ATermAppl[] { ATermUtils.makeTypeAtom( x, D ) };
    ATermAppl[] body = new ATermAppl[] { ATermUtils.makeTypeAtom( x, C ) };

    ATermAppl rule = ATermUtils.makeRule( name, head, body );

    OWLAxiom actual = converter.convert( rule );

    Set<SWRLAtom> antecedent = new HashSet<SWRLAtom>();
    Set<SWRLAtom> consequent = new HashSet<SWRLAtom>();

    antecedent.add( classAtom( Class( "C" ), variable( "x" ) ) );
View Full Code Here

    assertEquals( expected, actual );
  }
 
  public void testAxiomConverterRules1c() {
    KnowledgeBase kb = new KnowledgeBase();
    AxiomConverter converter = new AxiomConverter( kb, OWL.manager.getOWLDataFactory() );

    ATermAppl C = ATermUtils.makeTermAppl( "C" );
    ATermAppl D = ATermUtils.makeTermAppl( "D" );
    ATermAppl x = ATermUtils.makeVar( "x" );
    ATermAppl name = ATermUtils.makeBnode( "MyRule" );

    kb.addClass( C );
    kb.addClass( D );

    ATermAppl[] head = new ATermAppl[] { ATermUtils.makeTypeAtom( x, D ) };
    ATermAppl[] body = new ATermAppl[] { ATermUtils.makeTypeAtom( x, C ) };

    ATermAppl rule = ATermUtils.makeRule( name, head, body );

    OWLAxiom actual = converter.convert( rule );

    Set<SWRLAtom> antecedent = new HashSet<SWRLAtom>();
    Set<SWRLAtom> consequent = new HashSet<SWRLAtom>();

    antecedent.add( classAtom( Class( "C" ), variable( "x" ) ) );
View Full Code Here

  }
 
  @Test
  public void testAxiomConverterRules2() {
    KnowledgeBase kb = new KnowledgeBase();
    AxiomConverter converter = new AxiomConverter( kb, OWL.manager.getOWLDataFactory() );

    ATermAppl C = ATermUtils.makeTermAppl( "C" );
    ATermAppl D = ATermUtils.makeTermAppl( "D" );
    ATermAppl i = ATermUtils.makeTermAppl( "i" );

    kb.addClass( C );
    kb.addClass( D );
    kb.addIndividual( i );

    ATermAppl[] head = new ATermAppl[] { ATermUtils.makeTypeAtom( i, D ) };
    ATermAppl[] body = new ATermAppl[] { ATermUtils.makeTypeAtom( i, C ) };

    ATermAppl rule = ATermUtils.makeRule( head, body );

    OWLAxiom actual = converter.convert( rule );

    Set<SWRLAtom> antecedent = new HashSet<SWRLAtom>();
    Set<SWRLAtom> consequent = new HashSet<SWRLAtom>();

    antecedent.add( classAtom( Class( "C" ), SWRL.individual( OWL.Individual( "i" ) ) ) );
View Full Code Here

  @Test
  public void testAxiomConverterRules3() {
    KnowledgeBase kb = new KnowledgeBase();
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLDataFactory df = manager.getOWLDataFactory();
    AxiomConverter converter = new AxiomConverter( kb, df );

    ATermAppl p = ATermUtils.makeTermAppl( "p" );
    ATermAppl q = ATermUtils.makeTermAppl( "q" );
    ATermAppl x = ATermUtils.makeVar( "x" );
    ATermAppl y = ATermUtils.makeVar( "y" );

    kb.addObjectProperty( p );
    kb.addObjectProperty( q );

    ATermAppl[] head = new ATermAppl[] { ATermUtils.makePropAtom( q, x, y ) };
    ATermAppl[] body = new ATermAppl[] { ATermUtils.makePropAtom( p, x, y ) };

    ATermAppl rule = ATermUtils.makeRule( head, body );

    OWLAxiom actual = converter.convert( rule );

    Set<SWRLAtom> antecedent = new HashSet<SWRLAtom>();
    Set<SWRLAtom> consequent = new HashSet<SWRLAtom>();

    antecedent.add( propertyAtom( ObjectProperty( "p" ), variable( "x" ), variable( "y" ) ) );
View Full Code Here

TOP

Related Classes of com.clarkparsia.owlapi.explanation.SatisfiabilityConverter$AxiomConverter

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.