aboutsummaryrefslogtreecommitdiffstats
path: root/src/read_turtle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/read_turtle.c')
-rw-r--r--src/read_turtle.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/read_turtle.c b/src/read_turtle.c
index 22269741..8d9ec78a 100644
--- a/src/read_turtle.c
+++ b/src/read_turtle.c
@@ -14,6 +14,7 @@
#include "turtle.h"
#include "serd/caret.h"
+#include "serd/env.h"
#include "serd/node.h"
#include "serd/reader.h"
#include "serd/sink.h"
@@ -891,6 +892,7 @@ read_turtle_base(SerdReader* const reader, const bool sparql, const bool token)
}
serd_node_zero_pad(uri);
+ TRY(st, serd_env_set_base_uri(reader->env, serd_node_string_view(uri)));
TRY(st, serd_sink_write_base(reader->sink, uri));
read_turtle_ws_star(reader);
@@ -934,6 +936,11 @@ read_turtle_prefixID(SerdReader* const reader,
serd_node_zero_pad(name);
serd_node_zero_pad(uri);
+
+ TRY(st,
+ serd_env_set_prefix(
+ reader->env, serd_node_string_view(name), serd_node_string_view(uri)));
+
st = serd_sink_write_prefix(reader->sink, name, uri);
if (!sparql) {