From 0c347c9701af4595a68bb37eb7c69b5db2d452f8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 18 Dec 2019 19:16:14 -0500 Subject: WIP: Add statement filtering --- include/serd/serd.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/serd/serd.h b/include/serd/serd.h index 8eb5470d..68dec4f3 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -1486,6 +1486,22 @@ serd_canon_new(const SerdWorld* SERD_NULLABLE world, const SerdSink* SERD_NONNULL target, SerdReaderFlags flags); +/** + Return a sink that filters out statements that do not match a pattern. + + The returned sink acts like `target` in all respects, except statements that + do not match the pattern are dropped. Only statements where each node is + either equivalent to the corresponding pattern node, or the pattern node is + null, will be passed through to the target sink. +*/ +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); + /** @} @defgroup serd_reader Reader -- cgit v1.2.1