Elektrine lite

← Feed

@ocratato@discuss.systems

Post #2153652

2026-04-20 03:57 UTC

Anonymous Nodes for SASSY The anonymous nodes will be resource nodes that use a URI with a fragment that is a generated id. The generated ids in the RDF Redland C library use time and PID as their basis, with a local sequence number for each id generated in the session. This might have collisions in a distributed system - unlikely, but not quite unlikely enough. Something based on a UUID would be better. The UUID library generates a 128 bit random number in 16 bytes. This string is not URI friendly. A URI fragment can have alpha and numeric characters and a very small set of other characters. Only two are necessary if we use base64 encoding - underscore and hyphen would seem to be the best choices. To avoid soaking up all the randomness only one UUID needs to be created for each session. Subsequent requests can have a sequence number added. A decimal point, separating the UUID part from the sequence number, can make the values a bit more readable. We now have a representation for the anonymous nodes. Next is to write the generator.... #SASSY #RDF #programming

Replies (1)

  • @ocratato@discuss.systems 2026-04-29 05:34

    Anonymous Nodes for SASSY The anonymous nodes have now been implemented and tested. The core part was doing a Base64 encoding of the 16 byte UUID. There are many implementations of this floating about, so, obviously I had to invent my own. The thought was that there isn't any functions in standard libraries that can copy a single bit from one object to another. Time there was. Two alternative designs were examined. One uses a mask to select the bit and another to set it in the destination. The other shifts the bits from and to the desired position. The latter requires no branches, so I thought it might be quicker, but it was actually about 10% slower. The end result was a little slower than other solutions for Base64 encoding that process multiple bits at once. However, I do think this version is a lot clearer about what is being done. Now I just have to examine each of the 100 or so places that use blank nodes and see what changes to make. #SASSY #RDF #programming

    Open ##2585527