From 80fb6d0ff7c093466ac70b38be5676b868516c08 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 14 Oct 2019 23:26:41 +0200 Subject: Add support for basic literal normalisation --- serd/serd.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'serd') diff --git a/serd/serd.h b/serd/serd.h index d57dc00c..2574a592 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -658,6 +658,11 @@ SERD_API SerdNode* serd_new_resolved_uri(const char* str, const SerdNode* base); +/// Return a normalised version of `node` if possible, NULL otherwise +SERD_API +SerdNode* +serd_node_normalise(const SerdEnv* env, const SerdNode* node); + /** Resolve `node` against `base` @@ -1211,6 +1216,22 @@ SERD_API SerdStatus serd_sink_write_end(const SerdSink* sink, const SerdNode* node); +/** + @} + @name Stream Processing + @{ +*/ + +/** + Return a sink that normalises literal nodes in statements where possible. + + The returned sink acts like `target` in all respects, except literal nodes + in statements may be modified from the original. +*/ +SERD_API +SerdSink* +serd_normaliser_new(const SerdSink* target, const SerdEnv* env); + /** @} @name Reader -- cgit v1.2.1