Milestone number 1 of the upcoming 6.0.0 release of RDF4J is now available for download.
RDF4J 6.0.0 is a major release of the RDF4J framework, focusing on dependency upgrades, LMDB improvements, and HTTP client improvements.
Please note that RDF4J 6.0.0-M1 requires Java 25.
Some of the highlights covered in this first milestone:
This milestone build is not yet feature-complete, but we are putting it out to receive early feedback on all the improvements we have put in.
RDF4J 6.0.0 contains several backward incompatible changes.
RDF4J previously used Apache HttpComponents 4 as its sole HTTP client, with Apache HttpComponents 4 types
directly exposed in the public API. In 6.0.0, this dependency has been replaced by a new
HTTP-client-agnostic facade. Apache HttpComponents 4 is no longer exposed through the rdf4j-http-client
public API or required as a transitive dependency of rdf4j-http-client for standard use.
For most users, no dependency changes are required. The rdf4j-http-client artifact continues to bundle both
built-in backend implementations as runtime dependencies, so upgrading the RDF4J version is sufficient for
standard use cases.
Two HTTP client backends are now available:
rdf4j-http-client-apache5) - the default backend when on the classpath.rdf4j-http-client-jdk) - a zero-dependency alternative using the JDK
java.net.http.HttpClient API.To select a specific backend, set the rdf4j.http.client.factory system property to either apache5 or
jdk:
-Drdf4j.http.client.factory=jdk
If you previously configured connection pooling or timeouts via system properties on
SharedHttpClientSessionManager, those properties are still supported:
org.eclipse.rdf4j.client.http.maxConnPerRoute (default: 25)org.eclipse.rdf4j.client.http.maxConnTotal (default: 50)org.eclipse.rdf4j.client.http.connectionTimeout (default: 30 000 ms)org.eclipse.rdf4j.client.http.connectionRequestTimeoutFor a minimal-footprint deployment without Apache HttpComponents 5, exclude rdf4j-http-client-apache5 and
ensure rdf4j-http-client-jdk is on the classpath.
The following public API methods previously exposed org.apache.http.client.HttpClient from Apache
HttpComponents 4 and have been replaced (GH-5723):
| Old method | Replacement |
|---|---|
HttpClientDependent#getHttpClient() returns org.apache.http.client.HttpClient | Returns org.eclipse.rdf4j.http.client.spi.RDF4JHttpClient |
HttpClientDependent#setHttpClient(HttpClient) | Accepts org.eclipse.rdf4j.http.client.spi.RDF4JHttpClient |
HttpClientSessionManager#getHttpClient() returns org.apache.http.client.HttpClient | Returns org.eclipse.rdf4j.http.client.spi.RDF4JHttpClient |
If your code calls setHttpClient() with a custom Apache HttpComponents 4 client, you must migrate to the
new API.
The new rdf4j-http-client-api module defines the HTTP client facade with no third-party HTTP dependencies.
The key types are:
RDF4JHttpClientFactory - SPI interface discovered via java.util.ServiceLoader; implement this to plug in
a custom HTTP backend.RDF4JHttpClient - the HTTP client interface used internally by SPARQLProtocolSession and
RDF4JProtocolSession.RDF4JHttpClientConfig - immutable configuration object for timeouts, connection pooling, SSL, and default
headers.RDF4JHttpClients - utility class for obtaining the default factory or creating clients.Use RDF4JHttpClientConfig and RDF4JHttpClients to create a configured client and pass it to a repository
or session:
RDF4JHttpClientConfig config = RDF4JHttpClientConfig.newBuilder()
.connectTimeoutMs(5_000)
.socketTimeoutMs(30_000)
.maxConnectionsPerRoute(10)
.build();
RDF4JHttpClient client = RDF4JHttpClients.newDefaultClient(config);
HTTPRepository repo = new HTTPRepository("http://localhost:8080/rdf4j-server/repositories/myrepo");
repo.setHttpClient(client);
The previous HttpClientBuilders.getSSLTrustAllHttpClientBuilder() helper, which returned an Apache
HttpComponents 4 builder, has been replaced by HttpClientBuilders.getSslTrustAllConfig():
RDF4JHttpClientConfig config = HttpClientBuilders.getSslTrustAllConfig();
RDF4JHttpClient client = RDF4JHttpClients.newDefaultClient(config);
repo.setHttpClient(client);
Authentication is now handled via the AuthenticationHandler SPI rather than Apache HttpComponents 4
credential stores. Built-in implementations are provided for basic authentication and bearer tokens:
session.setAuthenticationHandler(new BasicAuthenticationHandler("user", "secret"));
session.setAuthenticationHandler(new BearerTokenAuthenticationHandler("my-token"));
session.setAuthenticationHandler(new BearerTokenAuthenticationHandler(tokenStore::currentToken));
To provide a fully custom HTTP backend, implement RDF4JHttpClientFactory and register it as a
java.util.ServiceLoader service in
META-INF/services/org.eclipse.rdf4j.http.client.spi.RDF4JHttpClientFactory. To extend the Apache
HttpComponents 5 backend with additional configuration, subclass ApacheHC5RDF4JHttpClientFactory and
override buildHttpClient(HttpClientBuilder, RDF4JHttpClientConfig).
Eclipse RDF4J™ is a powerful Java framework for processing and handling RDF data. This includes creating, parsing, scalable storage, reasoning and querying with RDF and Linked Data. It offers an easy-to-use API that can be connected to all leading RDF database solutions. It allows you to connect with SPARQL endpoints and create applications that leverage the power of linked data and Semantic Web.