diff options
author | David Robillard <d@drobilla.net> | 2021-07-27 19:01:45 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-01-14 19:37:51 -0500 |
commit | 1159aea45d9bc4ade2e82856be403d58e050f32d (patch) | |
tree | 870117b2a0a4b386727107bd85c736a020058309 /include/serd/serd.h | |
parent | 89612ec05f596d135640413e093251fb9691ca14 (diff) | |
download | serd-1159aea45d9bc4ade2e82856be403d58e050f32d.tar.gz serd-1159aea45d9bc4ade2e82856be403d58e050f32d.tar.bz2 serd-1159aea45d9bc4ade2e82856be403d58e050f32d.zip |
Add statement filtering
Diffstat (limited to 'include/serd/serd.h')
-rw-r--r-- | include/serd/serd.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h index fad9d070..5edb4b2f 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -1966,6 +1966,41 @@ serd_canon_new(const SerdWorld* SERD_NULLABLE world, /** @} + @defgroup serd_filter Filter + @{ +*/ + +/** + Return a new sink that filters out statements that do not match a pattern. + + The returned sink acts like `target` in all respects, except that some + statements may be dropped. + + @param target The target sink to pass the filtered data to. + + @param subject The optional subject of the filter pattern. + + @param predicate The optional predicate of the filter pattern. + + @param object The optional object of the filter pattern. + + @param graph The optional graph of the filter pattern. + + @param inclusive If true, then only statements that match the pattern are + passed through. Otherwise, only statements that do *not* match the pattern + are passed through. +*/ +SERD_API +SerdSink* SERD_ALLOCATED +serd_filter_new(const SerdSink* SERD_NONNULL target, + const SerdNode* SERD_NULLABLE subject, + const SerdNode* SERD_NULLABLE predicate, + const SerdNode* SERD_NULLABLE object, + const SerdNode* SERD_NULLABLE graph, + bool inclusive); + +/** + @} @defgroup serd_env Environment @{ */ |