From 23df76c6037cc0719c6b590dd49941815367e3c8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 19 Sep 2007 20:20:49 +0000 Subject: Automatically attempt to qualify qnames when used to create RDF resource nodes. git-svn-id: http://svn.drobilla.net/lad/raul@730 a436a847-0d15-0410-975c-d299462d15a1 --- src/RDFNode.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/RDFNode.cpp b/src/RDFNode.cpp index 4140bcb..be529e7 100644 --- a/src/RDFNode.cpp +++ b/src/RDFNode.cpp @@ -16,6 +16,7 @@ */ #include +#include #include #include @@ -27,14 +28,16 @@ namespace RDF { Node::Node(World& world, Type type, const std::string& s) { - if (type == RESOURCE) - _node = librdf_new_node_from_uri_string(world.world(), (const unsigned char*)s.c_str()); - else if (type == LITERAL) + if (type == RESOURCE) { + const string uri = world.expand_uri(s); + _node = librdf_new_node_from_uri_string(world.world(), (const unsigned char*)uri.c_str()); + } else if (type == LITERAL) { _node = librdf_new_node_from_literal(world.world(), (const unsigned char*)s.c_str(), NULL, 0); - else if (type == BLANK) + } else if (type == BLANK) { _node = librdf_new_node_from_blank_identifier(world.world(), (const unsigned char*)s.c_str()); - else + } else { _node = NULL; + } assert(this->type() == type); } -- cgit v1.2.1