本文整理汇总了Java中org.openrdf.query.algebra.StatementPattern.getAssuredBindingNames方法的典型用法代码示例。如果您正苦于以下问题:Java StatementPattern.getAssuredBindingNames方法的具体用法?Java StatementPattern.getAssuredBindingNames怎么用?Java StatementPattern.getAssuredBindingNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openrdf.query.algebra.StatementPattern
的用法示例。
在下文中一共展示了StatementPattern.getAssuredBindingNames方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAssuredBindingNames
import org.openrdf.query.algebra.StatementPattern; //导入方法依赖的package包/类
public Set<String> getAssuredBindingNames() {
Set<String> bindingNames = Sets.newHashSet();
for(final StatementPattern sp: nodes) {
if(bindingNames.size() == 0) {
bindingNames = sp.getAssuredBindingNames();
} else {
bindingNames = Sets.union(bindingNames, sp.getAssuredBindingNames());
}
}
return bindingNames;
}
示例2: getSpJoinSelect
import org.openrdf.query.algebra.StatementPattern; //导入方法依赖的package包/类
private double getSpJoinSelect(RdfCloudTripleStoreConfiguration conf, TupleExpr te, StatementPattern sp1)
throws TableNotFoundException {
// System.out.println("Tuple is " + te + " and sp is " + sp1);
if (te instanceof StatementPattern) {
return getJoinSelect(conf, (StatementPattern) te, sp1);
} else {
SpExternalCollector spe = new SpExternalCollector();
te.visit(spe);
List<QueryModelNode> espList = spe.getSpExtTup();
if (espList.size() == 0) {
Set<String> tupBn = te.getAssuredBindingNames();
Set<String> eBn = sp1.getAssuredBindingNames();
Set<String> intersect = Sets.intersection(tupBn, eBn);
return Math.pow(1.0 / 10000.0, intersect.size());
}
double min = Double.MAX_VALUE;
double select = Double.MAX_VALUE;
for (QueryModelNode node : espList) {
if (node instanceof StatementPattern)
select = getJoinSelect(conf, sp1, (StatementPattern) node);
else if (node instanceof ExternalSet) {
select = getExtJoinSelect(sp1, (ExternalSet) node);
}
if (min > select) {
min = select;
}
}
// System.out.println("Max is " + max);
return min;
}
}