Skip to content

Commit 3ca8e03

Browse files
committed
GH-4950 LMDB: Fix encoding of plain literals without datatypes.
1 parent 1eb147a commit 3ca8e03

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/ValueStore.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,7 +1789,7 @@ private byte[] literal2legacy(Literal literal) throws IOException {
17891789
private byte[] literal2data(String label, Optional<String> lang, IRI dt, boolean create)
17901790
throws IOException {
17911791
// Get datatype ID
1792-
long datatypeID = LmdbValue.UNKNOWN_ID;
1792+
long datatypeID = 0L;
17931793

17941794
if (dt != null) {
17951795
datatypeID = getId(dt, create);
@@ -1877,7 +1877,8 @@ private LmdbLiteral data2literal(long id, byte[] data, LmdbLiteral value) throws
18771877
// Get datatype
18781878
long datatypeID = Varint.readUnsignedHeap(bb);
18791879
IRI datatype = null;
1880-
if (datatypeID != LmdbValue.UNKNOWN_ID) {
1880+
// literal without a datatype
1881+
if (datatypeID > 0) {
18811882
datatype = (IRI) getValue(datatypeID);
18821883
}
18831884

0 commit comments

Comments
 (0)