热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.openrdf.query.BindingSet.getValue()方法的使用及代码示例

本文整理了Java中org.openrdf.query.BindingSet.getValue()方法的一些代码示例,展示了BindingSet.getVa

本文整理了Java中org.openrdf.query.BindingSet.getValue()方法的一些代码示例,展示了BindingSet.getValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BindingSet.getValue()方法的具体详情如下:
包路径:org.openrdf.query.BindingSet
类名称:BindingSet
方法名:getValue

BindingSet.getValue介绍

[英]Gets the value of the binding with the specified name from this BindingSet.
[中]从该绑定集中获取具有指定名称的绑定的值。

代码示例

代码示例来源:origin: org.openrdf.sesame/sesame-repository-sail

@Override
protected boolean accept(BindingSet bindingSet) {
Value cOntext= bindingSet.getValue("context");
return bindingSet.getValue("subject") instanceof Resource
&& bindingSet.getValue("predicate") instanceof IRI
&& bindingSet.getValue("object") instanceof Value
&& (cOntext== null || context instanceof Resource);
}
};

代码示例来源:origin: org.openrdf.sesame/sesame-queryalgebra-evaluation

@Override
protected boolean accept(BindingSet bindingSet) {
Value cOntext= bindingSet.getValue("context");
return bindingSet.getValue("subject") instanceof Resource
&& bindingSet.getValue("predicate") instanceof URI
&& bindingSet.getValue("object") instanceof Value
&& (cOntext== null || context instanceof Resource);
}
};

代码示例来源:origin: org.openrdf.alibaba/alibaba-repository-sparql

@Override
protected Resource convert(BindingSet bindings)
throws QueryEvaluationException {
return (Resource) bindings.getValue("_");
}
}) {

代码示例来源:origin: org.apache.rya/rya.indexing

private String getHashJoinKey(final String commonVarOrder, final BindingSet bs) {
final String[] commOnVarArray= commonVarOrder.split(VAR_ORDER_DELIM);
String key = bs.getValue(commonVarArray[0]).toString();
for (int i = 1; i key = key + VALUE_DELIM + bs.getValue(commonVarArray[i]).toString();
}
return key;
}

代码示例来源:origin: eu.fbk.knowledgestore/ks-server

@Override
public Statement apply(final BindingSet bindings) {
final Resource s = (Resource) bindings.getValue("s");
final URI p = (URI) bindings.getValue("p");
final Value o = bindings.getValue("o");
return Data.getValueFactory().createStatement(s, p, o);
}

代码示例来源:origin: org.openrdf.elmo/elmo-sesame

@Override
protected Object convert(BindingSet sol) {
Value value = sol.getValue(bindings.get(0));
if (value == null)
return null;
return manager.getInstance(value);
}

代码示例来源:origin: org.openrdf.sesame/sesame-spin

@Override
public List next()
throws QueryEvaluationException
{
BindingSet bs = queryResult.next();
List values = new ArrayList(bindingNames.size());
for(String bindingName : bindingNames) {
values.add(bs.getValue(bindingName));
}
return values;
}

代码示例来源:origin: eu.fbk.knowledgestore/ks-tool

String instantiate(final BindingSet bindings) {
final Object[] placeholderValues = new String[this.placeholderVariables.length];
for (int i = 0; i final Value value = bindings.getValue(this.placeholderVariables[i]);
placeholderValues[i] = Data.toString(value, null);
}
return String.format(this.text, placeholderValues);
}

代码示例来源:origin: org.apache.rya/rya.indexing

private boolean bindingSetsIntersect(BindingSet bs1, BindingSet bs2) {
for(String s: bs1.getBindingNames()) {
if(bs2.getValue(s) != null && !unAssuredVariables.contains(s)) {
return true;
}
}
return false;
}

代码示例来源:origin: eu.fbk.knowledgestore/ks-tool

public static String encode(final List variables, final BindingSet bindings) {
final StringBuilder builder = new StringBuilder();
for (int i = 0; i if (i > 0) {
builder.append('\t');
}
final Value value = bindings.getValue(variables.get(i));
builder.append(format(value));
}
return builder.toString();
}

代码示例来源:origin: org.apache.marmotta/ldclient-provider-rdf

@Override
public void handleSolution(BindingSet bindingSet) throws TupleQueryResultHandlerException {
Value predicate = bindingSet.getValue("p");
Value object = bindingSet.getValue("o");
if(predicate instanceof URI) {
triples.add(ValueFactoryImpl.getInstance().createStatement(subject,(URI)predicate,object));
} else {
log.error("ignoring binding as predicate {} is not a URI",predicate);
}
}

代码示例来源:origin: org.openrdf.alibaba/alibaba-repository-object

public Value asValue() throws OpenRDFException {
BindingSet bs = asBindingSet();
if (bs == null)
return null;
return bs.getValue(bs.getBindingNames().iterator().next());
}

代码示例来源:origin: eu.fbk.knowledgestore/ks-server

@Override
protected BindingSet convert(final BindingSet bindings) throws E {
for (int i = 0; i final String variable = variables.get(i);
builder.set(i, rewriteValue(bindings.getValue(variable)));
}
return builder.build();
}

代码示例来源:origin: org.openrdf.elmo/elmo-repository

@Override
public BindingSet getBindings() {
BindingSet bindings = super.getBindings();
MapBindingSet result = new MapBindingSet();
for (String name : bindings.getBindingNames()) {
if (bindings.getValue(name) instanceof BNode) {
result.addBinding(name, bindings.getValue(name));
}
}
return result;
}

代码示例来源:origin: org.openrdf.elmo/elmo-repository

String getQuery() {
String qry = query;
BindingSet bindings = super.getBindings();
for (String name : bindings.getBindingNames()) {
String replacement = getReplacement(bindings.getValue(name));
if (replacement != null) {
String pattern = "[\\?\\$]" + name + "(?=\\W)";
qry = qry.replaceAll(pattern, replacement);
}
}
return qry;
}

代码示例来源:origin: org.openrdf.sesame/sesame-queryalgebra-evaluation

@Override
public BindingSet next()
throws QueryEvaluationException
{
QueryBindingSet projected = new QueryBindingSet();
BindingSet result = iter.next();
for (String var : projectionVars) {
Value v = result.getValue(var);
projected.addBinding(var, v);
}
return projected;
}

代码示例来源:origin: org.openrdf.sesame/sesame-queryalgebra-evaluation

public 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;
}

代码示例来源:origin: org.qi4j.extension/org.qi4j.extension.indexing-rdf

private boolean processRow( long row, BindingSet bindingSet, QualifiedIdentityResultCallback callback )
{
final Value identifier = bindingSet.getValue( "identity" );
//TODO Shall we throw an exception if there is no binding for identifier = query parser is not right
if( identifier == null )
{
return true;
}
final String identity = identifier.stringValue();
final EntityReference entityReference = new EntityReference( identity );
return callback.processRow( row, entityReference );
}

代码示例来源:origin: eu.fbk.knowledgestore/ks-server

private static BindingSet skolemize(final BindingSet bindings) {
final QueryBindingSet result = new QueryBindingSet();
for (final String name : bindings.getBindingNames()) {
result.setBinding(name, skolemize(bindings.getValue(name)));
}
return result;
}

代码示例来源:origin: eu.fbk.knowledgestore/ks-server

@Override
public void meet(final Var var) {
if (!var.hasValue() && bindings.hasBinding(var.getName())) {
final Value value = bindings.getValue(var.getName());
var.setValue(value);
}
}

推荐阅读
author-avatar
mobiledu2502936255
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有