org.eclipse.rdf4j.query.Query.setDataset()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(272)

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

Query.setDataset介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-http-server-spring

result.setDataset(dataset);

代码示例来源:origin: org.eclipse.rdf4j/rdf4j-http-server-spring

result.setDataset(dataset);

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

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.eclipse.rdf4j/rdf4j-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: eclipse/rdf4j

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

相关文章