Examples of AxiomConverter


Examples of com.clarkparsia.pellet.owlapiv3.AxiomConverter

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

Examples of com.clarkparsia.pellet.owlapiv3.AxiomConverter

  }

  @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

Examples of com.clarkparsia.pellet.owlapiv3.AxiomConverter


  @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

Examples of com.clarkparsia.pellet.owlapiv3.AxiomConverter

    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

Examples of com.clarkparsia.pellet.owlapiv3.AxiomConverter

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

Examples of com.clarkparsia.pellet.owlapiv3.AxiomConverter

  @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

Examples of com.clarkparsia.pellet.owlapiv3.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

Examples of com.clarkparsia.pellet.owlapiv3.AxiomConverter

      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

Examples of org.mindswap.pellet.jena.graph.converter.AxiomConverter

           
      if( log.isLoggable( Level.FINER ) ) {
        log.finer( "Pruned " + formatAxioms( prunedExplanation ) );
      }
     
      AxiomConverter converter = new AxiomConverter( kb, explanationGraph );
      for( ATermAppl axiom : prunedExplanation ) {
              converter.convert( axiom );
            }
    }
   
    if( log.isLoggable( Level.FINE ) ) {
      log.fine( "Explanation " + explanationGraph );
View Full Code Here

Examples of org.mindswap.pellet.jena.graph.converter.AxiomConverter

           
      if( log.isLoggable( Level.FINER ) ) {
        log.finer( "Pruned " + formatAxioms( prunedExplanation ) );
      }
     
      AxiomConverter converter = new AxiomConverter( kb, explanationGraph );
      for( ATermAppl axiom : prunedExplanation ) {
              converter.convert( axiom );
            }
    }
   
    if( log.isLoggable( Level.FINE ) ) {
      log.fine( "Explanation " + explanationGraph );
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.