aboutsummaryrefslogtreecommitdiffstats
path: root/tools/serd-pipe.c
AgeCommit message (Collapse)AuthorFilesLines
2023-12-02Use ZixStringView directlyDavid Robillard1-2/+2
2023-12-02Add "contextual" output optionDavid Robillard1-1/+1
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 model and serd-sort utilityDavid Robillard1-13/+2
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-02Factor out and rewrite command-line interfaceDavid Robillard1-285/+156
2023-12-02Make blank node prefixing automaticDavid Robillard1-40/+4
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-02Collapse input and output options into single flagsDavid Robillard1-41/+29
2023-12-02[WIP] Add support for converting literals to canonical formDavid Robillard1-8/+17
2023-12-02[WIP] Generalize node construction APIDavid Robillard1-3/+4
2023-12-02Add support for custom allocatorsDavid Robillard1-8/+9
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-02Add command-line option to write output to a fileDavid Robillard1-2/+11
2023-12-02[WIP] Simplify reader and writer flagsDavid Robillard1-1/+1
[WIP] Testing?
2023-12-02[WIP] Move SerdEnv mutation from writer to readerDavid Robillard1-4/+5
Writing having side-effects seems questionable in general, and this prepares things for expanding URIs in the reader.
2023-12-02[WIP] Add extensible logging APIDavid Robillard1-11/+3
2023-12-02[WIP] Add support for reading and writing variablesDavid Robillard1-1/+5
[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-15/+20
This is more powerful, and reduces the number of command line options that almost nobody needs to care about.
2023-12-02Factor out serd_choose_syntax()David Robillard1-5/+2
2023-12-02Factor out opening output filesDavid Robillard1-7/+5
2023-12-02Factor out setting base URI from a pathDavid Robillard1-11/+2
2023-12-02Add support for reading multiple files at onceDavid Robillard1-39/+126
2023-12-02Simplify handling of input string argumentsDavid Robillard1-11/+15
2023-12-02Add base URI command-line optionDavid Robillard1-5/+11
2023-12-02Rename serdi to serd-pipeDavid Robillard1-0/+290