Package com.clarkparsia.pellet.rules.model

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


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

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

    List<RuleAtom> body = Arrays.<RuleAtom> asList(new ClassAtom(A, x),
            new DatavaluedPropertyAtom(p, new AtomIConstant(b), y),
            new BuiltInAtom(SWRLB + "equal", y, 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), y),
            new BuiltInAtom(SWRLB + "equal", y, new AtomDConstant(TermFactory.literal(false))));
    head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(f)));
    kb.addRule(new Rule(head, body));
View Full Code Here


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

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

    List<RuleAtom> body = Arrays.<RuleAtom> asList(new ClassAtom(A, x),
            new IndividualPropertyAtom(r, y, new AtomIConstant(b)),
            new DatavaluedPropertyAtom(p, y, 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 IndividualPropertyAtom(r, y, new AtomIConstant(b)),
            new DatavaluedPropertyAtom(p, y, new AtomDConstant(TermFactory.literal(false))));
    head = Arrays.<RuleAtom> asList(new DatavaluedPropertyAtom(q, x, new AtomDConstant(f)));
    kb.addRule(new Rule(head, body));
View Full Code Here

    List<RuleAtom> body = Arrays.<RuleAtom> asList(
            new DatavaluedPropertyAtom(p, x, y),
            new BuiltInAtom( SWRLB + "pow", z, y, new AtomDConstant(TermFactory.literal(2))),
            new BuiltInAtom( SWRLB + "lessThan", z, new AtomDConstant(TermFactory.literal(100)))
            );
    List<RuleAtom> head = Arrays.<RuleAtom> asList(new ClassAtom(A, x));
    kb.addRule(new Rule(head, body));

    assertIteratorValues(kb.getInstances(A).iterator(), a, b);
  }
View Full Code Here

    ATermAppl i = ATermUtils.makeTermAppl( "i" );

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

    body.add( new ClassAtom( C, new AtomIVariable( "x" ) ) );
    head.add( new ClassAtom( D, new AtomIVariable( "x" ) ) );

    Rule rule = new Rule( head, body );

    kb.addClass( C );
    kb.addClass( D );
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.