本文整理了Java中org.openrdf.query.Binding
类的一些代码示例,展示了Binding
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Binding
类的具体详情如下:
包路径:org.openrdf.query.Binding
类名称:Binding
[英]A named value binding.
[中]命名值绑定。
代码示例来源: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.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
/**
* Adds a binding to the binding set.
*
* @param binding
* The binding to add to the binding set.
*/
public void addBinding(Binding binding) {
bindings.put(binding.getName(), binding);
}
代码示例来源: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
/**
* Adds a binding to the solution.
*
* @param binding
* The binding to add to the solution.
*/
public void addBinding(Binding binding) {
bindings.put(binding.getName(), binding);
}
代码示例来源: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.openrdf.sesame/sesame-store
public Value getValue(String bindingName) {
Binding binding = getBinding(bindingName);
if (binding != null) {
return binding.getValue();
}
return null;
}
代码示例来源:origin: blazegraph/database
/**
* Return an ordered collection of the distinct variable names used in the
* given caller's solution set.
*
* @param bindingSets
* The solution set.
*
* @return The distinct, ordered collection of variables used.
*/
protected LinkedHashSet<String> getDistinctVars(final BindingSet[] bindingSets) {
final LinkedHashSet<String> vars = new LinkedHashSet<String>();
for (BindingSet bindingSet : bindingSets) {
for (Binding binding : bindingSet) {
vars.add(binding.getName());
}
}
return vars;
}
代码示例来源: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: com.blazegraph/bigdata-core
/**
* Return an ordered collection of the distinct variable names used in the
* given caller's solution set.
*
* @param bindingSets
* The solution set.
*
* @return The distinct, ordered collection of variables used.
*/
protected LinkedHashSet<String> getDistinctVars(final BindingSet[] bindingSets) {
final LinkedHashSet<String> vars = new LinkedHashSet<String>();
for (BindingSet bindingSet : bindingSets) {
for (Binding binding : bindingSet) {
vars.add(binding.getName());
}
}
return vars;
}
代码示例来源: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.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: 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: it.unibz.inf.ontop/ontop-quest-sesame
@Override
public Value getValue(String bindingName) {
return createBinding(bindingName).getValue();
}
代码示例来源:origin: org.openrdf.sesame/sesame-queryalgebra-evaluation
public void setBinding(Binding binding) {
setBinding(binding.getName(), binding.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: org.openrdf.sesame/sesame-repository-sparql
public void setBinding(Binding binding) {
setBinding(binding.getName(), binding.getValue());
}
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!