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

如何使用`org.eclipse.rdf4j.query.impl.MapBindingSet.getValue()`方法及其代码示例详解

本文整理了Java中org.eclipse.rdf4j.query.impl.MapBindingSet.getValue()方法的一些代码示例,展示了MapBindingSet.getValue()

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

MapBindingSet.getValue介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

protected Set getBindingNames() {
if (bindings.size() == 0)
return Collections.EMPTY_SET;
Set names = new HashSet();
String qry = operation;
int b = qry.indexOf('{');
String select = qry.substring(0, b);
for (String name : bindings.getBindingNames()) {
String replacement = getReplacement(bindings.getValue(name));
if (replacement != null) {
String pattern = ".*[\\?\\$]" + name + "\\W.*";
if (Pattern.compile(pattern, Pattern.MULTILINE | Pattern.DOTALL).matcher(select).matches()) {
names.add(name);
}
}
}
return names;
}

代码示例来源:origin: eclipse/rdf4j

protected Set getBindingNames() {
if (bindings.size() == 0)
return Collections.EMPTY_SET;
Set names = new HashSet<>();
String qry = operation;
int b = qry.indexOf('{');
String select = qry.substring(0, b);
for (String name : bindings.getBindingNames()) {
String replacement = getReplacement(bindings.getValue(name));
if (replacement != null) {
String pattern = ".*[\\?\\$]" + name + "\\W.*";
if (Pattern.compile(pattern, Pattern.MULTILINE | Pattern.DOTALL).matcher(select).matches()) {
names.add(name);
}
}
}
return names;
}

代码示例来源:origin: ontop/ontop

