本文整理汇总了Java中org.eclipse.rdf4j.query.BindingSet.getBinding方法的典型用法代码示例。如果您正苦于以下问题:Java BindingSet.getBinding方法的具体用法?Java BindingSet.getBinding怎么用?Java BindingSet.getBinding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.rdf4j.query.BindingSet
的用法示例。
在下文中一共展示了BindingSet.getBinding方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeStatement
import org.eclipse.rdf4j.query.BindingSet; //导入方法依赖的package包/类
@Override
public void removeStatement(UpdateContext op, Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException {
BindingSet bs;
Binding b;
Value v;
long timestamp = (op != null && (bs = op.getBindingSet()) != null && (b = bs.getBinding(TIMESTAMP_CALLBACK_BINDING_NAME)) != null) ? ((Literal) b.getValue()).longValue() : System.currentTimeMillis();
try {
for (Resource ctx : normalizeContexts(contexts)) {
for (KeyValue kv : HalyardTableUtils.toKeyValues(subj, pred, obj, ctx, true, timestamp)) { //calculate the kv's corresponding to the quad (or triple)
delete(kv);
}
}
} catch (IOException e) {
throw new SailException(e);
}
}
示例2: evaluate
import org.eclipse.rdf4j.query.BindingSet; //导入方法依赖的package包/类
@Override
public CloseableIteration<? extends BindingSet, QueryEvaluationException> evaluate(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) throws SailException {
Binding b = bindings.getBinding(TIMESTAMP_CALLBACK_BINDING_NAME);
final TimestampCallbackBinding timestampBinding = (b instanceof TimestampCallbackBinding) ? (TimestampCallbackBinding) b : null;
CloseableIteration<? extends BindingSet, QueryEvaluationException> iter = super.evaluate(tupleExpr, dataset, bindings, includeInferred);
//push back the actual timestamp binding to the callback binding if requested
if (timestampBinding != null) {
iter = new FilterIteration<BindingSet, QueryEvaluationException>(iter) {
@Override
protected boolean accept(BindingSet bindings) throws QueryEvaluationException {
Binding b = bindings.getBinding(TIMESTAMP_BINDING_NAME);
//push back actual time if the timestamp binding is not provided
timestampBinding.v = b == null ? SimpleValueFactory.getInstance().createLiteral(System.currentTimeMillis()) : b.getValue();
return true;
}
};
}
return iter;
}
示例3: calcKey
import org.eclipse.rdf4j.query.BindingSet; //导入方法依赖的package包/类
private BindingSet calcKey(BindingSet bindings, Set<String> commonVars) {
QueryBindingSet q = new QueryBindingSet();
for (String varName : commonVars) {
Binding b = bindings.getBinding(varName);
if (b != null) {
q.addBinding(b);
}
}
return q;
}
示例4: addStatement
import org.eclipse.rdf4j.query.BindingSet; //导入方法依赖的package包/类
@Override
public void addStatement(UpdateContext op, Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException {
BindingSet bs;
Binding b;
Value v;
long timestamp = (op != null && (bs = op.getBindingSet()) != null && (b = bs.getBinding(TIMESTAMP_CALLBACK_BINDING_NAME)) != null) ? ((Literal) b.getValue()).longValue() : System.currentTimeMillis();
for (Resource ctx : normalizeContexts(contexts)) {
addStatementInternal(subj, pred, obj, ctx, timestamp);
}
}