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


Java BindingFactory类代码示例

本文整理汇总了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) ;
}
 
开发者ID:afs,项目名称:quack,代码行数:24,代码来源:OpExecutorQuackTDB.java

示例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;
}
 
开发者ID:semiotproject,项目名称:semiot-platform,代码行数:9,代码来源:CSPARQL.java

示例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) ;

}
 
开发者ID:peterjohnlawrence,项目名称:com.inova8.remediator,代码行数:30,代码来源:Eval.java

示例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) ; }
 
开发者ID:peterjohnlawrence,项目名称:com.inova8.remediator,代码行数:3,代码来源:QueryEngineRemediator.java


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