aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/world.c')
-rw-r--r--src/world.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/world.c b/src/world.c
index 4230448a..0887cfe1 100644
--- a/src/world.c
+++ b/src/world.c
@@ -19,6 +19,7 @@
#include "caret.h"
#include "node.h"
#include "serd_config.h"
+#include "serd_internal.h"
#include "system.h"
#if defined(USE_POSIX_FADVISE)
@@ -90,8 +91,26 @@ SerdWorld*
serd_world_new(void)
{
SerdWorld* world = (SerdWorld*)calloc(1, sizeof(SerdWorld));
+ SerdNodes* nodes = serd_nodes_new();
+
+ const SerdStringView rdf_first = SERD_STRING(NS_RDF "first");
+ const SerdStringView rdf_nil = SERD_STRING(NS_RDF "nil");
+ const SerdStringView rdf_rest = SERD_STRING(NS_RDF "rest");
+ const SerdStringView rdf_type = SERD_STRING(NS_RDF "type");
+ const SerdStringView xsd_boolean = SERD_STRING(NS_XSD "boolean");
+ const SerdStringView xsd_decimal = SERD_STRING(NS_XSD "decimal");
+ const SerdStringView xsd_integer = SERD_STRING(NS_XSD "integer");
+
+ world->rdf_first = serd_nodes_uri(nodes, rdf_first);
+ world->rdf_nil = serd_nodes_uri(nodes, rdf_nil);
+ world->rdf_rest = serd_nodes_uri(nodes, rdf_rest);
+ world->rdf_type = serd_nodes_uri(nodes, rdf_type);
+ world->xsd_boolean = serd_nodes_uri(nodes, xsd_boolean);
+ world->xsd_decimal = serd_nodes_uri(nodes, xsd_decimal);
+ world->xsd_integer = serd_nodes_uri(nodes, xsd_integer);
world->blank_node = serd_new_blank(SERD_STRING("b00000000000"));
+ world->nodes = nodes;
return world;
}
@@ -101,10 +120,17 @@ serd_world_free(SerdWorld* const world)
{
if (world) {
serd_node_free(world->blank_node);
+ serd_nodes_free(world->nodes);
free(world);
}
}
+SerdNodes*
+serd_world_nodes(SerdWorld* const world)
+{
+ return world->nodes;
+}
+
const SerdNode*
serd_world_get_blank(SerdWorld* const world)
{