aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-03-31 14:20:03 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:07 -0500
commit09bf03fd6e522d6e421fed85d010057f87486544 (patch)
tree837adc1381f0e19e7cbab246be81de5fb6f1bf50 /src/writer.c
parent2f490c80f9623ac2deaeb37a29fc98d01eb20e7e (diff)
downloadserd-09bf03fd6e522d6e421fed85d010057f87486544.tar.gz
serd-09bf03fd6e522d6e421fed85d010057f87486544.tar.bz2
serd-09bf03fd6e522d6e421fed85d010057f87486544.zip
Add empty syntax type for suppressing output
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/writer.c b/src/writer.c
index 5603e9ca..a1d91ff8 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -1003,6 +1003,10 @@ serd_writer_write_statement(SerdWriter* const writer,
assert(!((flags & SERD_ANON_O) && (flags & SERD_LIST_O)));
assert(!((flags & SERD_EMPTY_O) && (flags & SERD_LIST_O)));
+ if (writer->syntax == SERD_SYNTAX_EMPTY) {
+ return SERD_SUCCESS;
+ }
+
SerdStatus st = SERD_SUCCESS;
const SerdNode* const subject = serd_statement_subject(statement);
const SerdNode* const predicate = serd_statement_predicate(statement);
@@ -1149,7 +1153,7 @@ serd_writer_end_anon(SerdWriter* writer, const SerdNode* node)
{
SerdStatus st = SERD_SUCCESS;
- if (writer->syntax == SERD_NTRIPLES || writer->syntax == SERD_NQUADS) {
+ if (writer->syntax != SERD_TURTLE && writer->syntax != SERD_TRIG) {
return SERD_SUCCESS;
}