lmdb_triplestore.pxd 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. cimport lakesuperior.cy_include.collections as cc
  2. cimport lakesuperior.cy_include.cylmdb as lmdb
  3. cimport lakesuperior.cy_include.cytpl as tpl
  4. from lakesuperior.model.base cimport (
  5. KeyIdx, Key, DoubleKey, TripleKey, Buffer
  6. )
  7. from lakesuperior.model.graph.graph cimport SimpleGraph
  8. from lakesuperior.model.structures.keyset cimport Keyset
  9. from lakesuperior.store.base_lmdb_store cimport BaseLmdbStore
  10. cdef:
  11. enum:
  12. IDX_OP_ADD = 1
  13. IDX_OP_REMOVE = -1
  14. unsigned char lookup_rank[3]
  15. unsigned char lookup_ordering[3][3]
  16. unsigned char lookup_ordering_2bound[3][3]
  17. cdef class LmdbTriplestore(BaseLmdbStore):
  18. cpdef dict stats(self)
  19. cpdef size_t _len(self, context=*) except -1
  20. cpdef add(self, triple, context=*, quoted=*)
  21. cpdef add_graph(self, graph)
  22. cpdef void _remove(self, tuple triple_pattern, context=*) except *
  23. cpdef void _remove_graph(self, object gr_uri) except *
  24. cpdef tuple all_namespaces(self)
  25. cpdef SimpleGraph graph_lookup(
  26. self, triple_pattern, context=*, uri=*, copy=*
  27. )
  28. cdef:
  29. void _add_graph(self, Buffer* pk_gr) except *
  30. void _index_triple(self, int op, TripleKey spok) except *
  31. Keyset triple_keys(self, tuple triple_pattern, context=*)
  32. void _all_term_keys(self, term_type, cc.HashSet** tkeys) except *
  33. void lookup_term(self, const Key tk, Buffer* data) except *
  34. Keyset _lookup(self, tuple triple_pattern)
  35. Keyset _lookup_1bound(self, unsigned char idx, Key luk)
  36. Keyset _lookup_2bound(
  37. self, unsigned char idx1, term1, unsigned char idx2, term2)
  38. object from_key(self, const Key tk)
  39. KeyIdx _to_key_idx(self, term)
  40. void all_contexts(self, KeyIdx** ctx, size_t* sz, triple=*) except *
  41. KeyIdx _append(
  42. self, Buffer *value,
  43. unsigned char *dblabel=*, lmdb.MDB_txn *txn=*,
  44. unsigned int flags=*)
  45. #KeyIdx bytes_to_idx(self, const unsigned char* bs)
  46. #unsigned char* idx_to_bytes(KeyIdx idx)