Code Monkey home page Code Monkey logo

Comments (1)

Clueliss avatar Clueliss commented on June 13, 2024

More details about a possible implementation now that I have though about it.

First create an enum CommonLanguageTags or similar.

On rdf:langString creation do roughly the following, if the language tag is a common language tag:

  1. NodeStorage::find_or_make_id(LiteralView{lexical_form, lang_tag})
  2. in the resulting NodeID check if the upper X bits of the LiteralID are unset
    • If yes, store the language tag (= the enum value) as in these X bits and set the inlining tagging bit
    • If no, you are done

On language tag fetching do the following:

  1. if the inlining tagging bit is set look at the upper X bits and index a lookup table that translates the enum value into a string in static memory otherwise do the normal thing

This approach has two interesting properties

  • language tags are effectively stored twice (once in static memory and once in the backend, but that is probably fine and saves some branches elsewhere)
  • rdf:langString is a type that can be partially stored in the backend which is new for rdf4cpp

The remaining question is: How many bits should this use?

  • more bits means more different language tags can be inlined (i.e. the number of variants in CommonLanguageTags increases)
  • the threshhold where language tag inlining is possible decreases (i.e. more than 2^(42-X) literals means no more language tag inlining)

from rdf4cpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.