• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • 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
)
This file is part of the KDE documentation.
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.

Nepomuk

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal