lmdb_triplestore.pxd 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. Key, DoubleKey, TripleKey, Buffer
  6. )
  7. from lakesuperior.model.graph.graph cimport Graph
  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. cdef:
  26. void _index_triple(self, int op, TripleKey spok) except *
  27. Graph triple_keys(self, tuple triple_pattern, str context=*, str uri=*)
  28. void _all_term_keys(self, term_type, cc.HashSet** tkeys) except *
  29. void lookup_term(self, const Key* tk, Buffer* data) except *
  30. Graph _lookup(self, tuple triple_pattern)
  31. Graph _lookup_1bound(self, unsigned char idx, Key luk)
  32. Graph _lookup_2bound(
  33. self, unsigned char idx1, unsigned char idx2, DoubleKey tks
  34. )
  35. object from_key(self, const Key tk)
  36. Key to_key(self, term) except -1
  37. void all_contexts(self, Key** ctx, size_t* sz, triple=*) except *
  38. Key _append(
  39. self, Buffer *value,
  40. unsigned char *dblabel=*, lmdb.MDB_txn *txn=*,
  41. unsigned int flags=*)