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

Nepomuk-Core

  • Nepomuk2
  • MainModel
Public Member Functions | List of all members
Nepomuk2::MainModel Class Reference

#include <Nepomuk2/MainModel>

Inherits Model.

Public Member Functions

 MainModel (QObject *parent=0)
 
 ~MainModel ()
 
Soprano::Error::ErrorCode addStatement (const Soprano::Statement &statement)
 
bool containsAnyStatement (const Soprano::Statement &statement) const
 
bool containsStatement (const Soprano::Statement &statement) const
 
Soprano::Node createBlankNode ()
 
void disconnect ()
 
Soprano::QueryResultIterator executeQuery (const QString &query, Soprano::Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
 
bool init ()
 
bool isEmpty () const
 
bool isValid () const
 
Soprano::NodeIterator listContexts () const
 
Soprano::StatementIterator listStatements (const Soprano::Statement &partial) const
 
Soprano::Error::ErrorCode removeAllStatements (const Soprano::Statement &statement)
 
Soprano::Error::ErrorCode removeStatement (const Soprano::Statement &statement)
 
int statementCount () const
 

Detailed Description

The main Nepomuk data storage model.

All user data is stored in the Nepomuk main model. This is a wrapper model which communicates all commands to the Nepomuk server.

Usage is very simple. Just create an instance and start using it. Use the isValid method to check the connection to the server. All communication details are handled transparently.

It is perfectly alright to create several instances of MainModel in one application as internally all is mapped to a single global instance which is also reused in ResourceManager::mainModel.

Provides a set of convenience methods for maintaining resource properties.

It does automatic NRL named graph handling, i.e. provedance data is created and deleted automatically.

Warning
This model assumes that no property value is stored twice, i.e. in two different named graphs.
Author
Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org
Since
4.2
See also
ResourceManager::mainModel()

Definition at line 62 of file nepomukmainmodel.h.

Constructor & Destructor Documentation

Nepomuk2::MainModel::MainModel ( QObject *  parent = 0)

Create a new main model.

Definition at line 125 of file nepomukmainmodel.cpp.

Nepomuk2::MainModel::~MainModel ( )

Destructor.

Definition at line 133 of file nepomukmainmodel.cpp.

Member Function Documentation

Soprano::Error::ErrorCode Nepomuk2::MainModel::addStatement ( const Soprano::Statement &  statement)

Definition at line 234 of file nepomukmainmodel.cpp.

bool Nepomuk2::MainModel::containsAnyStatement ( const Soprano::Statement &  statement) const

Definition at line 210 of file nepomukmainmodel.cpp.

bool Nepomuk2::MainModel::containsStatement ( const Soprano::Statement &  statement) const

Definition at line 202 of file nepomukmainmodel.cpp.

Soprano::Node Nepomuk2::MainModel::createBlankNode ( )

Definition at line 258 of file nepomukmainmodel.cpp.

void Nepomuk2::MainModel::disconnect ( )

This function explicitly marks the connection to soprano as disconnected.

This is necessary because the soprano method isConnected() does not check if the socket is actually connected, merely if it were successfully connected at some point in the past. If the socket has been remote disconnected, we need to mark it as so.

Definition at line 152 of file nepomukmainmodel.cpp.

Soprano::QueryResultIterator Nepomuk2::MainModel::executeQuery ( const QString &  query,
Soprano::Query::QueryLanguage  language,
const QString &  userQueryLanguage = QString() 
) const

Definition at line 182 of file nepomukmainmodel.cpp.

bool Nepomuk2::MainModel::init ( )

Try connecting to the Nepomuk storage service.

There is no need to call this unless one wants to reconnect to a previously non-running system. All methods below do connect automatically but do not retry after a failure.

Definition at line 146 of file nepomukmainmodel.cpp.

bool Nepomuk2::MainModel::isEmpty ( ) const

Definition at line 218 of file nepomukmainmodel.cpp.

bool Nepomuk2::MainModel::isValid ( ) const

Check the connection to the Nepomuk server.

Returns
true if the connection is valid and commands can be issued, false otherwise.

Definition at line 139 of file nepomukmainmodel.cpp.

Soprano::NodeIterator Nepomuk2::MainModel::listContexts ( ) const

Definition at line 168 of file nepomukmainmodel.cpp.

Soprano::StatementIterator Nepomuk2::MainModel::listStatements ( const Soprano::Statement &  partial) const

Definition at line 160 of file nepomukmainmodel.cpp.

Soprano::Error::ErrorCode Nepomuk2::MainModel::removeAllStatements ( const Soprano::Statement &  statement)

Definition at line 250 of file nepomukmainmodel.cpp.

Soprano::Error::ErrorCode Nepomuk2::MainModel::removeStatement ( const Soprano::Statement &  statement)

Definition at line 242 of file nepomukmainmodel.cpp.

int Nepomuk2::MainModel::statementCount ( ) const

Definition at line 226 of file nepomukmainmodel.cpp.


The documentation for this class was generated from the following files:
  • nepomukmainmodel.h
  • nepomukmainmodel.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk-Core

Skip menu "Nepomuk-Core"
  • 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