Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LMDB: Implement extensible ID scheme #4950

Open
kenwenzel opened this issue Apr 12, 2024 · 0 comments
Open

LMDB: Implement extensible ID scheme #4950

kenwenzel opened this issue Apr 12, 2024 · 0 comments
Labels
📶 enhancement issue is a new feature or improvement

Comments

@kenwenzel
Copy link
Contributor

kenwenzel commented Apr 12, 2024

Problem description

The LmdbStore uses 64 bit IDs for values.
The scheme is fixed and uses the lower two bits to encode the type of the referenced value:

  • 00 => URI
  • 01 => Literal
  • 10 => BNode
  • 11 => Namespace string (internal use only)

To support RDF-star #3723 and embedded values #4774 a new scheme that is also extensible for future requirements should be developed.

Preferred solution

The following basic scheme could be used:

  • bit 0..7 => 8 bits for type
  • bit 8..63 => 56 bits for value

Inspired by Jena the following detailled encoding can be used:

  • bit 0..7:

    • 0 => arbitrary pointer
    • 1 => URI
    • 2 => Literal
    • 3 => BNode
    • 4 => Triple
    • ... more not inlined values

    // following inlined values

    • 16 => integer
    • 17 => decimal
    • ...

see also https://github.com/apache/jena/blob/02ecb71c7033dc09cd929474c9884045dfaa9dc1/jena-tdb2/src/main/java/org/apache/jena/tdb2/store/NodeIdType.java#L87

Are you interested in contributing a solution yourself?

Yes

Alternatives you've considered

No response

Anything else?

No response

@kenwenzel kenwenzel added the 📶 enhancement issue is a new feature or improvement label Apr 12, 2024
kenwenzel added a commit to kenwenzel/rdf4j that referenced this issue Apr 15, 2024
Implement an extensible ID scheme for the LmdbStore that
also allows to embed values into IDs.
kenwenzel added a commit to kenwenzel/rdf4j that referenced this issue Apr 15, 2024
Implement an extensible ID scheme for the LmdbStore that
also allows to embed values into IDs.
kenwenzel added a commit to kenwenzel/rdf4j that referenced this issue Apr 17, 2024
Implement an extensible ID scheme for the LmdbStore that
also allows to embed values into IDs.
kenwenzel added a commit to kenwenzel/rdf4j that referenced this issue Apr 18, 2024
Implement an extensible ID scheme for the LmdbStore that
also allows to embed values into IDs.
kenwenzel added a commit to kenwenzel/rdf4j that referenced this issue Apr 22, 2024
Implement an extensible ID scheme for the LmdbStore that
also allows to embed values into IDs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📶 enhancement issue is a new feature or improvement
Projects
None yet
Development

No branches or pull requests

1 participant