Module PyKDE4.nepomuk

KDE 4.7 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 the following parts:

- The main resource handling centered around Nepomuk.Resource
- The handling of ontologies via classes in the Nepomuk.Types namespace
- The desktop Nepomuk.Query API
- nepomuk_facets
- Several utility methods and classes

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