lmdb_triplestore.pxd 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. cimport lakesuperior.cy_include.collections as cc
  2. cimport lakesuperior.cy_include.cylmdb as lmdb
  3. from lakesuperior.model.base cimport Key, DoubleKey, TripleKey, Buffer
  4. from lakesuperior.model.rdf.graph cimport Graph
  5. from lakesuperior.model.structures.keyset cimport Keyset
  6. from lakesuperior.store.base_lmdb_store cimport DbLabel, BaseLmdbStore
  7. cdef:
  8. enum:
  9. IDX_OP_ADD = 1
  10. IDX_OP_REMOVE = -1
  11. unsigned char lookup_rank[3]
  12. unsigned char lookup_ordering[3][3]
  13. unsigned char lookup_ordering_2bound[3][3]
  14. char lookup_indices[6][8] # Can't use DbLabel[6] here...
  15. cdef class LmdbTriplestore(BaseLmdbStore):
  16. cpdef dict stats(self)
  17. cpdef size_t _len(self, context=*) except -1
  18. cpdef void add(self, triple, context=*, quoted=*) except *
  19. cpdef void add_graph(self, graph) except *
  20. cpdef void _remove(self, tuple triple_pattern, context=*) except *
  21. cpdef void _remove_graph(self, object gr_uri) except *
  22. cpdef tuple all_namespaces(self)
  23. cpdef Graph triple_keys(self, tuple triple_pattern, context=*, uri=*)
  24. cdef:
  25. void _index_triple(self, int op, TripleKey spok) except *
  26. void _all_term_keys(self, term_type, cc.HashSet** tkeys) except *
  27. void lookup_term(self, const Key tk, Buffer* data) except *
  28. Graph _lookup(self, tuple triple_pattern)
  29. Graph _lookup_1bound(self, unsigned char idx, Key luk)
  30. Graph _lookup_2bound(
  31. self, unsigned char idx1, unsigned char idx2, DoubleKey tks
  32. )
  33. object from_key(self, const Key tk)
  34. Key to_key(self, term) except? 0
  35. void all_contexts(self, Key** ctx, size_t* sz, triple=*) except *
  36. Key _append(
  37. self, Buffer *value,
  38. DbLabel dblabel=*, lmdb.MDB_txn *txn=*,
  39. unsigned int flags=*) except? 0