-
Notifications
You must be signed in to change notification settings - Fork 175
Description
Current Behavior
When using a remote transaction in RDF4J and adding RDF data (e.g., Turtle) that requires a base URI, the base URI is serialized with angle brackets around it — for example:
<http://example.com/>
instead of the expected:
http://example.com/
On the remote end, the base URI is expected without <
and >
. This mismatch leads to invalid IRIs being constructed. If the data contains:
<foo> a <bar> .
The remote endpoint interprets <http://example.com/>
literally, leading to corrupted IRIs:
<%3Chttp://example.com/foo> a <%3Chttp://example.com/bar> .
Expected Behavior
The base URI should be sent without <
and >
delimiters so the remote endpoint interprets it correctly and the created IRIs look like http://example.com/foo
.
NOTE: I'm not sure what the protocol agreement is in this case but it should be the same on both client and server. Either both should use <
and >
or both should not use it.
Steps To Reproduce
- Use RDF4J to open a remote transaction.
- Add Turtle data with relative IRIs and provide the base URI externally.
- Observe the serialized request payload — the base URI includes
<
and>
delimiters. - On the remote server, inspect the created IRIs — they have
%3C
prepended (<
but URL-encoded).
Code:
var repository = new HTTPRepository("http://localhost:8080/repositories/test");
try (var conn = repository.getConnection()) {
conn.begin();
conn.add(new StringReader( "<foo> a <bar> ."),
"http://example.com/",
RDFFormat.TURTLE);
conn.commit();
try (var statements = conn.getStatements(null, null, null, false)) {
Rio.write(statements, System.out, RDFFormat.TURTLE);
}
}
Version
5.1.4
Are you interested in contributing a solution yourself?
None
Anything else?
No response