Package com.clarkparsia.pellet.rules.model

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


      ATermAppl name = node2term( node );
      if( !ATermUtils.isPrimitive( name ) ) {
        addUnsupportedFeature( "Cannot create rule data variable out of " + node );
        return null;
      }
      return new AtomDVariable( name.toString() );
    }
    else {
      return new AtomDConstant( node2term( node ) );
    }
  }
View Full Code Here


    throw new InternalReasonerException( "Unrecognized term: " + t );
  }

  private AtomDObject convertAtomDObject(ATermAppl t) {
    if( ATermUtils.isVar( t ) )
      return new AtomDVariable( ((ATermAppl) t.getArgument( 0 )).getName() );
    else if( ATermUtils.isLiteral( t ) )
      return new AtomDConstant( t );   

    throw new InternalReasonerException( "Unrecognized term: " + t );
 
View Full Code Here

    swrlAtom = new BuiltInAtom( atom.getPredicate().toString(), arguments );
  }

 
  public void visit(SWRLVariable var) {
    swrlDObject = new AtomDVariable( var.getIRI().toString() );
    swrlIObject = new AtomIVariable( var.getIRI().toString() );
  }
View Full Code Here

          }
        }
        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{
View Full Code Here

        AtomIVariable z = new AtomIVariable( "z" + varId );
        body.add( new IndividualPropertyAtom( property, x, z ) );
        body.add( new IndividualPropertyAtom( property, y, z ) );
      }
      else if( isDatatypeProperty( property ) ) {
        AtomDVariable z = new AtomDVariable( "z" + varId );
        body.add( new DatavaluedPropertyAtom( property, x, z ) );
        body.add( new DatavaluedPropertyAtom( property, y, z ) );
      }

      varId++;
View Full Code Here

    }
    swrlAtom = new BuiltInAtom( atom.getPredicate().getURI().toString(), arguments );
  }

  public void visit(SWRLAtomDVariable dvar) {
    swrlDObject = new AtomDVariable( dvar.getURI().toString() );
  }
View Full Code Here

      ATermAppl name = node2term( node );
      if( !ATermUtils.isPrimitive( name ) ) {
        addUnsupportedFeature( "Cannot create rule data variable out of " + node );
        return null;
      }
      return new AtomDVariable( name.toString() );
    }
    else {
      return new AtomDConstant( node2term( node ) );
    }
  }
View Full Code Here

    kb.addSubClass( TOP, hasValue( p, d1 ) );
    kb.addSubClass( TOP, hasValue( q, d2 ) );

    AtomIVariable x = new AtomIVariable( "x" );
    AtomDVariable z1 = new AtomDVariable( "z1" );
    AtomDVariable z2 = new AtomDVariable( "z2" );
    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 ) );
View Full Code Here

    kb.addPropertyValue( bMonth, desmond, literal( "4", Datatypes.INTEGER ) );
    kb.addPropertyValue( bDay, desmond, literal( "14", Datatypes.INTEGER ) );
    kb.addPropertyValue( bTZ, desmond, literal( "+01:01" ) );

    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 );
View Full Code Here

    kb.addIndividual( i );
    kb.addPropertyValue( p, i, d1 );
    kb.addPropertyValue( p, i, d2 );

    AtomIVariable x = new AtomIVariable( "x" );
    AtomDVariable z1 = new AtomDVariable( "z1" );
    AtomDVariable z2 = new AtomDVariable( "z2" );
    AtomDVariable z3 = new AtomDVariable( "z3" );
    AtomDVariable z4 = new AtomDVariable( "z4" );
    AtomDVariable z5 = new AtomDVariable( "z5" );
    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 ) );
View Full Code Here

TOP

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

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.