aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2023-12-02Use ZixAllocator directlyDavid Robillard29-305/+189
2023-12-02Use ZixStringView directlyDavid Robillard13-135/+135
2023-12-02Use SerdNodes instead of manual memory management in testsDavid Robillard1-0/+42
2023-12-02Add "contextual" output optionDavid Robillard1-0/+4
This is mainly for developer or power-user cases, where one wants to look at some data for investigation or debugging. In such cases, it's common for the set of prefixes to be implicitly known (because they are baked in to the application, for example), so printing them just produces a large amount of redundant noise. That said, it can also be useful programmatically, because it allows several snippets to be written independently and ultimately concatenated (with a header to define the prefixes) without redundancy.
2023-12-02Add SERD_READ_ORDERED to preserve blank node ordering in modelsDavid Robillard1-5/+11
2023-12-02Add model and serd-sort utilityDavid Robillard10-1/+1793
With all the new functionality, the complexity of the serd-pipe command-line interface is starting to push the limits of available flags. So, instead of grafting on further options to control a model, this commit adds a new tool, serd-sort, which acts somewhat like a stripped-down serd-pipe that stores statements in a model in memory. This keeps the complexity (including the user-facing complexity) of any one tool down, since other more focused tools can be used for streaming tasks in a pipeline. In other words, abandon Swissarmyknifeism, take a page from the Unix philosophy, and try to expose the model functionality to the command-line in a dedicated focused tool. The model implementation is tested by using this tool to run a subset of the usual test suites, and a special suite to test statement sorting.
2023-12-02Add statement filter sink and serd-filter toolDavid Robillard2-0/+129
2023-12-02Add "longhand" mode to write rdf:type predicates normallyDavid Robillard1-1/+1
2023-12-02Add serd_node_from_syntax() and serd_node_to_syntax()David Robillard3-0/+206
2023-12-02Use SerdNodes in Env implementationDavid Robillard1-75/+80
2023-12-02Avoid dynamic allocation of world blank nodeDavid Robillard2-12/+15
2023-12-02Reuse the same rdf:type node for all "a" abbreviationsDavid Robillard3-3/+5
This reduces the stack space requirements for every type statement, at the cost of adding a bit of constant bloat for the node in documents that do not contain it.
2023-12-02Cache commonly used nodes in the worldDavid Robillard3-22/+61
2023-12-02Add SerdNodes for storing a cache of interned nodesDavid Robillard4-1/+603
2023-12-02Make blank node prefixing automaticDavid Robillard5-62/+23
Though potentially useful, I don't think the complexity cost of the old interface (both to the implementation and to the user) is worth it. A special tool to transform blank node labels (for example with regular expressions) would be a better approach to this if it's ever needed in the future.
2023-12-02Split SERD_READ_VERBATIM into two more precise flagsDavid Robillard1-1/+1
Although the "verbatim" idea is nice and simple, more fine-grained control is necessary since these features (relative URI preservation and blank node label clash avoidance) are useful in different situations.
2023-12-02Add a reader flag to disable generated blank label avoidanceDavid Robillard1-10/+5
2023-12-02Expose serd_strncasecmp in public APIDavid Robillard5-17/+21
2023-12-02[WIP] Add support for converting literals to canonical formDavid Robillard2-4/+224
2023-12-02[WIP] Generalize node construction APIDavid Robillard10-461/+788
2023-12-02Add support for custom allocatorsDavid Robillard24-320/+611
This makes it explicit in the API where memory is allocated, and allows the user to provide a custom allocator to avoid the use of the default system allocator for whatever reason.
2023-12-02[WIP] Simplify reader and writer flagsDavid Robillard3-6/+7
[WIP] Testing?
2023-12-02[WIP] Remove serd_new_resolved_uri()David Robillard3-63/+12
2023-12-02[WIP] Remove SERD_CURIE node datatype entirelyDavid Robillard6-127/+58
2023-12-02[WIP] Expand URIs in readerDavid Robillard6-24/+147
This expands relative and prefixed URIs in the reader on the stack, rather than passing them to the caller to be dealt with. This pushes these context-full forms to the edge of the system as much as possible to minimise the headaches they can cause. Towards having stricter guarantees about nodes and eliminating the CURIE node type altogether.
2023-12-02[WIP] Move SerdEnv mutation from writer to readerDavid Robillard4-13/+20
Writing having side-effects seems questionable in general, and this prepares things for expanding URIs in the reader.
2023-12-02[WIP] Preserve long or short quoting from input documentsDavid Robillard7-154/+87
2023-12-02Leave statement caret at the start of literalsDavid Robillard3-5/+24
This allows a precise location to be reported for errors within literals, by adding the offset of the error in the literal to the caret. This will be used to report nice errors for things like regular expressions and supported XSD datatypes.
2023-12-02[WIP] Add extensible logging APIDavid Robillard9-96/+392
2023-12-02[WIP] Preserve anonymous graph syntax in TriGDavid Robillard2-1/+3
[WIP] Untested
2023-12-02[WIP] Add support for reading and writing variablesDavid Robillard7-4/+86
[WIP] Command line option, move later? This adds a reader flag and serdi option for extending a syntax with support for SPARQL-like variables, for storing things like patterns or simple queries.
2023-12-02[TESTED] Replace -b and -e options with a block size optionDavid Robillard1-17/+0
This is more powerful, and reduces the number of command line options that almost nobody needs to care about.
2023-12-02Move serdi to tools subdirectoryDavid Robillard4-343/+0
This separates the command-line tool code from the library implementation.
2023-12-02Factor out command line version printingDavid Robillard3-19/+24
2023-12-02Factor out Windows UTF-8 console setup codeDavid Robillard3-12/+33
2023-12-02Remove datatype arguments from integer and base64 constructorsDavid Robillard1-9/+11
2023-12-02Simplify output stream APIDavid Robillard7-107/+241
2023-12-02Simplify input stream APIDavid Robillard12-229/+272
2023-12-02Rename SerdErrorFunc to SerdLogFuncDavid Robillard3-9/+9
2023-12-02Reduce complexity of URI parsing codeDavid Robillard2-101/+97
2023-12-02Make serd_writer_set_root_uri() take a string viewDavid Robillard2-6/+4
This is generally more convenient, and the node was just being copied anyway.
2023-12-02Make SerdBuffer an output streamDavid Robillard4-34/+47
2023-12-02Factor out and expose serd_write_file_uri()David Robillard2-82/+89
2023-12-02Strengthen handling of corrupt UTF-8 inputDavid Robillard3-15/+24
2023-12-02Improve URI read performanceDavid Robillard1-15/+12
2023-12-02Use tighter types for UTF-8David Robillard3-17/+19
2023-12-02Support writing all escapes in Turtle and TriG prefixed namesDavid Robillard3-74/+74
2023-12-02Simplify reading code with TRY_LAX macroDavid Robillard1-14/+14
2023-12-02Separate Turtle and TriG reading codeDavid Robillard6-150/+400
2023-12-02Reduce complexity of Turtle and TriG block reading functionsDavid Robillard1-87/+108