< Projects‎ | Nepomuk
Revision as of 08:53, 23 August 2012 by Vishesh (Talk | contribs)

Jump to: navigation, search

The Nepomuk Resource class is undoubtedly the most user visible and used class. It serves as a very convenient abstraction over the statements.

Nepomuk Resource Generator

While it is fairly convenient to use the setProperty and getProperty methods. It requires you to explicitly define the property which you need modify. This can get quite cumbersome and destroys readability of the code.

In order to improve this situation we have provided a resource generator, which generates custom Resource classes from the ontologies. It relies on a CMake macro to accomplish that.

nepomuk2_add_ontology_classes (SRCS

This will generate a C++ class for each type defined in the mentioned ontologies.

#include "personcontact.h"

Nepomuk2::PersonContact spiderman;
spiderman.setFullName( QLatin1String("Peter Parker") );
QString name = spiderman.fullname();

Content is available under Creative Commons License SA 4.0 unless otherwise noted.