summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-07 00:08:26 +0000
committerDavid Robillard <d@drobilla.net>2012-03-07 00:08:26 +0000
commit2bdd503519c445c5617804376144cb0bdebf9629 (patch)
treed257a0c5d0c27127212d76828d44b054a128b01b /src
parenta91b37a822fe366be5a582953857cb29dead8a36 (diff)
downloadsratom-2bdd503519c445c5617804376144cb0bdebf9629.tar.gz
sratom-2bdd503519c445c5617804376144cb0bdebf9629.tar.bz2
sratom-2bdd503519c445c5617804376144cb0bdebf9629.zip
Serialise the null atom as rdf:nil, i.e. "()" in Turtle.
git-svn-id: http://svn.drobilla.net/lad/trunk/sratom@4027 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/sratom.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sratom.c b/src/sratom.c
index e3238e1..c70eee8 100644
--- a/src/sratom.c
+++ b/src/sratom.c
@@ -168,7 +168,7 @@ sratom_write(Sratom* sratom,
SerdNode language = SERD_NODE_NULL;
bool new_node = false;
if (type_urid == 0 && size == 0) {
- object = serd_node_from_string(SERD_BLANK, USTR("null"));
+ object = serd_node_from_string(SERD_URI, USTR(NS_RDF "nil"));
} else if (type_urid == sratom->forge.String) {
object = serd_node_from_string(SERD_LITERAL, (const uint8_t*)body);
} else if (type_urid == sratom->forge.Literal) {
@@ -485,7 +485,9 @@ read_node(Sratom* sratom,
lv2_atom_forge_string(forge, (const uint8_t*)str, len);
}
} else if (sord_node_get_type(node) == SORD_URI) {
- if (serd_uri_string_has_scheme((const uint8_t*)str)) {
+ if (!strcmp(str, (const char*)NS_RDF "nil")) {
+ lv2_atom_forge_atom(forge, 0, 0);
+ } else if (serd_uri_string_has_scheme((const uint8_t*)str)) {
lv2_atom_forge_urid(forge, map->map(map->handle, str));
} else {
lv2_atom_forge_uri(forge, (const uint8_t*)str, len);