• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

Nepomuk

The Nepomuk Resource Generator

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.

include(NepomukAddOntologyClasses)

This will provide a macro called NEPOMUK_ADD_ONTOLOGY_CLASSES:

NEPOMUK_ADD_ONTOLOGY_CLASSES(<sources-var>
         [FAST]
         [ONTOLOGIES] <onto-file1> [<onto-file2> ...]
         [CLASSES <classname1> [<classname2> ...]]
         [VISIBILITY <visibility-name>]
       )

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

include(NepomukAddOntologyClasses)

set(SRCS [...])

nepomuk_add_ontology_classes(SRCS ONTOLOGIES ontology.trig)

kde4_add_executable(foobar ${SRCS})
target_link_libraries(foobar
  nepomuk
)

Nepomuk

Skip menu "Nepomuk"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal