Package com.clarkparsia.owlapi.explanation

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


  }

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

    ATermAppl r = ATermUtils.makeTermAppl( "r" );
    ATermAppl s = ATermUtils.makeTermAppl( "s" );
    ATermAppl x = ATermUtils.makeVar( "x" );
    ATermAppl y = ATermUtils.makeVar( "y" );

    kb.addDatatypeProperty( r );
    kb.addDatatypeProperty( s );

    ATermAppl[] head = new ATermAppl[] { ATermUtils.makePropAtom( r, x, y ) };
    ATermAppl[] body = new ATermAppl[] { ATermUtils.makePropAtom( s, 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( DataProperty( "s" ), variable( "x" ), variable( "y" ) ) );
View Full Code Here


      assertTrue( "Entailment failed", reasoner.isEntailed( axiom ) );

      Set<ATermAppl> terms = reasoner.getKB().getExplanationSet();
      assertTrue( "Explanation incorrect " + terms, terms.size() == 1);
     
      OWLAxiom explanation = new AxiomConverter(reasoner).convert(terms.iterator().next());
      assertEquals( "Unexpected explanation", axiom, explanation );
    }
    finally {
      if (ont != null)
        manager.removeOntology( ont );
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.