Package com.clarkparsia.pellet.rules.model

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


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

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


    kb.addType( i, C );

    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

    kb.addType( i, C );

    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

    kb.addType( i, D );

    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

    kb.addType( i, C );

    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

    kb.addEquivalentClass( C, some( p, TOP ) );
   
    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 );
   
View Full Code Here

    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

    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

    ATermAppl t = TermFactory.literal("t");
    ATermAppl f = TermFactory.literal("f");

    AtomIVariable x = new AtomIVariable("x");

    List<RuleAtom> body = Arrays.<RuleAtom> asList(new ClassAtom(A, x), new DatavaluedPropertyAtom(p,
                    new AtomIConstant(b), new AtomDConstant(TermFactory.literal(true))));
    List<RuleAtom> head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(t)));
    kb.addRule(new Rule(head, body));

    body = Arrays.<RuleAtom> asList(new ClassAtom(A, x), new DatavaluedPropertyAtom(p, new AtomIConstant(b),
                    new AtomDConstant(TermFactory.literal(false))));
    head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(f)));
    kb.addRule(new Rule(head, body));

    assertIteratorValues(kb.getDataPropertyValues(q, a).iterator(), t);
View Full Code Here

    ATermAppl t = TermFactory.literal("t");
    ATermAppl f = TermFactory.literal("f");

    AtomIVariable x = new AtomIVariable("x");

    List<RuleAtom> body = Arrays.<RuleAtom> asList(new ClassAtom(A, x), new ClassAtom(B, new AtomIConstant(b)));
    List<RuleAtom> head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(t)));
    kb.addRule(new Rule(head, body));

    body = Arrays.<RuleAtom> asList(new ClassAtom(A, x), new ClassAtom(A, new AtomIConstant(b)));
    head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(f)));
    kb.addRule(new Rule(head, body));

    body = Arrays.<RuleAtom> asList(new ClassAtom(B, x));
    head = Arrays.<RuleAtom> asList(new ClassAtom(C, x));
    kb.addRule(new Rule(head, body));

    assertIteratorValues(kb.getDataPropertyValues(q, a).iterator(), t);
    assertIteratorValues(kb.getDataPropertyValues(q, b).iterator());
    assertIteratorValues(kb.getInstances(C).iterator(), b);
View Full Code Here

TOP

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

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.