Package org.mindswap.pellet.owlapi

Examples of org.mindswap.pellet.owlapi.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" ), iVariable( "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" ), iVariable( "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" ), iVariable( "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" ), iVariable( "x" ), iVariable( "y" ) ) );
View Full Code Here

  }

  @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" ), iVariable( "x" ), dVariable( "y" ) ) );
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.owlapi.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.