Package com.clarkparsia.pellet.rules.model

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


    kb.addIndividual( i );
    kb.addPropertyValue( p, i, d1 );
    kb.addPropertyValue( p, i, d2 );

    AtomIVariable x = new AtomIVariable( "x" );
    AtomDVariable z1 = new AtomDVariable( "z1" );
    AtomDVariable z2 = new AtomDVariable( "z2" );
    AtomDVariable z3 = new AtomDVariable( "z3" );
    AtomDVariable z4 = new AtomDVariable( "z4" );
    AtomDVariable z5 = new AtomDVariable( "z5" );
View Full Code Here


    kb.addPropertyValue( p, i, d );
    kb.addPropertyValue( r, i, j );
    kb.addPropertyValue( r, j, k );

    AtomIVariable x = new AtomIVariable( "x" ), y = new AtomIVariable( "y" );
    AtomDVariable z = new AtomDVariable( "z" );

    RuleAtom body1 = new IndividualPropertyAtom( r, x, y );
    RuleAtom body2 = new DatavaluedPropertyAtom( p, x, z ), head = new DatavaluedPropertyAtom(
        p, y, z );
View Full Code Here

    kb.addSubClass( TOP, oneOf( i, j, k ) );
    kb.addSubClass( TOP, min( r, 3, TOP ) );

    kb.addPropertyValue( p, i, d );

    AtomIVariable x = new AtomIVariable( "x" ), y = new AtomIVariable( "y" );
    AtomDVariable z = new AtomDVariable( "z" );

    RuleAtom body1 = new IndividualPropertyAtom( r, x, y );
    RuleAtom body2 = new DatavaluedPropertyAtom( p, x, z ), head = new DatavaluedPropertyAtom(
        p, y, z );
View Full Code Here

    kb.addObjectProperty( r );
    kb.addSubClass( TOP, min( r, 3, TOP ) );
    kb.addSubClass( TOP, or( value( i ), value( j ), value( k ) ) );
    kb.addPropertyValue( p, i, d );

    AtomIVariable x = new AtomIVariable( "x" ), y = new AtomIVariable( "y" );
    AtomDVariable z = new AtomDVariable( "z" );

    RuleAtom head = new DatavaluedPropertyAtom( p, x, z );
    RuleAtom body1 = new DatavaluedPropertyAtom( p, y, z );
    RuleAtom body2 = new IndividualPropertyAtom( r, x, y );
View Full Code Here

  public void testRuleEquality() {
    ATermAppl r = term( "r" );
    ATermAppl i = term( "i" );
    ATermAppl j = term( "j" );

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

    KnowledgeBase kb = new KnowledgeBase();
    kb.addIndividual( i );
    kb.addIndividual( j );
    kb.addObjectProperty( r );
View Full Code Here

    kb.addPropertyValue( hasParent, c12, p1a );
    kb.addPropertyValue( hasSibling, c12, c11 );
    kb.addPropertyValue( hasSibling, p1a, p2a );
    kb.addType( p2a, male );

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

    kb.addRule( new Rule( Arrays.asList( new RuleAtom[] { new IndividualPropertyAtom( hasUncle,
        y, z ) } ), Arrays.asList( new RuleAtom[] {
        new IndividualPropertyAtom( hasParent, y, x ), new ClassAtom( male, z ),
View Full Code Here

    assertIteratorValues( kb.getObjectPropertyValues( hasUncle, c11 ).iterator(),
        new Object[] { p2a, } );
  }

  public void testVariableUtils1() {
    AtomIVariable var1 = new AtomIVariable( "var1" ), var2 = new AtomIVariable( "var2" );
    RuleAtom atom = new SameIndividualAtom( var1, var2 );
    assertIteratorValues( VariableUtils.getVars( atom ).iterator(), new Object[] { var1, var2 } );
  }
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

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.