本文整理了Java中org.openrdf.query.Binding.getValue()
方法的一些代码示例,展示了Binding.getValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Binding.getValue()
方法的具体详情如下:
包路径:org.openrdf.query.Binding
类名称:Binding
方法名:getValue
[英]Gets the value of the binding. The returned value is never equal to null, such a "binding" is considered to be unbound.
[中]获取绑定的值。返回的值永远不等于null,这样的“绑定”被认为是未绑定的。
代码示例来源:origin: org.openrdf.sesame/sesame-query
@Override
public final int hashCode() {
int hashCode = 0;
for (Binding binding : this) {
hashCode ^= binding.getName().hashCode() ^ binding.getValue().hashCode();
}
return hashCode;
}
代码示例来源:origin: org.openrdf.sesame/sesame-query
@Override
public boolean equals(Object o) {
if (o instanceof Binding) {
Binding other = (Binding)o;
return name.equals(other.getName()) && value.equals(other.getValue());
}
return false;
}
代码示例来源:origin: org.wikidata.query.rdf/testTools
@Override
protected void describeMismatchSafely(BindingSet item, Description mismatchDescription) {
Binding binding = item.getBinding(name);
mismatchDescription.appendText("instead it was bound to").appendValue(binding.getValue());
}
代码示例来源:origin: org.openrdf.sesame/sesame-query
public Value getValue(String bindingName) {
Binding binding = getBinding(bindingName);
if (binding != null) {
return binding.getValue();
}
return null;
}
代码示例来源:origin: org.openrdf.sesame/sesame-store
public Value getValue(String bindingName) {
Binding binding = getBinding(bindingName);
if (binding != null) {
return binding.getValue();
}
return null;
}
代码示例来源:origin: org.openrdf.sesame/sesame-store
@Override
public boolean equals(Object o)
{
if (o instanceof Binding) {
Binding other = (Binding)o;
return name.equals(other.getName()) && value.equals(other.getValue());
}
return false;
}
代码示例来源:origin: org.wikidata.query.rdf/testTools
@Override
protected boolean matchesSafely(BindingSet item) {
Binding binding = item.getBinding(name);
if (binding == null) {
return false;
}
return valueMatcher.matches(binding.getValue());
}
}
代码示例来源:origin: org.wikidata.query.rdf/testTools
@Override
protected void describeMismatchSafely(BindingSet item, Description mismatchDescription) {
Binding binding = item.getBinding(name);
if (binding == null) {
mismatchDescription.appendText("but did not contain such a binding");
return;
}
mismatchDescription.appendText("instead it was bound to").appendValue(binding.getValue());
}
代码示例来源:origin: it.unibz.inf.ontop/ontop-quest-sesame
@Override
public Value getValue(String bindingName) {
return createBinding(bindingName).getValue();
}
代码示例来源:origin: org.apache.rya/rya.api.model
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append(" names: ");
for (final String name : getBindingNames()) {
sb.append("\n [name]: " + name + " --- [value]: " + getBinding(name).getValue().toString());
}
return sb.toString();
}
}
代码示例来源:origin: net.fortytwo.smsn/smsn-p2p
public JSONObject toJSON(final BindingSet solution, final Long expirationTime) throws JSONException {
JSONObject j = new JSONObject();
JSONObject solutionObj = new JSONObject();
for (Binding b : solution) {
solutionObj.put(b.getName(), toJSON(b.getValue()));
}
j.put("solution", solutionObj);
j.put("expirationTime", expirationTime);
return j;
}
代码示例来源:origin: synchrony/smsn
public JSONObject toJSON(final BindingSet solution, final Long expirationTime) throws JSONException {
JSONObject j = new JSONObject();
JSONObject solutionObj = new JSONObject();
for (Binding b : solution) {
solutionObj.put(b.getName(), toJSON(b.getValue()));
}
j.put("solution", solutionObj);
j.put("expirationTime", expirationTime);
return j;
}
代码示例来源:origin: blazegraph/database
private void printBindingSet(StringBuilder message, BindingSet bs) {
// message.append(bs);
for (String bn: bs.getBindingNames()) {
Value v = bs.getBinding(bn).getValue();
message.append(bn).append('=').append(v);
if (v instanceof BigdataValue) {
message.append(' ').append(((BigdataValue)v).getIV()).append(' ');
}
}
}
代码示例来源:origin: net.fortytwo.extendo/extendo-p2p
public JSONObject toJSON(final BindingSet bs) throws JSONException {
JSONObject j = new JSONObject();
for (Binding b : bs) {
j.put(b.getName(), toJSON(b.getValue()));
}
return j;
}
代码示例来源:origin: org.openrdf.sesame/sesame-queryalgebra-evaluation
/**
* Adds a new binding to the binding set. The binding's name must not already
* be part of this binding set.
*
* @param binding
* The binding to add this this BindingSet.
*/
public void addBinding(Binding binding) {
addBinding(binding.getName(), binding.getValue());
}
代码示例来源:origin: org.openrdf.sesame/sesame-repository-sparql
/**
* Adds a new binding to the binding set. The binding's name must not already
* be part of this binding set.
*
* @param binding
* The binding to add this this BindingSet.
*/
public void addBinding(Binding binding) {
addBinding(binding.getName(), binding.getValue());
}
代码示例来源:origin: io.redlink/redlink-sdk-java
private void setEnhancementData(Enhancement enhancement, BindingSet result) {
if (result.hasBinding("confidence")) {
enhancement.setConfidence(Double.parseDouble(result
.getBinding("confidence").getValue().stringValue()));
} else {
enhancement.setConfidence(1.0); // Rupert says this should be the default value...
}
}
代码示例来源:origin: blazegraph/database
private void printBindingSet(StringBuilder message, BindingSet bs) {
// message.append(bs);
for (String bn: bs.getBindingNames()) {
Value v = bs.getBinding(bn).getValue();
message.append(bn).append('=').append(v);
if (v instanceof BigdataValue) {
message.append(' ').append(((BigdataValue)v).getIV()).append(' ');
}
}
}
代码示例来源:origin: eu.fbk.rdfpro/rdfpro-rules
@Override
public void meet(final Var var) {
final Binding binding = bindings.getBinding(var.getName());
if (binding != null) {
if (var.getParentNode() instanceof StatementPattern) {
var.setValue(binding.getValue());
var.setName("_const-" + var.getName());
} else {
replaceNode(result, var, new ValueConstant(binding.getValue()));
}
}
}
代码示例来源:origin: org.openrdf.sesame/sesame-sail-spin
private static void addBindings(Resource subj, Resource opResource, ParsedOperation parsedOp, Operation op,
TripleSource tripleSource, SpinParser parser)
throws OpenRDFException
{
if (!parser.isThisUnbound(opResource, tripleSource)) {
op.setBinding(THIS_VAR, subj);
}
if (parsedOp instanceof ParsedTemplate) {
for (Binding b : ((ParsedTemplate)parsedOp).getBindings()) {
op.setBinding(b.getName(), b.getValue());
}
}
}
内容来源于网络,如有侵权,请联系作者删除!