org.eclipse.rdf4j.repository.RepositoryConnection.getParserConfig()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(67)

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

RepositoryConnection.getParserConfig介绍

[英]Returns the parser configuration this connection uses for Rio-based operations.
[中]返回此连接用于基于Rio的操作的解析器配置。

代码示例

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

@Override
public void setDelegate(RepositoryConnection delegate) {
  this.delegate = delegate;
  setParserConfig(delegate.getParserConfig());
}

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

@Override
public void setDelegate(RepositoryConnection delegate) {
  this.delegate = delegate;
  setParserConfig(delegate.getParserConfig());
}

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

/**
   * Obtain a new {@link RepositoryConnection} with suitable parser/writer configuration for handling the
   * incoming HTTP request. The caller of this method is responsible for closing the connection.
   * 
   * @param request
   *        the {@link HttpServletRequest} for which a {@link RepositoryConnection} is to be returned
   * @return a configured {@link RepositoryConnection}
   */
  public static RepositoryConnection getRepositoryConnection(HttpServletRequest request) {
    Repository repo = getRepository(request);
    RepositoryConnection conn = repo.getConnection();
    conn.getParserConfig().addNonFatalError(BasicParserSettings.VERIFY_DATATYPE_VALUES);
    conn.getParserConfig().addNonFatalError(BasicParserSettings.VERIFY_LANGUAGE_TAGS);
    return conn;
  }
}

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

/**
 * Obtains a {@link RepositoryConnection} through the {@link ExecutorService}.
 * 
 * @return A new {@link RepositoryConnection} to use for this Transaction.
 * @throws InterruptedException
 *         If the execution of the task was interrupted.
 * @throws ExecutionException
 *         If the execution of the task failed for any reason.
 */
private RepositoryConnection getTransactionConnection()
  throws InterruptedException, ExecutionException
{
  // create a new RepositoryConnection with correct parser settings
  Future<RepositoryConnection> result = submit(() -> {
    RepositoryConnection conn = rep.getConnection();
    ParserConfig config = conn.getParserConfig();
    config.set(BasicParserSettings.PRESERVE_BNODE_IDS, true);
    config.addNonFatalError(BasicParserSettings.VERIFY_DATATYPE_VALUES);
    config.addNonFatalError(BasicParserSettings.VERIFY_LANGUAGE_TAGS);
    return conn;
  });
  return getFromFuture(result);
}

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

repositoryCon.getParserConfig().set(BasicParserSettings.PRESERVE_BNODE_IDS, true);

相关文章

微信公众号

最新文章

更多