triple.pyx 821 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #from lakesuperior.store.ldp_rs cimport term
  2. #
  3. #cdef int serialize(tuple trp, tpl.tpl_bin *data) except -1:
  4. # """
  5. # Serialize a triple expressed as a tuple of RDFlib terms.
  6. #
  7. # :param tuple trp: 3-tuple of RDFlib terms.
  8. #
  9. # :rtype: Triple
  10. # """
  11. # cdef:
  12. # Triple strp
  13. # Term *s
  14. # Term *p
  15. # Term *o
  16. #
  17. # strp.s = s
  18. # strp.p = p
  19. # strp.o = o
  20. #
  21. ## term.serialize(s)
  22. ## term.serialize(p)
  23. ## term.serialize(o)
  24. #
  25. # return strp
  26. #
  27. #
  28. #cdef tuple deserialize(Triple strp):
  29. # """
  30. # Deserialize a ``Triple`` structure into a tuple of terms.
  31. #
  32. # :rtype: tuple
  33. # """
  34. # pass
  35. ## s = term.deserialize(strp.s.addr, strp.s.sz)
  36. ## p = term.deserialize(strp.p.addr, strp.p.sz)
  37. ## o = term.deserialize(strp.o.addr, strp.o.sz)
  38. ##
  39. ## return s, p, o
  40. #
  41. #