protected String getQueryString() {
if (bindings.size() == 0)
return queryString;
String qry = queryString;
int b = qry.indexOf('{');
String select = qry.substring(0, b);
String where = qry.substring(b);
for (String name : bindings.getBindingNames()) {
String replacement = getReplacement(bindings.getValue(name));
if (replacement != null) {
String pattern = "[\\?\\$]" + name + "(?=\\W)";
select = select.replaceAll(pattern, "");
where = where.replaceAll(pattern, replacement);
}
}
return select + where;
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-repository-sparql

protected Set getBindingNames() {
if (bindings.size() == 0)
return Collections.EMPTY_SET;
Set names = new HashSet();
String qry = operation;
int b = qry.indexOf('{');
String select = qry.substring(0, b);
for (String name : bindings.getBindingNames()) {
String replacement = getReplacement(bindings.getValue(name));
if (replacement != null) {
String pattern = ".*[\\?\\$]" + name + "\\W.*";
if (Pattern.compile(pattern, Pattern.MULTILINE | Pattern.DOTALL).matcher(select).matches()) {
names.add(name);
}
}
}
return names;
}

代码示例来源:origin: eclipse/rdf4j

protected String getQueryString() {
if (bindings.size() == 0)
return operation;
String qry = operation;
int b = qry.indexOf('{');
String select = qry.substring(0, b);
String where = qry.substring(b);
for (String name : bindings.getBindingNames()) {
String replacement = getReplacement(bindings.getValue(name));
if (replacement != null) {
String pattern = "[\\?\\$]" + name + "(?=\\W)";
select = select.replaceAll(pattern, "");
where = where.replaceAll(pattern, replacement);
}
}
return select + where;
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-repository-sparql

protected String getQueryString() {
if (bindings.size() == 0)
return operation;
String qry = operation;
int b = qry.indexOf('{');
String select = qry.substring(0, b);
String where = qry.substring(b);
for (String name : bindings.getBindingNames()) {
String replacement = getReplacement(bindings.getValue(name));
if (replacement != null) {
String pattern = "[\\?\\$]" + name + "(?=\\W)";
select = select.replaceAll(pattern, "");
where = where.replaceAll(pattern, replacement);
}
}
return select + where;
}

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client

protected String getQueryString() {
if (bindings.size() == 0)
return operation;
String qry = operation;
int b = qry.indexOf('{');
String select = qry.substring(0, b);
String where = qry.substring(b);
for (String name : bindings.getBindingNames()) {
String replacement = getReplacement(bindings.getValue(name));
if (replacement != null) {
String pattern = "[\\?\\$]" + name + "(?=\\W)";
select = select.replaceAll(pattern, "");
where = where.replaceAll(pattern, replacement);
}
}
return select + where;
}

代码示例来源:origin: it.unibz.inf.ontop/ontop-rdf4j

protected String getQueryString() {
if (bindings.size() == 0)
return queryString;
String qry = queryString;
int b = qry.indexOf('{');
String select = qry.substring(0, b);
String where = qry.substring(b);
for (String name : bindings.getBindingNames()) {
String replacement = getReplacement(bindings.getValue(name));
if (replacement != null) {
String pattern = "[\\?\\$]" + name + "(?=\\W)";
select = select.replaceAll(pattern, "");
where = where.replaceAll(pattern, replacement);
}
}
return select + where;
}

代码示例来源:origin: apache/incubator-rya

@Override
public void update(final AggregationElement aggregation, final AggregationState state, final VisibilityBindingSet childBindingSet) {
checkArgument(aggregation.getAggregationType() == AggregationType.COUNT, "The CountFunction only accepts COUNT AggregationElements.");
requireNonNull(state);
requireNonNull(childBindingSet);
// Only add one to the count if the child contains the binding that we are counting.
final String aggregatedName = aggregation.getAggregatedBindingName();
if(childBindingSet.hasBinding(aggregatedName)) {
final MapBindingSet result = state.getBindingSet();
final String resultName = aggregation.getResultBindingName();
final boolean newBinding = !result.hasBinding(resultName);
if(newBinding) {
// Initialize the binding.
result.addBinding(resultName, VF.createLiteral(BigInteger.ONE));
} else {
// Update the existing binding.
final Literal count = (Literal) result.getValue(resultName);
final BigInteger updatedCount = count.integerValue().add( BigInteger.ONE );
result.addBinding(resultName, VF.createLiteral(updatedCount));
}
}
}
}

代码示例来源:origin: apache/incubator-rya

@Override
public void update(final AggregationElement aggregation, final AggregationState state, final VisibilityBindingSet childBindingSet) {
checkArgument(aggregation.getAggregationType() == AggregationType.MIN, "The MinFunction only accepts MIN AggregationElements.");
requireNonNull(state);
requireNonNull(childBindingSet);
// Only update the min if the child contains the binding that we are finding the min value for.
final String aggregatedName = aggregation.getAggregatedBindingName();
if(childBindingSet.hasBinding(aggregatedName)) {
final MapBindingSet result = state.getBindingSet();
final String resultName = aggregation.getResultBindingName();
final boolean newBinding = !result.hasBinding(resultName);
Value min;
if(newBinding) {
min = childBindingSet.getValue(aggregatedName);
} else {
final Value oldMin = result.getValue(resultName);
final Value chidlMin = childBindingSet.getValue(aggregatedName);
min = compare.compare(chidlMin, oldMin) <0 ? chidlMin : oldMin;
}
result.addBinding(resultName, min);
}
}
}

代码示例来源:origin: apache/incubator-rya

@Override
public void update(final AggregationElement aggregation, final AggregationState state, final VisibilityBindingSet childBindingSet) {
checkArgument(aggregation.getAggregationType() == AggregationType.MAX, "The MaxFunction only accepts MAX AggregationElements.");
requireNonNull(state);
requireNonNull(childBindingSet);
// Only update the max if the child contains the binding that we are finding the max value for.
final String aggregatedName = aggregation.getAggregatedBindingName();
if(childBindingSet.hasBinding(aggregatedName)) {
final MapBindingSet result = state.getBindingSet();
final String resultName = aggregation.getResultBindingName();
final boolean newBinding = !result.hasBinding(resultName);
Value max;
if(newBinding) {
max = childBindingSet.getValue(aggregatedName);
} else {
final Value oldMax = result.getValue(resultName);
final Value childMax = childBindingSet.getValue(aggregatedName);
max = compare.compare(childMax, oldMax) > 0 ? childMax : oldMax;
}
result.addBinding(resultName, max);
}
}
}

代码示例来源:origin: apache/incubator-rya

sum = VF.createLiteral(BigInteger.ZERO);
} else {
sum = (Literal) state.getBindingSet().getValue(resultName);

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