lakesuperior.model.structures package

Submodules

lakesuperior.model.structures.hash module

C hashing functions used with Cython models.

The hashing algorithm is SpookyHash which produces up to 128-bit (16-byte) digests.

lakesuperior.model.structures.keyset module

class lakesuperior.model.structures.keyset.Keyset

Bases: object

Memory-contiguous array of ``TripleKey``s.

The keys are size_t values that are linked to terms in the triplestore. Therefore, a triplestore lookup is necessary to view or use the terms, but several types of manipulation and filtering can be done very efficiently without looking at the term values.

The set is not checked for duplicates all the time: e.g., when creating from a single set of triples coming from the store, the duplicate check is turned off for efficiency and because the source is guaranteed to provide unique values. When merging with other sets, duplicate checking should be turned on.

Since this class is based on a contiguous block of memory, it is best not to do targeted manipulation. Several operations involve copying the whole data block, so e.g. bulk removal and intersection are much more efficient than individual record operations.