Nepomuk
Overview | Using | Examples | Desktop Ontologies | Resource Generator
The power of Nepomuk lies in the generated classes which allows the application developer to set and retrieve metadata according to standards without knowing any specific RDF URIs or names of properties. The idea is that the resource generator (which is installed along with the Nepomuk libraries) creates Resource subclasses that provide wrapper methods for Resource::getProperty and Resource::setProperty from ontology descriptions.
Usage through CMake
The simplest way to use the resource generator is through CMake. Nepomuk provides a macro to automatically add the class generation target. The macro is used similar to the macro for adding ui files.
This will provide a macro called NEPOMUK_ADD_ONTOLOGY_CLASSES:
If FAST is specified the rcgen parameter –fast will be used which results in resource classes not based on Nepomuk::Resource but on a custom class which does not perform any checks and simply writes the data to Nepomuk (hence the name fast).
The optional CLASSES parameter allows to specify the classes to be generated (RDF class names) in case one does not want all classes in the ontologies to be generated. If omitted all classes in the ontology files will be generated.
The optional VISIBILITY parameter can only be used in non-fast mode and allows to set the gcc visibility to make the generated classes usable in a publically exported API. The <visibility-name> is used to create the name of the export macro and the export include file. Thus, when using "VISIBILITY foobar" include file "foobar_export.h" needs to define FOOBAR_EXPORT.
Example
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.