Package com.clarkparsia.pellet.rules.model

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


    {
      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() );
    assertIteratorValues( kb.getPropertyValues( p, x ).iterator(), new ATermAppl[] { a, b, c, y } );
View Full Code Here


      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 );
      kb.addRule( rule );
    }

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

      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 );
      kb.addRule( rule );
    }

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

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

    body.add( new ClassAtom( C, x ) );

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

    assertFalse( kb.isConsistent() );
  }
View Full Code Here

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

    body.add( new ClassAtom( C, x ) );

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

    assertFalse( kb.isConsistent() );
  }
View Full Code Here

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

    body.add( new ClassAtom( D, x ) );

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

    assertFalse( kb.isConsistent() );
  }
View Full Code Here

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

    body.add( new DatavaluedPropertyAtom( R, v, c ) );

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

    assertFalse( kb.isConsistent() );
  }
View Full Code Here

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

    body.add( new ClassAtom( CuD, x ) );

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

    assertFalse( kb.isConsistent() );
  }
View Full Code Here

    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 ) );
    assertTrue( kb.hasPropertyValue( b, p, c ) );
View Full Code Here

    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

TOP

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

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.