本文整理了Java中org.eclipse.rdf4j.query.Dataset
类的一些代码示例,展示了Dataset
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dataset
类的具体详情如下:
包路径:org.eclipse.rdf4j.query.Dataset
类名称:Dataset
[英]Represents a dataset against which operations can be evaluated. A dataset consists of a default graph for read and using operations, which is the RDF merge of one or more graphs, a set of named graphs, and a single update graph for INSERT and DELETE. See SPARQL Query Language for RDF for more info.
[中]表示可以对其计算操作的数据集。数据集由一个用于读取和使用操作的默认图组成,该图是一个或多个图的RDF merge,一组命名图,以及一个用于插入和删除的更新图。有关更多信息,请参见SPARQL Query Language for RDF。
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client
protected List<NameValuePair> getQueryMethodParameters(QueryLanguage ql, String query, String baseURI,
Dataset dataset, boolean includeInferred, int maxQueryTime, Binding... bindings)
{
List<NameValuePair> queryParams = new ArrayList<NameValuePair>();
/*
* Only query, default-graph-uri, and named-graph-uri are standard parameters in SPARQL Protocol 1.1.
*/
if (query != null) {
if (baseURI != null && !baseURI.equals("")) {
// prepend query string with base URI declaration
query = "BASE <" + baseURI + "> \n" + query;
}
queryParams.add(new BasicNameValuePair(Protocol.QUERY_PARAM_NAME, query));
}
if (dataset != null) {
for (IRI defaultGraphURI : dataset.getDefaultGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.DEFAULT_GRAPH_PARAM_NAME,
String.valueOf(defaultGraphURI)));
}
for (IRI namedGraphURI : dataset.getNamedGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.NAMED_GRAPH_PARAM_NAME,
String.valueOf(namedGraphURI)));
}
}
return queryParams;
}
代码示例来源:origin: eclipse/rdf4j
@Override
public IRI getDefaultInsertGraph() {
IRI graph = primary.getDefaultInsertGraph();
if (graph == null)
return fallback.getDefaultInsertGraph();
return graph;
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client
public Set<IRI> getDefaultRemoveGraphs() {
Set<IRI> set = primary.getDefaultRemoveGraphs();
if (set == null || set.isEmpty())
return fallback.getDefaultRemoveGraphs();
return set;
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-http-client
if (dataset.getDefaultRemoveGraphs().size() > 0) {
if (!(dataset.getDefaultRemoveGraphs().equals(dataset.getDefaultGraphs()))) {
logger.warn(
"ambiguous dataset spec for SPARQL endpoint: default graphs and default remove graphs both defined but not equal");
for (IRI graphURI : dataset.getDefaultRemoveGraphs()) {
if (dataset.getDefaultInsertGraph() != null) {
if (!dataset.getDefaultInsertGraph().equals(graphURI)) {
logger.warn(
"ambiguous dataset spec for SPARQL endpoint: default insert graph ({}) and default remove graph ({}) both defined but not equal. ",
dataset.getDefaultInsertGraph(), graphURI);
if (dataset.getDefaultInsertGraph() != null) {
if (!dataset.getDefaultGraphs().isEmpty()) {
if (!(dataset.getDefaultGraphs().size() == 1
&& dataset.getDefaultGraphs().contains(dataset.getDefaultInsertGraph())))
dataset.getDefaultInsertGraph());
String.valueOf(dataset.getDefaultInsertGraph())));
for (IRI defaultGraphURI : dataset.getDefaultGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.USING_GRAPH_PARAM_NAME,
String.valueOf(defaultGraphURI)));
for (IRI namedGraphURI : dataset.getNamedGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.USING_NAMED_GRAPH_PARAM_NAME,
String.valueOf(namedGraphURI)));
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client
public Set<IRI> getDefaultGraphs() {
Set<IRI> set = primary.getDefaultGraphs();
if (set == null || set.isEmpty())
return fallback.getDefaultGraphs();
return set;
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-query
public Set<IRI> getNamedGraphs() {
Set<IRI> set = primary.getNamedGraphs();
if (set == null || set.isEmpty())
return fallback.getNamedGraphs();
return set;
}
代码示例来源:origin: eclipse/rdf4j
if (dataset.getDefaultRemoveGraphs().size() > 0) {
if (!(dataset.getDefaultRemoveGraphs().equals(dataset.getDefaultGraphs()))) {
logger.warn(
"ambiguous dataset spec for SPARQL endpoint: default graphs and default remove graphs both defined but not equal");
for (IRI graphURI : dataset.getDefaultRemoveGraphs()) {
if (dataset.getDefaultInsertGraph() != null) {
if (!dataset.getDefaultInsertGraph().equals(graphURI)) {
logger.warn(
"ambiguous dataset spec for SPARQL endpoint: default insert graph ({}) and default remove graph ({}) both defined but not equal. ",
dataset.getDefaultInsertGraph(), graphURI);
if (dataset.getDefaultInsertGraph() != null) {
if (!dataset.getDefaultGraphs().isEmpty()) {
if (!(dataset.getDefaultGraphs().size() == 1
&& dataset.getDefaultGraphs().contains(dataset.getDefaultInsertGraph())))
dataset.getDefaultInsertGraph());
String.valueOf(dataset.getDefaultInsertGraph())));
for (IRI defaultGraphURI : dataset.getDefaultGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.USING_GRAPH_PARAM_NAME,
String.valueOf(defaultGraphURI)));
for (IRI namedGraphURI : dataset.getNamedGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.USING_NAMED_GRAPH_PARAM_NAME,
String.valueOf(namedGraphURI)));
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-query
public Set<IRI> getDefaultGraphs() {
Set<IRI> set = primary.getDefaultGraphs();
if (set == null || set.isEmpty())
return fallback.getDefaultGraphs();
return set;
}
代码示例来源:origin: eclipse/rdf4j
@Override
public Set<IRI> getNamedGraphs() {
Set<IRI> set = primary.getNamedGraphs();
if (set == null || set.isEmpty())
return fallback.getNamedGraphs();
return set;
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client
if (dataset.getDefaultRemoveGraphs().size() > 0) {
if (!(dataset.getDefaultRemoveGraphs().equals(dataset.getDefaultGraphs()))) {
logger.warn(
"ambiguous dataset spec for SPARQL endpoint: default graphs and default remove graphs both defined but not equal");
for (IRI graphURI : dataset.getDefaultRemoveGraphs()) {
if (dataset.getDefaultInsertGraph() != null) {
if (!dataset.getDefaultInsertGraph().equals(graphURI)) {
logger.warn(
"ambiguous dataset spec for SPARQL endpoint: default insert graph ({}) and default remove graph ({}) both defined but not equal. ",
dataset.getDefaultInsertGraph(), graphURI);
if (dataset.getDefaultInsertGraph() != null) {
if (!dataset.getDefaultGraphs().isEmpty()) {
if (!(dataset.getDefaultGraphs().size() == 1
&& dataset.getDefaultGraphs().contains(dataset.getDefaultInsertGraph())))
dataset.getDefaultInsertGraph());
String.valueOf(dataset.getDefaultInsertGraph())));
for (IRI defaultGraphURI : dataset.getDefaultGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.USING_GRAPH_PARAM_NAME,
String.valueOf(defaultGraphURI)));
for (IRI namedGraphURI : dataset.getNamedGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.USING_NAMED_GRAPH_PARAM_NAME,
String.valueOf(namedGraphURI)));
代码示例来源:origin: eclipse/rdf4j
protected List<NameValuePair> getQueryMethodParameters(QueryLanguage ql, String query, String baseURI,
Dataset dataset, boolean includeInferred, int maxQueryTime, Binding... bindings)
{
List<NameValuePair> queryParams = new ArrayList<>();
/*
* Only query, default-graph-uri, and named-graph-uri are standard parameters in SPARQL Protocol 1.1.
*/
if (query != null) {
if (baseURI != null && !baseURI.equals("")) {
// prepend query string with base URI declaration
query = "BASE <" + baseURI + "> \n" + query;
}
queryParams.add(new BasicNameValuePair(Protocol.QUERY_PARAM_NAME, query));
}
if (dataset != null) {
for (IRI defaultGraphURI : dataset.getDefaultGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.DEFAULT_GRAPH_PARAM_NAME,
String.valueOf(defaultGraphURI)));
}
for (IRI namedGraphURI : dataset.getNamedGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.NAMED_GRAPH_PARAM_NAME,
String.valueOf(namedGraphURI)));
}
}
return queryParams;
}
代码示例来源:origin: eclipse/rdf4j
@Override
public Set<IRI> getDefaultGraphs() {
Set<IRI> set = primary.getDefaultGraphs();
if (set == null || set.isEmpty())
return fallback.getDefaultGraphs();
return set;
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client
public Set<IRI> getNamedGraphs() {
Set<IRI> set = primary.getNamedGraphs();
if (set == null || set.isEmpty())
return fallback.getNamedGraphs();
return set;
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-query
public Set<IRI> getDefaultRemoveGraphs() {
Set<IRI> set = primary.getDefaultRemoveGraphs();
if (set == null || set.isEmpty())
return fallback.getDefaultRemoveGraphs();
return set;
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-query
public IRI getDefaultInsertGraph() {
IRI graph = primary.getDefaultInsertGraph();
if (graph == null)
return fallback.getDefaultInsertGraph();
return graph;
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-http-client
for (IRI graphURI : dataset.getDefaultRemoveGraphs()) {
queryParams.add(
new BasicNameValuePair(Protocol.REMOVE_GRAPH_PARAM_NAME, String.valueOf(graphURI)));
if (dataset.getDefaultInsertGraph() != null) {
queryParams.add(new BasicNameValuePair(Protocol.INSERT_GRAPH_PARAM_NAME,
String.valueOf(dataset.getDefaultInsertGraph())));
for (IRI defaultGraphURI : dataset.getDefaultGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.USING_GRAPH_PARAM_NAME,
String.valueOf(defaultGraphURI)));
for (IRI namedGraphURI : dataset.getNamedGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.USING_NAMED_GRAPH_PARAM_NAME,
String.valueOf(namedGraphURI)));
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-http-client
protected List<NameValuePair> getQueryMethodParameters(QueryLanguage ql, String query, String baseURI,
Dataset dataset, boolean includeInferred, int maxQueryTime, Binding... bindings)
{
List<NameValuePair> queryParams = new ArrayList<NameValuePair>();
/*
* Only query, default-graph-uri, and named-graph-uri are standard parameters in SPARQL Protocol 1.1.
*/
if (query != null) {
if (baseURI != null && !baseURI.equals("")) {
// prepend query string with base URI declaration
query = "BASE <" + baseURI + "> \n" + query;
}
queryParams.add(new BasicNameValuePair(Protocol.QUERY_PARAM_NAME, query));
}
if (dataset != null) {
for (IRI defaultGraphURI : dataset.getDefaultGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.DEFAULT_GRAPH_PARAM_NAME,
String.valueOf(defaultGraphURI)));
}
for (IRI namedGraphURI : dataset.getNamedGraphs()) {
queryParams.add(new BasicNameValuePair(Protocol.NAMED_GRAPH_PARAM_NAME,
String.valueOf(namedGraphURI)));
}
}
return queryParams;
}
代码示例来源:origin: joshsh/sesametools
public boolean readPermitted(final Resource context) throws SailException {
return context instanceof IRI && readableSet.getDefaultGraphs().contains(context);
}
代码示例来源:origin: joshsh/sesametools
/**
* This Sail is writable if the base Sail is writable, and insofar as the
* the statements to be written are permitted by the access control
* mechanism.
*/
public boolean isWritable() throws SailException {
return getBaseSail().isWritable()
&& (!writableSet.getNamedGraphs().isEmpty()); // TODO: OR the default analysis is writable
}
代码示例来源:origin: eclipse/rdf4j
@Override
public Set<IRI> getDefaultRemoveGraphs() {
Set<IRI> set = primary.getDefaultRemoveGraphs();
if (set == null || set.isEmpty())
return fallback.getDefaultRemoveGraphs();
return set;
}
内容来源于网络,如有侵权,请联系作者删除!