当前位置: 首页>>代码示例>>Java>>正文


Java StatementPattern.getVarList方法代码示例

本文整理汇总了Java中org.openrdf.query.algebra.StatementPattern.getVarList方法的典型用法代码示例。如果您正苦于以下问题:Java StatementPattern.getVarList方法的具体用法?Java StatementPattern.getVarList怎么用?Java StatementPattern.getVarList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openrdf.query.algebra.StatementPattern的用法示例。


在下文中一共展示了StatementPattern.getVarList方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: numberOfSpVars

import org.openrdf.query.algebra.StatementPattern; //导入方法依赖的package包/类
private int numberOfSpVars(StatementPattern sp) {
    List<Var> varList = sp.getVarList();
    int varCount = 0;

    for(int i = 0; i < 3; i++) {
       if(!varList.get(i).isConstant()) {
           varCount++;
       }
    }

    return varCount;
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:13,代码来源:EntityTupleSet.java

示例2: getVariableNames

import org.openrdf.query.algebra.StatementPattern; //导入方法依赖的package包/类
private Set<String> getVariableNames() {
    Set<String> vars = new HashSet<>();
    for (StatementPattern pattern : patterns) {
        for (Var var : pattern.getVarList()) {
            if (var.getValue() == null) {
                vars.add(var.getName());
            }
        }
    }
    return vars;
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:12,代码来源:StatementMetadataNode.java

示例3: getRow

import org.openrdf.query.algebra.StatementPattern; //导入方法依赖的package包/类
public static String getRow(StatementPattern sp, boolean joinTable) {

    String row = "";
    String values = "";
    List<Var> varList = sp.getVarList();
    List<String> constList = CardinalityCalcUtil.getConstantPos(sp);
    int i;

    for (String s : constList) {

      i = CardinalityCalcUtil.triplePlaceToInt(s);

      if (row.equals("subject") && s.equals("object") && joinTable) {
        row = s + row;
        if (values.length() == 0) {
          values = values + removeQuotes(varList.get(i).getValue().toString());
        } else {
          values = removeQuotes(varList.get(i).getValue().toString()) + DELIM + values;
        }
      } else {
        row = row + s;
        if (values.length() == 0) {
          values = values + removeQuotes(varList.get(i).getValue().toString());
        } else {
          values = values + DELIM + removeQuotes(varList.get(i).getValue().toString());
        }
      }

    }

    return (row + DELIM + values);

  }
 
开发者ID:apache,项目名称:incubator-rya,代码行数:34,代码来源:CardinalityCalcUtil.java

示例4: getJoinType

import org.openrdf.query.algebra.StatementPattern; //导入方法依赖的package包/类
private static List<String> getJoinType(StatementPattern sp1, StatementPattern sp2) {

    List<String> joinList = new ArrayList<String>();
    List<Var> spList1 = sp1.getVarList();
    List<Var> spList2 = sp2.getVarList();

    List<String> pos1 = CardinalityCalcUtil.getVariablePos(sp1);
    List<String> pos2 = CardinalityCalcUtil.getVariablePos(sp2);

    int i, j;

    for (String s : pos1) {
      for (String t : pos2) {
        i = CardinalityCalcUtil.triplePlaceToInt(s);
        j = CardinalityCalcUtil.triplePlaceToInt(t);

        if (spList1.get(i).getName().equals(spList2.get(j).getName())) {
          joinList.add(s);
          joinList.add(t);

        }

      }
    }
    if (joinList.size() == 4) {
      return orderJoinType(joinList);
    }

    return joinList;

  }
 
开发者ID:apache,项目名称:incubator-rya,代码行数:32,代码来源:CardinalityCalcUtil.java

示例5: meet

import org.openrdf.query.algebra.StatementPattern; //导入方法依赖的package包/类
@Override
public void meet(StatementPattern node) throws RuntimeException {
	addIndent();
	for (Var var : node.getVarList()) {
		var.visit(this);
		buffer.append(" ");
	}
	
	if (eval instanceof AbstractCostEstimator) {
		AbstractCardinalityEstimator evalCard = ((AbstractCostEstimator) eval).getCardinalityEstimator();
		buffer.append(" [").append(evalCard.getName()).append(": ").append(evalCard.process(node)).append("]");
	} else if (eval != null)
		buffer.append(" [").append(evalLabel).append(": ").append(eval.process(node)).append("]");
}
 
开发者ID:goerlitz,项目名称:rdffederator,代码行数:15,代码来源:AnnotatingTreePrinter.java

示例6: meet

import org.openrdf.query.algebra.StatementPattern; //导入方法依赖的package包/类
@Override
public void meet(StatementPattern node) throws RuntimeException {
	buffer.append(indent);
	for (Var var : node.getVarList()) {
		var.visit(this);
		buffer.append(" ");
	}
}
 
开发者ID:goerlitz,项目名称:rdffederator,代码行数:9,代码来源:OperatorTreePrinter.java

示例7: meet

import org.openrdf.query.algebra.StatementPattern; //导入方法依赖的package包/类
@Override
public void meet(StatementPattern node) throws RuntimeException {
	buffer.append(indent);
	for (Var var : node.getVarList()) {
		var.visit(this);
		buffer.append(" ");
	}
	buffer.append(".\n");
}
 
开发者ID:goerlitz,项目名称:rdffederator,代码行数:10,代码来源:SparqlPrinter.java

示例8: genConstantCompare

import org.openrdf.query.algebra.StatementPattern; //导入方法依赖的package包/类
private static boolean genConstantCompare(StatementPattern queryNode, StatementPattern indexNode) {
    
    

    ArrayList<Var> vars1 = (ArrayList<Var>) queryNode.getVarList();
    ArrayList<Var> vars2 = (ArrayList<Var>) indexNode.getVarList();

    
    for (int i = 0; i < vars1.size(); i++) {

        if (vars1.get(i).isConstant() && vars2.get(i).isConstant()) {

            if (!vars1.get(i).equals(vars2.get(i))) {
                return false;

            }

        } else if(!vars1.get(i).isConstant() && vars2.get(i).isConstant() ) {
                return false;
        }

    }

    return true;

}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:27,代码来源:QueryVariableNormalizer.java

示例9: getVariablePos

import org.openrdf.query.algebra.StatementPattern; //导入方法依赖的package包/类
private static List<String> getVariablePos(StatementPattern sp) {

    List<String> posList = new ArrayList<String>();
    List<Var> varList = sp.getVarList();

    for (int i = 0; i < 3; i++) {
      if (!varList.get(i).isConstant()) {
        posList.add(intToTriplePlace(i));

      }
    }

    return posList;

  }
 
开发者ID:apache,项目名称:incubator-rya,代码行数:16,代码来源:CardinalityCalcUtil.java

示例10: getConstantPos

import org.openrdf.query.algebra.StatementPattern; //导入方法依赖的package包/类
private static List<String> getConstantPos(StatementPattern sp) {

    List<String> posList = new ArrayList<String>();
    List<Var> varList = sp.getVarList();

    for (int i = 0; i < 3; i++) {
      if (varList.get(i).isConstant()) {
        posList.add(intToTriplePlace(i));

      }
    }

    return posList;

  }
 
开发者ID:apache,项目名称:incubator-rya,代码行数:16,代码来源:CardinalityCalcUtil.java


注:本文中的org.openrdf.query.algebra.StatementPattern.getVarList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。