diff options
Diffstat (limited to 'bindings/python')
-rw-r--r-- | bindings/python/serd.pyx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/bindings/python/serd.pyx b/bindings/python/serd.pyx index e2ed0c6c..0ec102c2 100644 --- a/bindings/python/serd.pyx +++ b/bindings/python/serd.pyx @@ -40,6 +40,7 @@ cdef extern from "serd/serd.h": ctypedef enum SerdNodeType: pass ctypedef enum SerdNodeFlag: pass ctypedef enum SerdField: pass + ctypedef enum SerdStatementOrder: pass ctypedef enum SerdModelFlag: pass ctypedef uint32_t SerdStatementFlags @@ -461,7 +462,8 @@ cdef extern from "serd/serd.h": bint serd_model_empty(const SerdModel* model); SerdIter* serd_model_begin(const SerdModel* model); const SerdIter* serd_model_end(const SerdModel* model); - SerdRange* serd_model_all(const SerdModel* model); + SerdRange* serd_model_all(const SerdModel* model, + const SerdStatementOrder order); SerdIter* serd_model_find(const SerdModel* model, const SerdNode* s, @@ -607,6 +609,20 @@ class Field(enum.IntEnum): OBJECT = 2 # Object ("value") GRAPH = 3 # Graph ("context") +class StatementOrder(enum.IntEnum): + """Statement ordering.""" + SPO = 0 # Subject, Predicate, Object + SOP = 1 # Subject, Object, Predicate + OPS = 2 # Object, Predicate, Subject + OSP = 3 # Object, Subject, Predicate + PSO = 4 # Predicate, Subject, Object + POS = 5 # Predicate, Object, Subject + GSPO = 6 # Graph, Subject, Predicate, Object + GSOP = 7 # Graph, Subject, Object, Predicate + GOPS = 8 # Graph, Object, Predicate, Subject + GOSP = 9 # Graph, Object, Subject, Predicate + GPSO = 10 # Graph, Predicate, Subject, Object + GPOS = 11 # Graph, Predicate, Object, Subject class ModelFlags(enum.IntFlag): """Flags that control model storage and indexing.""" @@ -1662,7 +1678,7 @@ cdef class Model: def all(self) -> Range: """Return a range that contains all statements in the model.""" - return Range._manage(serd_model_all(self._ptr)) + return Range._manage(serd_model_all(self._ptr, StatementOrder.SPO)) def _find(self, statement) -> _Iter: statement = Statement._from_param(statement) |