本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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("]");
}
示例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(" ");
}
}
示例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");
}
示例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;
}
示例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;
}
示例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;
}