Examples of BoundVariable


Examples of lupos.owl2rl.owlToRif.BoundVariable

    boolean block =false;
    String ret="";

    //for each variable: replace variables with value from query result
    for(int j=0;j<boundV.size();j++){
      BoundVariable v=boundV.get(j);

      if(j==0){//first time
        ret=("(* "+v.getName()+" *) "+templateRulemap.get(v.getName()).getTemplate()).replace(v.getVariable(), v.getOriginalString());
      } else {
        ret=ret.replace(v.getVariable(),v.getOriginalString());
      }
      //makes sure rules like (x, rdfs:subClassOf, x) are not emitted
      if(ret.contains(v.getOriginalString()+"[rdfs:subClassOf->"+v.getOriginalString()+"]"))
        block=true;
    }

    if(!ret.equals("") && !block && !outputString.toString().contains(ret)){
      outputString.append("\n"+ret);
View Full Code Here

Examples of lupos.owl2rl.owlToRif.BoundVariable

    String c1=variablesInList.getLast().getPartOfList();

    String rule="";
    for(int xi=0;xi<variablesInList.size();xi++){

      BoundVariable c3=variablesInList.get(xi);

      rule=("(* "+c3.getName()+" *) "+templateRulemap.get(c3.getName()).getTemplate()).replace("?c1", c1);
      rule=rule.replace("?c3",c3.getOriginalString());

      if(!outputString.toString().contains(rule)){
        outputString.append(rule+"\n");
        InferenceRulesGenerator.rulesEmitted++;
      }
View Full Code Here

Examples of lupos.owl2rl.owlToRif.BoundVariable

    String p1=variablesInList.getLast().getPartOfList();

    String rule="\n";
    for(int xi=0;xi<variablesInList.size();xi++){
      BoundVariable p3=variablesInList.get(xi);
      rule=("(* "+p3.getName()+" *) "+templateRulemap.get(p3.getName()).getTemplate()).replace("?p1", p1);
      rule=rule.replace("?p3",p3.getOriginalString());
      if(!outputString.toString().contains(rule)){
        outputString.append(rule+"\n");
        InferenceRulesGenerator.rulesEmitted++;
      }
    }
View Full Code Here

Examples of lupos.owl2rl.owlToRif.BoundVariable

     * append rule to outputString
     */
    String rule;
    for(int xi=0;xi<variablesInList.size();xi++){
      for(int yi=0;yi<variablesInList.size();yi++){
        BoundVariable x=variablesInList.get(xi);
        BoundVariable y=variablesInList.get(yi);

        if(!x.getOriginalString().equals(y.getOriginalString())){

          rule=("(* "+x.getName()+" *) "+templateRulemap.get(x.getName()).getTemplate()).replace("?x", x.getOriginalString());
          rule=rule.replace("?y",y.getOriginalString());

          //avoid duplicate rules
          if(!output2.contains(rule)){
            /*
             * avoid rules that are already implied through symmetry.
             * e.g.:
             * (x sameAs y) and (y sameAs x) in diff2 and diff3.
             * And(factA factB) and And(factB factA) in prp-adp and cax adc.
             */

            rule=("(* "+x.getName()+" *) "+templateRulemap.get(x.getName()).getTemplate()).replace("?y", x.getOriginalString());
            rule=rule.replace("?x",y.getOriginalString());

            if(!output2.contains(rule)){
              output2+=("\n"+rule);
              output.append("\n"+rule);
              InferenceRulesGenerator.rulesEmitted++;
View Full Code Here

Examples of simpledao.BoundVariable

        else
        {
          whereSQL.append( " = ? " );
        }
                whereCount ++;
                bindVariables.add( new BoundVariable( whereCount, column, type, value));
            }
/*
                if ( colCount > 0 )
                {
                    selectSQL.append(", " );
View Full Code Here

Examples of simpledao.BoundVariable

            }
            sql.append(column);
            valuesSQL.append("?");

            propCount++;
            bindVariables.add(new BoundVariable(propCount, column, type, value));
        }
        sql.append( valuesSQL );
        sql.append( " )");
        return sql.toString();
    }
View Full Code Here

Examples of simpledao.BoundVariable

                }
                whereSQL.append(column);
                whereSQL.append(" = ?");

                keyCount++;
                keyBindVariables.add( new BoundVariable( keyCount, column, pd.getPropertyType(), value ) );
            }
            else
            {
                Class type = pd.getPropertyType();
                StringBuffer col = new StringBuffer();
        if (value == null ||
          (type == Integer.class || "int".equals(type.getName())) && ((Integer) value < 0) ||
          ( type == Double.class || "double".equals( type.getName() ) ) && ((Double) value < 0.0d))
        {
          continue;
        }

                if (columnCount > 0)
                {
                    col.append(", ");
                }
                col.append(column);
                col.append(" = ");
                col.append("?");
                columnCount++;
                bindVariables.add(new BoundVariable(columnCount, column, type, value));
                sql.append(col);
            }
        }

        // add the keys to the bind variable list
        for ( BoundVariable bv : keyBindVariables)
        {
            bindVariables.add( new BoundVariable(columnCount + bv.getPosition(), bv.getName(), bv.getType(), bv.getValue() ) );
        }

        sql.append( whereSQL );
        return sql.toString();
    }
View Full Code Here

Examples of simpledao.BoundVariable

                    sql.append(" AND ");
                }
                sql.append( column );
                sql.append( " = ? " );
                colCount ++;
                bindVariables.add( new BoundVariable( colCount, column, type, value ));
            }
        }
        return sql.toString();
    }
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.