From a1b677851274b7e5295962658e723cab007f9b85 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 5 Apr 2023 08:58:15 -0400 Subject: Add SERD_READ_ORDERED to preserve blank node ordering in models --- include/serd/reader.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/serd/reader.h') diff --git a/include/serd/reader.h b/include/serd/reader.h index a2bde202..78b51d00 100644 --- a/include/serd/reader.h +++ b/include/serd/reader.h @@ -91,6 +91,16 @@ typedef enum { the input document. */ SERD_READ_GENERATED = 1U << 4U, + + /** + Generate blank node labels with suffixes left-padded with zeros. + + This is useful because it makes generated blank node IDs like + "_:b0000000123" match the numerical order when compared as strings (or as + nodes). In particular, this can be used to preserve blank node ordering + from documents when the statements are sorted, such as in a model. + */ + SERD_READ_ORDERED = 1U << 5U, } SerdReaderFlag; /// Bitwise OR of SerdReaderFlag values -- cgit v1.2.1