Package com.clarkparsia.pellet.rules.model

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


    }
  }

  private AtomIObject createRuleIObject(Node node) {
    if( hasObject( node, RDF.type.asNode(), SWRL.Variable.asNode() ) ) {
      return new AtomIVariable( node.getURI() );
    }
    else {
      ATermAppl term = node2term( node );
      if( defineIndividual( term ) ) {
              return new AtomIConstant( node2term( node ) );
View Full Code Here


    return atom;
  }

  private AtomIObject convertAtomIObject(ATermAppl t) {
    if( ATermUtils.isVar( t ) )
      return new AtomIVariable( ((ATermAppl) t.getArgument( 0 )).getName() );
    else if( kb.isIndividual( t ) )
      return new AtomIConstant( t );
    else if( ATermUtils.isAnon( t ) )
      return new AtomIConstant( t );
View Full Code Here

  }

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

        return false;
      }
     
      terms.remove( head );
     
      AtomIObject var = new AtomIVariable( "var");
      int varCount = 0;
      List<RuleAtom> bodyAtoms  = new ArrayList<RuleAtom>();
      for( ATermAppl term : terms ) {
        varCount = processClass( var, term, bodyAtoms, varCount );
      }
View Full Code Here

            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

  public void addKey(ATermAppl c, Set<ATermAppl> properties) {
    int varId = 0;
    Collection<RuleAtom> head = CollectionUtils.makeSet();
    Collection<RuleAtom> body = CollectionUtils.makeSet();

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

    head.add( new SameIndividualAtom( x, y ) );

    // Process the body
    // First add the property atom pairs for each property
    for( ATermAppl property : properties ) {
      if( isObjectProperty( property ) ) {
        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 );
View Full Code Here

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

  public void visit(SWRLAtomIVariable ivar) {
    swrlIObject = new AtomIVariable( ivar.getURI().toString() );
  }
View Full Code Here

    }
  }

  private AtomIObject createRuleIObject(Node node) {
    if( hasObject( node, RDF.type.asNode(), SWRL.Variable.asNode() ) ) {
      return new AtomIVariable( node.getURI() );
    }
    else {
      ATermAppl term = node2term( node );
      if( defineIndividual( term ) ) {
              return new AtomIConstant( node2term( node ) );
View Full Code Here

    kb.addIndividual( i );

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

    kb.addPropertyValue( bYear, desmond, literal( "2004", Datatypes.INTEGER ) );
    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 );
View Full Code Here

TOP

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

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.