本文整理了Java中org.openrdf.query.Query.setDataset
方法的一些代码示例,展示了Query.setDataset
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setDataset
方法的具体详情如下:
包路径:org.openrdf.query.Query
类名称:Query
方法名:setDataset
[英]Specifies the dataset against which to evaluate a query, overriding any dataset that is specified in the query itself.
[中]指定要对其计算查询的数据集,覆盖查询本身中指定的任何数据集。
代码示例来源:origin: org.openrdf.sesame/sesame-http-server-spring
result.setDataset(dataset);
代码示例来源:origin: org.openrdf.sesame/sesame-http-server-spring
result.setDataset(dataset);
代码示例来源:origin: org.openrdf.alibaba/alibaba-repository-sparql
private void setBindings(Query query, Resource subj, URI pred, Value obj,
Resource... contexts) throws RepositoryException {
if (subj != null) {
query.setBinding("s", subj);
}
if (pred != null) {
query.setBinding("p", pred);
}
if (obj != null) {
query.setBinding("o", obj);
}
if (contexts != null && contexts.length > 0
&& (contexts[0] != null || contexts.length > 1)) {
DatasetImpl dataset = new DatasetImpl();
for (Resource ctx : contexts) {
if (ctx instanceof URI) {
dataset.addDefaultGraph((URI) ctx);
} else {
throw new RepositoryException("Contexts must be URIs");
}
}
query.setDataset(dataset);
}
}
}
代码示例来源:origin: org.openrdf.sesame/sesame-repository-sparql
private void setBindings(Query query, Resource subj, IRI pred, Value obj, Resource... contexts)
throws RepositoryException
{
if (subj != null) {
query.setBinding("s", subj);
}
if (pred != null) {
query.setBinding("p", pred);
}
if (obj != null) {
query.setBinding("o", obj);
}
if (contexts != null && contexts.length > 0) {
SimpleDataset dataset = new SimpleDataset();
for (Resource ctx : contexts) {
if (ctx == null || ctx instanceof IRI) {
dataset.addDefaultGraph((IRI)ctx);
}
else {
throw new RepositoryException("Contexts must be URIs");
}
}
query.setDataset(dataset);
}
}
代码示例来源:origin: org.openrdf.sesame/sesame-sparql-testsuite
Query query = con.prepareQuery(QueryLanguage.SPARQL, queryString, queryFileURL);
if (dataset != null) {
query.setDataset(dataset);
代码示例来源:origin: apache/attic-polygene-java
result.setDataset( dataset );
代码示例来源:origin: blazegraph/database
Query query = con.prepareQuery(QueryLanguage.SPARQL, queryString, queryFileURL);
if (dataset != null) {
query.setDataset(dataset);
代码示例来源:origin: blazegraph/database
Query query = con.prepareQuery(QueryLanguage.SPARQL, queryString, queryFileURL);
if (dataset != null) {
query.setDataset(dataset);
代码示例来源:origin: org.openrdf.sesame/sesame-queryparser-sparql-compliance
Query query = con.prepareQuery(QueryLanguage.SPARQL, queryString, queryFileURL);
if (dataset != null) {
query.setDataset(dataset);
代码示例来源:origin: blazegraph/database
Query query = con.prepareQuery(QueryLanguage.SPARQL, queryString, queryFileURL);
if (dataset != null) {
query.setDataset(dataset);
代码示例来源:origin: blazegraph/database
Query query = con.prepareQuery(QueryLanguage.SPARQL, queryString, queryFileURL);
if (dataset != null) {
query.setDataset(dataset);
内容来源于网络,如有侵权,请联系作者删除!