Package com.clarkparsia.pellet.rules.model

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


    while( atomList != null && !atomList.equals( RDF.nil.asNode() ) ) {
      String atomType = "unsupported atom";
      Node atomNode = getObject( atomList, RDF.first.asNode() );

      RuleAtom atom = null;
      if( hasObject( atomNode, RDF.type.asNode(), SWRL.ClassAtom.asNode() ) ) {
        ATermAppl description = null;
        AtomIObject argument = null;
        atomType = "ClassAtom";
View Full Code Here


    }
  }
 

  private RuleAtom convertRuleAtom(ATermAppl term) {
    RuleAtom atom = null;

    if( term.getAFun().equals( ATermUtils.TYPEFUN ) ) {
      ATermAppl i = (ATermAppl) term.getArgument( 0 );
      AtomIObject io = convertAtomIObject( i );
      ATermAppl c = (ATermAppl) term.getArgument( 1 );
View Full Code Here

    // }
    // }
    // }

    for( ; tryNext < tryCount; tryNext++ ) {
      RuleAtom atom = atoms.get( tryNext );

//      if( PelletOptions.USE_SEMANTIC_BRANCHING ) {
//        for( int m = 0; m < tryNext; m++ )
//          ruleAtomAsserter
//              .assertAtom( atoms.get( m ), binding, prevDS[m], m >= bodyAtomCount );
View Full Code Here

       
        if( filler.getAFun().equals( ATermUtils.VALUEFUN ) ) {
          ATermAppl nominal = (ATermAppl) filler.getArgument( 0 );
          if( kb.isDatatypeProperty( p ) ) {
            AtomDConstant arg = new AtomDConstant( nominal );
            RuleAtom atom = new DatavaluedPropertyAtom( p, var, arg );
            atoms.add(atom);
          }
          else {
            AtomIConstant arg = new AtomIConstant( nominal );
            RuleAtom atom = new IndividualPropertyAtom( p, var, arg );
            atoms.add(atom);
          }
        }
        else {
          varCount++;
          if( kb.isDatatypeProperty( p ) ) {
            AtomDObject newVar = new AtomDVariable( "var" + varCount );
            RuleAtom atom = new DatavaluedPropertyAtom( p, var, newVar );
            atoms.add(atom);
            processDatatype( newVar, filler, atoms );
          }
          else{
            AtomIObject newVar = new AtomIVariable( "var" + varCount );
            RuleAtom atom = new IndividualPropertyAtom( p, var, newVar );
            atoms.add(atom);
            varCount = processClass( newVar, filler, atoms, varCount );
          }
        }
      }
View Full Code Here

    while( atomList != null && !atomList.equals( RDF.nil.asNode() ) ) {
      String atomType = "unsupported atom";
      Node atomNode = getObject( atomList, RDF.first.asNode() );

      RuleAtom atom = null;
      if( hasObject( atomNode, RDF.type.asNode(), SWRL.ClassAtom.asNode() ) ) {
        ATermAppl description = null;
        AtomIObject argument = null;
        atomType = "ClassAtom";
View Full Code Here

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

    Rule fromDate = new Rule( Arrays
        .asList( new RuleAtom[] { bYearAtom, bMonthAtom, bDayAtom } ), Arrays
        .asList( new RuleAtom[] { dateBuiltIn, bDateAtom } ) );
    kb.addRule( fromDate );
View Full Code Here

    kb.addPropertyValue( r, j, k );

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

    RuleAtom body1 = new IndividualPropertyAtom( r, x, y );
    RuleAtom body2 = new DatavaluedPropertyAtom( p, x, z ), head = new DatavaluedPropertyAtom(
        p, y, z );

    Rule rule = new Rule( Collections.singleton( head ), Arrays.asList( new RuleAtom[] {
        body1, body2 } ) );
    kb.addRule( rule );
View Full Code Here

    kb.addPropertyValue( p, i, d );

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

    RuleAtom body1 = new IndividualPropertyAtom( r, x, y );
    RuleAtom body2 = new DatavaluedPropertyAtom( p, x, z ), head = new DatavaluedPropertyAtom(
        p, y, z );

    Rule rule = new Rule( Collections.singleton( head ), Arrays.asList( new RuleAtom[] {
        body1, body2 } ) );
    kb.addRule( rule );
View Full Code Here

    kb.addPropertyValue( p, i, d );

    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

        new Object[] { p2a, } );
  }

  public void testVariableUtils1() {
    AtomIVariable var1 = new AtomIVariable( "var1" ), var2 = new AtomIVariable( "var2" );
    RuleAtom atom = new SameIndividualAtom( var1, var2 );
    assertIteratorValues( VariableUtils.getVars( atom ).iterator(), new Object[] { var1, var2 } );
  }
View Full Code Here

TOP

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

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.