KDE 4.5 PyKDE API Reference

- KDE's Python API

# PyKDE4.nepomuk Module

## The Nepomuk Meta Data Library

Overview | hacking "Using" | examples "Examples" | page_ontology "Desktop Ontologies" | nepomuk-rcgen "Resource Generator"

This is the KDE Meta Data library (not to confuse with KFileMetaData). It consists of three parts: the main resource handling centered around Nepomuk.Resource, the handling of ontologies via classes in the Nepomuk.Types namespace, and the desktop Nepomuk.Query API.

The General Idea

Three types of meta data can be identified:

1. Meta data that is stored with the data itself and is available at all times. This includes id3 tags, the number of pages in a pdf document, or even the size of a file or the subject of an email.
2. Meta data that is created by the user manually like annotations or tags that are assigned to files, emails, or whatever resources.
3. Meta data that can be gathered automatically by applications such as the source of a downloaded file or the email an attachment was saved from or the original when copying a file locally.

Type 1 is already handled in many implementations. KDE itself includes the KMetaFileInfo classes that allow extracting this kind of meta information from files and the Strigi system even creates a searchable index of this information.

Nepomuk is intended for meta data of type 2 and 3. It provides an easy way to create and read meta data for arbitrary resources (this includes for example files or emails, but also contacts or maybe even a paragraph in a pdf file).

The simplest type of meta data that can be handled with Nepomuk is a comment. It is a simple string associated with a resource (a file for example). This comment is created by the user using an application that is based on Nepomuk.

Nepomuk's core is designed to allow arbitrary types of meta data, i.e. any resource can be related with any other resource or value by simply naming the relation and providing the value. The power of Nepomuk, however, lies in that it provides a class for each type of resource. Each of these classes provide convenience methods to allow a simple handling of the meta data. These classes are automatically generated from a description of types and properties, i.e. an ontology (see page_ontology).

Nepomuk is resource based. Thus, working with Nepomuk is always done with instances representing a certain resource. This resource has a list of properties. Properties are named and have a certain type. The type can either be another resource (compare a file that was an attachment from an email) or a literal (this means for example a string, or an integer; the comment mentioned earlier would be a string literal). Each property can either have a cardinality of 1 (again a file can only be saved from one email) or greater than 1 (i.e. infinite, like one file can have arbitrary many associated comments). See hacking on how Nepomuk handles literals and cardinalities greater than 1.

Further Reading

- page_ontology - hacking - examples - nepomuk-rcgen - The Nepomuk techbase tutorials

Author(s):
  Sebastian Trueg <trueg@kde.org>

Maintainer(s):
  Sebastian Trueg <trueg@kde.org>

License(s):
  LGPLv2

## Namespaces

G | N |
global | Nepomuk |

## Class Index

A | NegationTerm (Nepomuk.Query) | ResourceTerm (Nepomuk.Query)
AndTerm (Nepomuk.Query) | O | ResourceTypeTerm (Nepomuk.Query)
C | Ontology (Nepomuk.Types) | Result (Nepomuk.Query)
Class (Nepomuk.Types) | OptionalTerm (Nepomuk.Query) | S
ComparisonTerm (Nepomuk.Query) | OrTerm (Nepomuk.Query) | Service (Nepomuk)
E | P | SimpleTerm (Nepomuk.Query)
Entity (Nepomuk.Types) | Property (Nepomuk.Types) | T
F | Q | Tag (Nepomuk)
FileQuery (Nepomuk.Query) | Query (Nepomuk.Query) | TagCloud (Nepomuk)
G | QueryParser (Nepomuk.Query) | KTagCloudWidget
GroupTerm (Nepomuk.Query) | QueryServiceClient (Nepomuk.Query) | KTagDisplayWidget
L | R | TagWidget (Nepomuk)
Literal (Nepomuk.Types) | KRatingPainter | Term (Nepomuk.Query)
LiteralTerm (Nepomuk.Query) | KRatingWidget | Thing (Nepomuk)
M | RequestProperty (Nepomuk.Query.Query) | V
MassUpdateJob (Nepomuk) | Resource (Nepomuk) | Variant (Nepomuk)
N | ResourceManager (Nepomuk) |