Examples of IndividualPropertyAtom


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

    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 );

    Rule rule = new Rule( Collections.singleton( head ), Arrays.asList( body1, body2 ) );
    kb.addRule( rule );

    assertTrue( kb.hasPropertyValue( j, p, d ) );
View Full Code Here

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

    kb.addObjectProperty( r );
    kb.addSubClass( TOP, min( r, 1, TOP ) );
    kb.addSubClass( TOP, oneOf( i, j ) );

    kb.addRule( new Rule( Collections.singletonList( new DifferentIndividualsAtom( x, y ) ),
        Collections.singletonList( new IndividualPropertyAtom( r, x, y ) ) ) );

    kb.realize();
    assertTrue( kb.isConsistent() );
    assertTrue( kb.isDifferentFrom( i, j ) );
  }
View Full Code Here

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

    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 ),
        new IndividualPropertyAtom( hasSibling, x, z ), } ) ) );

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

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

  }

  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

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

    {
      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 );
    }

    assertTrue( kb.isConsistent() );
View Full Code Here

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

    kb.addPropertyValue( p, b, c );

    List<RuleAtom> body = new ArrayList<RuleAtom>();
    List<RuleAtom> head = new ArrayList<RuleAtom>();

    body.add( new IndividualPropertyAtom( p, x, y ) );
    head.add( new IndividualPropertyAtom( q, x, y ) );

    kb.addRule( new Rule( head, body ) );

    assertTrue( kb.hasPropertyValue( a, p, b ) );
    assertTrue( kb.hasPropertyValue( a, p, c ) );
View Full Code Here

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

    AtomIVariable x = new AtomIVariable( "x" );
    AtomIVariable y = new AtomIVariable( "y" );
    List<RuleAtom> body = new ArrayList<RuleAtom>();
    body.add( new ClassAtom( C, x ) );
    List<RuleAtom> head = new ArrayList<RuleAtom>();
    head.add( new IndividualPropertyAtom( p, x, y ) );
    Rule rule = new Rule( head, body );
    kb.addRule( rule );
   
    assertEquals( singleton( rule ), kb.getRules() )
    assertNull( kb.getNormalizedRules().get( rule ) );
View Full Code Here

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

    kb.addPropertyValue( p, a, a );
    kb.addPropertyValue( p, b, a );
    kb.addPropertyValue( p, b, c );
   
    AtomIVariable x = new AtomIVariable( "x" )
    List<RuleAtom> body = Arrays.<RuleAtom>asList( new IndividualPropertyAtom( p, x, x ) );
    List<RuleAtom> head = Arrays.<RuleAtom>asList( new ClassAtom( A, x ) );
 
    kb.addRule( new Rule( head, body ) );
 
    assertTrue( kb.isConsistent() );
View Full Code Here

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

    kb.addPropertyValue( p, a, b );
    kb.addPropertyValue( p, b, c );
    kb.addPropertyValue( p, c, c );
   
    AtomIVariable x = new AtomIVariable( "x" )
    List<RuleAtom> body = Arrays.<RuleAtom>asList( new IndividualPropertyAtom( p, x, new AtomIConstant( c ) ) );
    List<RuleAtom> head = Arrays.<RuleAtom>asList( new ClassAtom( A, x ) );
 
    kb.addRule( new Rule( head, body ) );
 
    assertTrue( kb.isConsistent() );
View Full Code Here

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

   
    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 ) );
 
    assertTrue( kb.isConsistent() );
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.