From f4d8b438532b3c090094b4060d6e0a2b2fba9d4d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 28 Mar 2015 01:35:27 +0000 Subject: Improve properties window. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5646 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/RDFS.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/gui/RDFS.cpp') diff --git a/src/gui/RDFS.cpp b/src/gui/RDFS.cpp index 671ef69e..a24ae002 100644 --- a/src/gui/RDFS.cpp +++ b/src/gui/RDFS.cpp @@ -41,6 +41,22 @@ label(World* world, const LilvNode* node) return label; } +Glib::ustring +comment(World* world, const LilvNode* node) +{ + LilvNode* rdfs_comment = lilv_new_uri( + world->lilv_world(), LILV_NS_RDFS "comment"); + LilvNodes* comments = lilv_world_find_nodes( + world->lilv_world(), node, rdfs_comment, NULL); + + const LilvNode* first = lilv_nodes_get_first(comments); + Glib::ustring comment = first ? lilv_node_as_string(first) : ""; + + lilv_nodes_free(comments); + lilv_node_free(rdfs_comment); + return comment; +} + void classes(World* world, URISet& types, bool super) { @@ -158,8 +174,11 @@ instances(World* world, const URISet& types) LilvNodes* objects = lilv_world_find_nodes( world->lilv_world(), NULL, rdf_type, type); LILV_FOREACH(nodes, o, objects) { - const LilvNode* object = lilv_nodes_get(objects, o); - const Glib::ustring label = RDFS::label(world, object); + const LilvNode* object = lilv_nodes_get(objects, o); + if (!lilv_node_is_uri(object)) { + continue; + } + const Glib::ustring label = RDFS::label(world, object); result.insert( std::make_pair( Raul::URI(lilv_node_as_string(object)), -- cgit v1.2.1