From c0da1cf368b7d43c9c886b81768b4a62a07fae3f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 28 Mar 2015 09:47:19 +0000 Subject: Unify value widgets in properties dialog. This shows the fancy URI selector for URI properties, and can show numeric controls for the property-to-add. The ontologies need some work, along with smarter widget creation, before the latter will actually be useful. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5648 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/RDFS.hpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/gui/RDFS.hpp') diff --git a/src/gui/RDFS.hpp b/src/gui/RDFS.hpp index d9506dbc..52931aaf 100644 --- a/src/gui/RDFS.hpp +++ b/src/gui/RDFS.hpp @@ -19,10 +19,10 @@ #include #include - -#include +#include #include "ingen/types.hpp" +#include "lilv/lilv.h" #include "raul/URI.hpp" namespace Ingen { @@ -38,16 +38,14 @@ namespace RDFS { /** Set of URIs. */ typedef std::set URISet; -/** Map of object labels, keyed by object URI. */ -typedef std::map Objects; +/** Label => Resource map. */ +typedef std::map Objects; /** Return the label of `node`. */ -Glib::ustring -label(World* world, const LilvNode* node); +std::string label(World* world, const LilvNode* node); /** Return the comment of `node`. */ -Glib::ustring -comment(World* world, const LilvNode* node); +std::string comment(World* world, const LilvNode* node); /** Set `types` to its super/sub class closure. * @param super If true, find all superclasses, otherwise all subclasses @@ -55,8 +53,7 @@ comment(World* world, const LilvNode* node); void classes(World* world, URISet& types, bool super); /** Get all instances of any class in `types`. */ -Objects -instances(World* world, const URISet& types); +Objects instances(World* world, const URISet& types); /** Get all the types which `model` is an instance of. */ URISet types(World* world, SPtr model); @@ -64,6 +61,14 @@ URISet types(World* world, SPtr model); /** Get all the properties with domains appropriate for `model`. */ URISet properties(World* world, SPtr model); +/** Return the range (value types) of `prop`. + * @param recursive If true, include all subclasses. + */ +URISet range(World* world, const LilvNode* prop, bool recursive); + +/** Return true iff `inst` is-a `klass`. */ +bool is_a(World* world, const LilvNode* inst, const LilvNode* klass); + } // namespace RDFS } // namespace GUI } // namespace Ingen -- cgit v1.2.1