Package com.clarkparsia.pellet.rules.model

Examples of com.clarkparsia.pellet.rules.model.AtomIVariable


   
    kb.addDisjointClass( A, B );
   
    kb.addType( a, A );
   
    AtomIVariable x = new AtomIVariable( "x" )
    AtomIVariable y = new AtomIVariable( "y" )
    List<RuleAtom> body = Arrays.<RuleAtom>asList( new IndividualPropertyAtom( p, x, y ) );
    List<RuleAtom> head = Arrays.<RuleAtom>asList( new ClassAtom( B, x ) );
 
    kb.addRule( new Rule( head, body ) );
 
View Full Code Here


      return false;
    }
   
    set.remove( head );
   
    AtomIObject var = new AtomIVariable( "var");
    int varCount = 0;
    List<RuleAtom> bodyAtoms  = new ArrayList<RuleAtom>();
    for( ATermAppl term : set ) {
      varCount = processClass( var, term, bodyAtoms, varCount );
    }
View Full Code Here

          RuleAtom atom = new DatavaluedPropertyAtom( p, var, newVar );
          atoms.add(atom);
          processDatatype( newVar, filler, atoms );
        }
        else{
          AtomIObject newVar = new AtomIVariable( "var" + varCount );
          RuleAtom atom = new IndividualPropertyAtom( p, var, newVar );
          atoms.add(atom);
          varCount = processClass( newVar, filler, atoms, varCount );
        }
      }
View Full Code Here

  public void addKey(ATermAppl c, Set<ATermAppl> properties) {
    int varId = 0;
    Collection<RuleAtom> head = CollectionUtils.makeSet();
    Collection<RuleAtom> body = CollectionUtils.makeSet();

    AtomIVariable x = new AtomIVariable( "x" );
    AtomIVariable y = new AtomIVariable( "y" );

    head.add( new SameIndividualAtom( x, y ) );

    // Process the body
    // First add the property atom pairs for each property
    for( ATermAppl property : properties ) {
      if( isObjectProperty( property ) ) {
        AtomIVariable z = new AtomIVariable( "z" + varId );
        body.add( new IndividualPropertyAtom( property, x, z ) );
        body.add( new IndividualPropertyAtom( property, y, z ) );
      }
      else if( isDatatypeProperty( property ) ) {
        AtomDVariable z = new AtomDVariable( "z" + varId );
View Full Code Here

   
    kb.addDisjointClass( A, B );
   
    kb.addType( a, A );
   
    AtomIVariable x = new AtomIVariable( "x" )
    AtomIVariable y = new AtomIVariable( "y" )
    List<RuleAtom> body = Arrays.<RuleAtom>asList( new IndividualPropertyAtom( p, x, y ) );
    List<RuleAtom> head = Arrays.<RuleAtom>asList( new ClassAtom( B, x ) );
 
    kb.addRule( new Rule( head, body ) );
 
View Full Code Here

    assertIteratorValues( VariableUtils.getVars( atom ).iterator(), new Object[] { var1, var2 } );
  }

  public void testVariableUtils2() {
    ATermAppl p = term( "p" );
    AtomIVariable var1 = new AtomIVariable( "var1" ), var2 = new AtomIVariable( "var2" );
    RuleAtom atom = new IndividualPropertyAtom( p, var1, var2 );
    assertIteratorValues( VariableUtils.getVars( atom ).iterator(), new Object[] { var1, var2 } );
  }
View Full Code Here

    kb.addPropertyValue( p, x, a );
    kb.addPropertyValue( p, x, b );
    kb.addPropertyValue( p, x, c );

    {
      AtomIVariable v = new AtomIVariable( "v" );
      RuleAtom body = new ClassAtom( some( p, or( and( A, B ), or(
          and( A, C ), and( B, C ) ) ) ), v );
      RuleAtom head = new IndividualPropertyAtom( q, v, new AtomIConstant( y ) );
      Rule rule = new Rule( Collections.singleton( head ), Collections.singleton( body ) );
      kb.addRule( rule );
    }

    {
      AtomIVariable v = new AtomIVariable( "v" );
      RuleAtom body = new ClassAtom( G, v );
      RuleAtom head = new IndividualPropertyAtom( p, v, new AtomIConstant( y ) );
      Rule rule = new Rule( Collections.singleton( head ), Collections.singleton( body ) );
      kb.addRule( rule );
    }
View Full Code Here

    kb.addPropertyValue( p, c, c );

    kb.addDifferent( b, c );

    {
      AtomIVariable x = new AtomIVariable( "x" );
      List<RuleAtom> body = new ArrayList<RuleAtom>();
      body.add( new ClassAtom( C, x ) );
      List<RuleAtom> head = new ArrayList<RuleAtom>();
      head.add( new ClassAtom( C, x ) );
      Rule rule = new Rule( head, body );
View Full Code Here

    kb.addIndividual( b );

    kb.addType( b, C );

    {
      AtomIVariable x = new AtomIVariable( "x" );
      List<RuleAtom> body = new ArrayList<RuleAtom>();
      body.add( new ClassAtom( C, x ) );
      List<RuleAtom> head = new ArrayList<RuleAtom>();
      head.add( new ClassAtom( D, x ) );
      Rule rule = new Rule( head, body );
View Full Code Here

  public void testEmptyRuleHead1() {
   

    ATermAppl i = term( "i" );
    ATermAppl C = term( "C" );
    AtomIVariable x = new AtomIVariable( "x" );

    kb.addClass( C );
    kb.addIndividual( i );
    kb.addType( i, C );
View Full Code Here

TOP

Related Classes of com.clarkparsia.pellet.rules.model.AtomIVariable

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.