本文整理汇总了Java中com.hp.hpl.jena.sparql.engine.binding.BindingFactory类的典型用法代码示例。如果您正苦于以下问题:Java BindingFactory类的具体用法?Java BindingFactory怎么用?Java BindingFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BindingFactory类属于com.hp.hpl.jena.sparql.engine.binding包,在下文中一共展示了BindingFactory类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertToBindings
import com.hp.hpl.jena.sparql.engine.binding.BindingFactory; //导入依赖的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) ;
}
示例2: toBinding
import com.hp.hpl.jena.sparql.engine.binding.BindingFactory; //导入依赖的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;
}
示例3: evalDS
import com.hp.hpl.jena.sparql.engine.binding.BindingFactory; //导入依赖的package包/类
static Table evalDS(OpDatasetNames opDSN, Evaluator evaluator)
{
Node graphNode = opDSN.getGraphNode() ;
if ( graphNode.isURI() )
{
if ( evaluator.getExecContext().getDataset().containsGraph(graphNode) )
{ return new TableUnit() ; }
else
// WRONG
{ return new TableEmpty() ; }
}
if ( ! Var.isVar(graphNode) )
throw new ARQInternalErrorException("OpDatasetNames: Not a URI or variable: "+graphNode) ;
DatasetGraph dsg = evaluator.getExecContext().getDataset() ;
Iterator<Node> iter = dsg.listGraphNodes() ;
List<Binding> list = new ArrayList<Binding>((int)dsg.size()) ;
for ( ; iter.hasNext(); )
{
Node gn = iter.next();
Binding b = BindingFactory.binding(Var.alloc(graphNode), gn) ;
list.add(b) ;
}
QueryIterator qIter = new QueryIterPlainWrapper(list.iterator(), evaluator.getExecContext()) ;
return TableFactory.create(qIter) ;
}
示例4: QueryEngineRemediator
import com.hp.hpl.jena.sparql.engine.binding.BindingFactory; //导入依赖的package包/类
public QueryEngineRemediator(Op op, DatasetGraph dataset, Context context)
{ this(op, dataset, BindingFactory.root(), context) ; }