本文整理汇总了Java中org.apache.jena.sparql.engine.binding.BindingFactory类的典型用法代码示例。如果您正苦于以下问题:Java BindingFactory类的具体用法?Java BindingFactory怎么用?Java BindingFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BindingFactory类属于org.apache.jena.sparql.engine.binding包,在下文中一共展示了BindingFactory类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: moveToNextBinding
import org.apache.jena.sparql.engine.binding.BindingFactory; //导入依赖的package包/类
@Override
protected Binding moveToNextBinding() {
// we need a binding that's ?s ?p ?o
try {
Triple triple = triples.next();
BindingMap binding = BindingFactory.create();
binding.add(Var.alloc("s"), triple.getSubject());
binding.add(Var.alloc("p"), triple.getPredicate());
binding.add(Var.alloc("o"), triple.getObject());
return binding;
} catch (RiotException e) {
// bug in empty results for describe. this is
// a workaround. TODO
}
return BindingFactory.binding();
}
示例2: createBinding
import org.apache.jena.sparql.engine.binding.BindingFactory; //导入依赖的package包/类
@SafeVarargs
private final Binding createBinding(Pair<Var, Node>... bindings) {
BindingMap map = BindingFactory.create();
for (Pair<Var, Node> binding : bindings) {
map.add(binding.getLeft(), binding.getRight());
}
return map;
}
示例3: match
import org.apache.jena.sparql.engine.binding.BindingFactory; //导入依赖的package包/类
/** Evaluate a BGP : encapsulate for a better/different version */
private static QueryIterator match(Graph source, BasicPattern pattern) {
ExecutionContext execContext = new ExecutionContext(ARQ.getContext(), source, null, null) ;
// Create a chain of triple iterators.
QueryIterator chain = QueryIterSingleton.create(BindingFactory.root(), execContext) ;
for (Triple triple : pattern)
chain = new QueryIterTriplePattern(chain, triple, execContext) ;
return chain ;
}
示例4: moveToNextBinding
import org.apache.jena.sparql.engine.binding.BindingFactory; //导入依赖的package包/类
@Override
protected Binding moveToNextBinding() {
Entry<Node, Node> e = entries.next();
BindingMap b = BindingFactory.create(binding) ;
b.add(var1, e.getKey()) ;
b.add(var2, e.getValue()) ;
return b;
}
示例5: addBinding
import org.apache.jena.sparql.engine.binding.BindingFactory; //导入依赖的package包/类
public ValuesClauseBuilder addBinding() {
elm.getRows().add(BindingFactory.create());
return this;
}
示例6: eval
import org.apache.jena.sparql.engine.binding.BindingFactory; //导入依赖的package包/类
protected Node eval(String expression) {
Expr expr = ExprUtils.parse(expression, prefixes);
return expr.eval(BindingFactory.root(), env).asNode();
}