本文整理汇总了Java中com.hp.hpl.jena.sparql.engine.binding.BindingMap类的典型用法代码示例。如果您正苦于以下问题:Java BindingMap类的具体用法?Java BindingMap怎么用?Java BindingMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BindingMap类属于com.hp.hpl.jena.sparql.engine.binding包,在下文中一共展示了BindingMap类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeBinding
import com.hp.hpl.jena.sparql.engine.binding.BindingMap; //导入依赖的package包/类
public Binding makeBinding(ResultRow row) {
if (conditionColumn != null) {
String value = row.get(conditionColumn);
if (value == null || "false".equals(value) || "0".equals(value) || "".equals(value)) {
return null;
}
}
BindingMap result = new BindingHashMap();
for (Var variableName: nodeMakers.keySet()) {
Node node = nodeMakers.get(variableName).makeNode(row);
if (node == null) {
return null;
}
result.add(Var.alloc(variableName), node);
}
return result;
}
示例2: makeBinding
import com.hp.hpl.jena.sparql.engine.binding.BindingMap; //导入依赖的package包/类
public Binding makeBinding(ResultRow row) {
if (condition != null) {
String value = row.get(condition);
if (value == null || "false".equals(value) || "0".equals(value) || "".equals(value)) {
return null;
}
}
BindingMap result = new BindingHashMap();
for (Var variableName: nodeMakers.keySet()) {
Node node = nodeMakers.get(variableName).makeNode(row);
if (node == null) {
return null;
}
result.add(Var.alloc(variableName), node);
}
return result;
}
示例3: convertToBindings
import com.hp.hpl.jena.sparql.engine.binding.BindingMap; //导入依赖的package包/类
/** Convert rows to bindings for a give parent, that may, or may not,
* have equivalent bindings of variables in the rows */
private static Iterator<Binding> convertToBindings(Iterator<Row<NodeId>> iter, final Binding parent, final NodeTable nodeTable) {
Transform<Row<NodeId>, Binding> conv = new Transform<Row<NodeId>, Binding>() {
@Override
public Binding convert(Row<NodeId> row) {
if ( parent.isEmpty() )
return new BindingRow(row, nodeTable) ;
// Temporary fix. Proper fix is to change BindingBase to allow multiple occurrences in a controlled way.
BindingMap b = BindingFactory.create() ;
if ( ! parent.isEmpty() ) {
for ( Iterator<Var> vars = parent.vars() ; vars.hasNext() ; ) {
Var v = vars.next() ;
if ( ! row.contains(v) )
b.add(v, parent.get(v)) ;
}
}
return new BindingRow(b, row, nodeTable) ;
}
} ;
return Iter.map(iter, conv) ;
}
示例4: toBinding
import com.hp.hpl.jena.sparql.engine.binding.BindingMap; //导入依赖的package包/类
private Binding toBinding(String[] vars, String string, String separator) {
String[] values = string.split(separator);
final BindingMap binding = BindingFactory.create();
for (int i = 0; i < vars.length; i++) {
binding.add(Var.alloc(vars[i]), toNode(values[i]));
}
return binding;
}