本文整理匯總了Java中org.eclipse.rdf4j.query.algebra.Var.getValue方法的典型用法代碼示例。如果您正苦於以下問題:Java Var.getValue方法的具體用法?Java Var.getValue怎麽用?Java Var.getValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.rdf4j.query.algebra.Var
的用法示例。
在下文中一共展示了Var.getValue方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: evaluateZeroLengthPath
import org.eclipse.rdf4j.query.algebra.Var; //導入方法依賴的package包/類
/**
* Evaluate {@link ZeroLengthPath} query model nodes
* @param parent
* @param zlp
* @param bindings
*/
private void evaluateZeroLengthPath(BindingSetPipe parent, ZeroLengthPath zlp, BindingSet bindings) {
final Var subjectVar = zlp.getSubjectVar();
final Var objVar = zlp.getObjectVar();
final Var contextVar = zlp.getContextVar();
Value subj = subjectVar.getValue() == null ? bindings.getValue(subjectVar.getName()) : subjectVar.getValue();
Value obj = objVar.getValue() == null ? bindings.getValue(objVar.getName()) : objVar.getValue();
if (subj != null && obj != null) {
if (!subj.equals(obj)) {
try {
parent.push(null);
} catch (InterruptedException e) {
parent.handleException(e);
}
return;
}
}
//temporary solution using copy of the original iterator
//re-writing this to push model is a bit more complex task
HalyardStatementPatternEvaluation.enqueue(parent, new ZeroLengthPathIteration(parentStrategy, subjectVar, objVar, subj, obj, contextVar, bindings), zlp);
}
示例2: transformVar
import org.eclipse.rdf4j.query.algebra.Var; //導入方法依賴的package包/類
private Collection<FuzzyEntry<Var>> transformVar(Var v) {
Set<FuzzyEntry<Var>> vars = new HashSet<FuzzyEntry<Var>>();
Value val = v.getValue();
if (val != null && val instanceof IRI) {
Collection<EquivalentIRI> uris = getEquivalentURI(v);
for(EquivalentIRI uri : uris)
{
Var v1 = transformVar(v,uri);
vars.add(new FuzzyEntry<Var>(v1, uri.getProximity()));
}
}
else {
vars.add(new FuzzyEntry<Var>(v));
}
return vars;
}
示例3: toValue
import org.eclipse.rdf4j.query.algebra.Var; //導入方法依賴的package包/類
protected static Value toValue(Var var, BindingSet bindings) {
if (var.hasValue())
return var.getValue();
if (bindings.hasBinding(var.getName()))
return bindings.getValue(var.getName());
return null;
}
示例4: getVarValue
import org.eclipse.rdf4j.query.algebra.Var; //導入方法依賴的package包/類
/**
* Gets a value from a {@code Var} if it has a {@code Value}. If it does not then the method will attempt to get it
* from the bindings using the name of the Var
* @param var
* @param bindings
* @return the matching {@code Value} or {@code null} if var is {@code null}
*/
private static Value getVarValue(Var var, BindingSet bindings) {
if (var == null) {
return null;
} else if (var.hasValue()) {
return var.getValue();
} else {
return bindings.getValue(var.getName());
}
}
示例5: evaluate
import org.eclipse.rdf4j.query.algebra.Var; //導入方法依賴的package包/類
/**
* Evaluate a {@link Var} query model node.
* @param var
* @param bindings the set of named value bindings
* @return the result of {@link Var#getValue()} from either {@code var}, or if {@code null}, from the {@ bindings}
* @throws ValueExprEvaluationException
* @throws QueryEvaluationException
*/
private Value evaluate(Var var, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException {
Value value = var.getValue();
if (value == null) {
value = bindings.getValue(var.getName());
}
if (value == null) {
throw new ValueExprEvaluationException();
}
return value;
}
示例6: isSameCtx
import org.eclipse.rdf4j.query.algebra.Var; //導入方法依賴的package包/類
private boolean isSameCtx(Var v1, Var v2) {
if ((v1 != null && v1.getValue() != null) && (v2 != null && v2.getValue() != null)) {
return v1.getValue().equals(v2.getValue());
}
else if ((v1 != null && v1.getName() != null) && (v2 != null && v2.getName() != null)) {
return v1.getName().equals(v2.getName());
}
return false;
}
示例7: getEquivalentURI
import org.eclipse.rdf4j.query.algebra.Var; //導入方法依賴的package包/類
private Collection<EquivalentIRI> getEquivalentURI(Var v) {
Value val = v.getValue();
if (val != null && val instanceof IRI) {
IRI uri = (IRI)val;
return queryTransformation.retrieveEquivalentURIs(uri);
}
return Collections.emptySet();
}
示例8: meet
import org.eclipse.rdf4j.query.algebra.Var; //導入方法依賴的package包/類
@Override
public void meet(Var var) {
if (var.getValue()==null)
vars.add(var.getName());
super.meet(var);
}
示例9: getVarValue
import org.eclipse.rdf4j.query.algebra.Var; //導入方法依賴的package包/類
/**
* Return the {@link Value} of the variable which is either taken from
* the variable itself (bound) or from the bindingsset (unbound).
*
* @param var
* @param bindings
* the bindings, must not be null, use {@link EmptyBindingSet} instead
*
* @return
* the value or null
*/
public static Value getVarValue(Var var, BindingSet bindings) {
if (var == null) {
return null;
} else if (var.hasValue()) {
return var.getValue();
} else {
return bindings.getValue(var.getName());
}
}