Package lupos.owl2rl.owlToRif

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


    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

    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

     * 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

TOP

Related Classes of lupos.owl2rl.owlToRif.BoundVariable

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.