Comments (1)
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:
NodeStorage::find_or_make_id(LiteralView{lexical_form, lang_tag})
- in the resulting
NodeID
check if the upperX
bits of theLiteralID
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
- If yes, store the language tag (= the enum value) as in these
On language tag fetching do the following:
- 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)
- Implement serializers for various rdf formats HOT 1
- Improvements for lax parsing mode
- Literal serialization performance improvement: Writer support for `Literal::lexical_form` HOT 1
- Convenience Interfaces to load files for `Dataset` and `Graph` HOT 1
- Clean seperation for `reserved_datatype_ids`
- update dependency: uni-algo
- gcov CI broken
- Remove `noexcepts` to support read-only persistent node storages
- Add `std::formatter` specializations for Node types
- Serialization performance of datetime types
- Decide what to do with the 13 free-tagging-bits inside `NodeBackendID` HOT 1
- Add `Node::deserialize` functions
- Node constructor validation HOT 2
- It is possible to acidentally erase the predefined IRIs from the node storage, which causes bugs. There needs to be a check in the node storage that prevents this
- Batch erase from NodeStorage HOT 1
- Add parse_error type for datatypes
- release 0.0.8.1 or 0.0.28? HOT 6
- Search for and implement an RDF literal datatype for user names HOT 1
- Get rid of `erase_*` functions in `NodeStorage` and `DynNodeStoragePtr` HOT 2
- When C++26 lands utilize parameter pack indexing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rdf4cpp.