Examples of BuiltInAtom


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

    AtomDVariable z3 = new AtomDVariable( "z3" );

    List<RuleAtom> body = new ArrayList<RuleAtom>();
    body.add( new DatavaluedPropertyAtom( p, x, z1 ) );
    body.add( new DatavaluedPropertyAtom( q, x, z2 ) );
    body.add( new BuiltInAtom( SWRLB + "add", z3, z1, z2 ) );

    List<RuleAtom> head = new ArrayList<RuleAtom>();
    head.add( new DatavaluedPropertyAtom( r, x, z3 ) );

    kb.addRule( new Rule( head, body ) );
View Full Code Here

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

    AtomIVariable x = new AtomIVariable( "x" );
    AtomDVariable xDate = new AtomDVariable( "xDate" ), xYear = new AtomDVariable( "xYear" ), xMonth = new AtomDVariable(
        "xMonth" ), xDay = new AtomDVariable( "xDay" ), xTZ = new AtomDVariable( "xTZ" );

    RuleAtom dateBuiltIn = new BuiltInAtom( SWRLB + "date", xDate, xYear, xMonth, xDay );
    RuleAtom dateBuiltInTZ = new BuiltInAtom( SWRLB + "date", xDate, xYear, xMonth, xDay, xTZ );
    RuleAtom bDateAtom = new DatavaluedPropertyAtom( bDate, x, xDate );
    RuleAtom bYearAtom = new DatavaluedPropertyAtom( bYear, x, xYear );
    RuleAtom bMonthAtom = new DatavaluedPropertyAtom( bMonth, x, xMonth );
    RuleAtom bDayAtom = new DatavaluedPropertyAtom( bDay, x, xDay );
    RuleAtom bTZAtom = new DatavaluedPropertyAtom( bTZ, x, xTZ );
View Full Code Here

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

    AtomDVariable z6 = new AtomDVariable( "z6" );

    List<RuleAtom> body = new ArrayList<RuleAtom>();
    body.add( new DatavaluedPropertyAtom( p, x, z1 ) );
    body.add( new DatavaluedPropertyAtom( p, x, z2 ) );
    body.add( new BuiltInAtom( SWRLB + "add", z3, z1, z2 ) );
    body.add( new BuiltInAtom( SWRLB + "subtract", z4, z1, z2 ) );
    body.add( new BuiltInAtom( SWRLB + "multiply", z5, z1, z2 ) );
    body.add( new BuiltInAtom( SWRLB + "divide", z6, z1, z2 ) );

    List<RuleAtom> head = new ArrayList<RuleAtom>();
    head.add( new DatavaluedPropertyAtom( sum, x, z3 ) );
    head.add( new DatavaluedPropertyAtom( difference, x, z4 ) );
    head.add( new DatavaluedPropertyAtom( product, x, z5 ) );
View Full Code Here

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

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

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

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

    AtomDVariable y = new AtomDVariable("y");
    AtomDVariable z = new AtomDVariable("z");
   
    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

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

    AtomDVariable x = new AtomDVariable("x");
    AtomDConstant semicolan = new AtomDConstant( literal( ";" ) );
    Collection<AtomVariable> emptyCollection = Collections.emptySet();
    Collection<AtomVariable> xSingleton = Collections.singleton( (AtomVariable) x );
   
    BuiltInAtom oneVarAtom = new BuiltInAtom( Namespaces.SWRLB + "tokenize", x, data, semicolan );
    BindingHelper sharedVarHelper = StringOperators.tokenize.createHelper( oneVarAtom );
    assertTrue( sharedVarHelper.getBindableVars( emptyCollection ).equals( xSingleton ) );
    VariableBinding emptyBinding = new VariableBinding( kb.getABox() );
    sharedVarHelper.rebind( emptyBinding );
   
View Full Code Here

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

    AtomDVariable x = new AtomDVariable("x");
    AtomDConstant comma = new AtomDConstant( literal( "," ) );
    Collection<AtomVariable> emptyCollection = Collections.emptySet();
    Collection<AtomVariable> xSingleton = Collections.singleton( (AtomVariable) x );
   
    BuiltInAtom oneVarAtom = new BuiltInAtom( Namespaces.SWRLB + "tokenize", x, data, comma );
    BindingHelper sharedVarHelper = StringOperators.tokenize.createHelper( oneVarAtom );
    assertTrue( sharedVarHelper.getBindableVars( emptyCollection ).equals( xSingleton ) );
    VariableBinding emptyBinding = new VariableBinding( kb.getABox() );
    sharedVarHelper.rebind( emptyBinding );
   
View Full Code Here

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

    AtomDVariable x = new AtomDVariable("x");
    AtomDConstant comma = new AtomDConstant( literal( "," ) );
    Collection<AtomVariable> emptyCollection = Collections.emptySet();
    Collection<AtomVariable> xSingleton = Collections.singleton( (AtomVariable) x );
   
    BuiltInAtom sharedVarAtom = new BuiltInAtom( Namespaces.SWRLB + "tokenize", x, x, comma );
    BindingHelper sharedVarHelper = StringOperators.tokenize.createHelper( sharedVarAtom );
    assertTrue( sharedVarHelper.getBindableVars( emptyCollection ).isEmpty() );
    assertTrue( sharedVarHelper.getBindableVars( xSingleton ).isEmpty() );
    VariableBinding xdataBinding = new VariableBinding( kb.getABox() );
    xdataBinding.set( x, data.getValue() );
View Full Code Here

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

    AtomDVariable x = new AtomDVariable("x");
    AtomDConstant semicolan = new AtomDConstant( literal( ";" ) );
    Collection<AtomVariable> emptyCollection = Collections.emptySet();
    Collection<AtomVariable> xSingleton = Collections.singleton( (AtomVariable) x );
   
    BuiltInAtom sharedVarAtom = new BuiltInAtom( Namespaces.SWRLB + "tokenize", x, x, semicolan );
    BindingHelper sharedVarHelper = StringOperators.tokenize.createHelper( sharedVarAtom );
    assertTrue( sharedVarHelper.getBindableVars( emptyCollection ).isEmpty() );
    assertTrue( sharedVarHelper.getBindableVars( xSingleton ).isEmpty() );
    VariableBinding xdataBinding = new VariableBinding( kb.getABox() );
    xdataBinding.set( x, data.getValue() );
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.