aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/writer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/writer.c b/src/writer.c
index 7e4a1060..aa7fd980 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -1212,7 +1212,12 @@ serd_writer_set_prefix(SerdWriter* const writer,
TRY(st, serd_env_set_prefix(writer->env, name, uri));
if (writer->syntax == SERD_TURTLE || writer->syntax == SERD_TRIG) {
+ const bool had_subject = writer->context.subject.type;
TRY(st, terminate_context(writer));
+ if (had_subject) {
+ TRY(st, esink("\n", 1, writer));
+ }
+
TRY(st, esink("@prefix ", 8, writer));
TRY(st, esink(name->buf, name->n_bytes, writer));
TRY(st, esink(": <", 3, writer));