aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/env.c2
-rw-r--r--src/reader.c2
-rw-r--r--src/writer.c13
3 files changed, 10 insertions, 7 deletions
diff --git a/src/env.c b/src/env.c
index 797e947a..bea38a6d 100644
--- a/src/env.c
+++ b/src/env.c
@@ -62,7 +62,7 @@ serd_env_free(SerdEnv* const env)
}
const SerdNode*
-serd_env_get_base_uri(const SerdEnv* const env, SerdURIView* const out)
+serd_env_base_uri(const SerdEnv* const env, SerdURIView* const out)
{
if (out) {
*out = env->base_uri;
diff --git a/src/reader.c b/src/reader.c
index b2fc0038..cc30c86e 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -254,7 +254,7 @@ serd_reader_free(SerdReader* const reader)
}
void*
-serd_reader_get_handle(const SerdReader* const reader)
+serd_reader_handle(const SerdReader* const reader)
{
return reader->handle;
}
diff --git a/src/writer.c b/src/writer.c
index 9e345470..579c7f3e 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -576,6 +576,10 @@ write_uri_node(SerdWriter* const writer,
return sink("a", 1, writer) == 1;
}
+ if (!strcmp(node->buf, NS_RDF "nil")) {
+ return sink("()", 2, writer) == 2;
+ }
+
if (has_scheme && (writer->flags & SERD_WRITE_CURIED) &&
serd_env_qualify(writer->env, node, &prefix, &suffix) &&
is_name(prefix.buf, prefix.n_bytes) &&
@@ -588,7 +592,7 @@ write_uri_node(SerdWriter* const writer,
}
if (!has_scheme && !supports_uriref(writer) &&
- !serd_env_get_base_uri(writer->env, NULL)->buf) {
+ !serd_env_base_uri(writer->env, NULL)->buf) {
w_err(writer,
SERD_ERR_BAD_ARG,
"syntax does not support URI reference <%s>\n",
@@ -601,7 +605,7 @@ write_uri_node(SerdWriter* const writer,
SerdURIView in_base_uri;
SerdURIView uri;
SerdURIView abs_uri;
- serd_env_get_base_uri(writer->env, &in_base_uri);
+ serd_env_base_uri(writer->env, &in_base_uri);
serd_uri_parse(node->buf, &uri);
serd_uri_resolve(&uri, &in_base_uri, &abs_uri);
bool rooted = uri_is_under(&writer->base_uri, &writer->root_uri);
@@ -989,7 +993,7 @@ SerdStatus
serd_writer_set_base_uri(SerdWriter* writer, const SerdNode* uri)
{
if (!serd_env_set_base_uri(writer->env, uri)) {
- serd_env_get_base_uri(writer->env, &writer->base_uri);
+ serd_env_base_uri(writer->env, &writer->base_uri);
if (writer->syntax == SERD_TURTLE || writer->syntax == SERD_TRIG) {
if (writer->context.graph.type || writer->context.subject.type) {
@@ -1003,7 +1007,6 @@ serd_writer_set_base_uri(SerdWriter* writer, const SerdNode* uri)
writer->indent = 0;
return reset_context(writer, true);
}
-
return SERD_ERR_UNKNOWN;
}
@@ -1063,7 +1066,7 @@ serd_writer_free(SerdWriter* writer)
}
SerdEnv*
-serd_writer_get_env(SerdWriter* writer)
+serd_writer_env(SerdWriter* writer)
{
return writer->env;
}