Soprano  2.9.0
Public Member Functions | List of all members
Soprano::NRLModel Class Reference

Model filter that makes working with NRL data simpler. More...

#include <Soprano/NRLModel>

+ Inheritance diagram for Soprano::NRLModel:

Public Member Functions

 NRLModel ()
 
 NRLModel (Model *parent)
 
 ~NRLModel ()
 
void setIgnoreContext (bool b)
 
bool ignoreContext () const
 
void setEnableQueryPrefixExpansion (bool enable)
 
bool queryPrefixExpansionEnabled () const
 
QHash< QString, QUrlqueryPrefixes () const
 
Error::ErrorCode addNrlStatement (const Statement &s)
 
QUrl createGraph (const QUrl &type, QUrl *metadataGraph=0)
 
Error::ErrorCode removeGraph (const QUrl &graph)
 
virtual QueryResultIterator executeQuery (const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
 
virtual Error::ErrorCode removeAllStatements (const Statement &statement)
 
- Public Member Functions inherited from Soprano::FilterModel
virtual ~FilterModel ()
 
virtual void setParentModel (Model *model)
 
virtual ModelparentModel () const
 
virtual Error::ErrorCode addStatement (const Statement &statement)
 
Error::ErrorCode addStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
 
virtual Error::ErrorCode removeStatement (const Statement &statement)
 
Error::ErrorCode removeStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
 
Error::ErrorCode removeAllStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
 
virtual StatementIterator listStatements (const Statement &partial) const
 
StatementIterator listStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
 
virtual NodeIterator listContexts () const
 
virtual bool containsStatement (const Statement &statement) const
 
bool containsStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
 
virtual bool containsAnyStatement (const Statement &statement) const
 
bool containsAnyStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
 
virtual bool isEmpty () const
 
virtual int statementCount () const
 
virtual Error::ErrorCode write (QTextStream &os) const
 
virtual Node createBlankNode ()
 
- Public Member Functions inherited from Soprano::Model
virtual ~Model ()
 
Error::ErrorCode addStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
 
Error::ErrorCode addStatements (const QList< Statement > &statements)
 
Error::ErrorCode removeStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
 
Error::ErrorCode removeAllStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
 
Error::ErrorCode removeStatements (const QList< Statement > &statements)
 
Error::ErrorCode removeContext (const Node &)
 
Error::ErrorCode removeAllStatements ()
 
StatementIterator listStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
 
StatementIterator listStatements () const
 
StatementIterator listStatementsInContext (const Node &context) const
 
bool containsAnyStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
 
bool containsStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
 
bool containsContext (const Node &context) const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent=0)
 
 blockSignals (bool block)
 
 childEvent (QChildEvent *event)
 
 children ()
 
 connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::AutoCompatConnection)
 
 connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type=Qt::AutoCompatConnection)
 
 connectNotify (const char *signal)
 
 customEvent (QEvent *event)
 
 deleteLater ()
 
 destroyed (QObject *obj=0)
 
 disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
 disconnect (const char *signal=0, const QObject *receiver=0, const char *method=0)
 
 disconnect (const QObject *receiver, const char *method=0)
 
 disconnectNotify (const char *signal)
 
 dumpObjectInfo ()
 
 dumpObjectTree ()
 
 dynamicPropertyNames ()
 
 event (QEvent *e)
 
 eventFilter (QObject *watched, QEvent *event)
 
 findChild (const QString &name=QString()
 
 findChildren (const QString &name=QString()
 
 findChildren (const QRegExp &regExp)
 
 inherits (const char *className)
 
 installEventFilter (QObject *filterObj)
 
 isWidgetType ()
 
 killTimer (int id)
 
 metaObject ()
 
 moveToThread (QThread *targetThread)
 
 parent ()
 
 property (const char *name)
 
 receivers (const char *signal)
 
 removeEventFilter (QObject *obj)
 
 sender ()
 
 setParent (QObject *parent)
 
 setProperty (const char *name, const QVariant &value)
 
 signalsBlocked ()
 
 startTimer (int interval)
 
 thread ()
 
 timerEvent (QTimerEvent *event)
 
 tr (const char *sourceText, const char *comment=0, int n=-1)
 
 trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
 staticMetaObject
 
 QObject (QObject *parent, const char *name)
 
 checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
 child (const char *objName, const char *inheritsClass=0, bool recursiveSearch=true)
 
 className ()
 
 insertChild (QObject *object)
 
 isA (const char *className)
 
 name ()
 
 name (const char *defaultName)
 
 normalizeSignalSlot (const char *signalSlot)
 
 removeChild (QObject *object)
 
 setName (const char *name)
 
- Public Member Functions inherited from Soprano::Error::ErrorCache
virtual ~ErrorCache ()
 
virtual Error lastError () const
 

Additional Inherited Members

- Signals inherited from Soprano::Model
void statementsAdded ()
 
void statementsRemoved ()
 
void statementAdded (const Soprano::Statement &statement)
 
void statementRemoved (const Soprano::Statement &statement)
 
- Protected Member Functions inherited from Soprano::FilterModel
 FilterModel ()
 
 FilterModel (Model *parent)
 
virtual void parentStatementsAdded ()
 
virtual void parentStatementsRemoved ()
 
virtual void parentStatementAdded (const Statement &)
 
virtual void parentStatementRemoved (const Statement &)
 

Detailed Description

Model filter that makes working with NRL data simpler.

The NRLModel enforces NRL cardinality rules. That means predicates with a cardinality of maximum 1 are always udpated while statements that define predicates with a maximum cardinality bigger than 1 are rejected once the maximum is reached (future versions might remove an earlier defined statement based on the time the old statements were added).

Thus, at the moment NRLModel is mostly usable for handling properties with a maximum cardinality of 1.

NRLModel also provides automatic query prefix expansion and named graph creation and removal with automatic metadata graph handling.

THE API AND EVEN THE COMPLETE CLASS IS SUBJECT TO CHANGE!

Author
Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org
See Also
Vocabulary::NRL

Definition at line 56 of file nrlmodel.h.

Constructor & Destructor Documentation

Soprano::NRLModel::NRLModel ( )
Soprano::NRLModel::NRLModel ( Model parent)
Soprano::NRLModel::~NRLModel ( )

Member Function Documentation

void Soprano::NRLModel::setIgnoreContext ( bool  b)

When enforcing the NRL cardinality rules NRLModel can either ignore the context of statements or treat different contexts as separate sets, each resetting the cardinality.

Parameters
bIf true (the default) NRLModel does ignore the context when enforcing rules. If false the NRL rules can be violated across contexts.

By default contexts are ignored.

See Also
ignoreContext()
bool Soprano::NRLModel::ignoreContext ( ) const
Returns
true if contexts should be ignored when enforcing NRL rules.
See Also
setIgnoreContext()
void Soprano::NRLModel::setEnableQueryPrefixExpansion ( bool  enable)

Enable automatic query prefix expansion based on nao:hasDefaultNamespaceAbbreviation. This will trigger reading all prefixes stored in the underlying model.

By default query prefix expansion is disabled.

Since
2.4
bool Soprano::NRLModel::queryPrefixExpansionEnabled ( ) const
Returns
true if query prefix expansion is enabled.
Since
2.4
QHash<QString, QUrl> Soprano::NRLModel::queryPrefixes ( ) const

The prefixes that have been read from the underlying model.

Returns
A list of prefixes mapping to the namespaces read from the model. This list is empty if queryPrefixExpansion is disabled.
Since
2.4
Error::ErrorCode Soprano::NRLModel::addNrlStatement ( const Statement s)

Add a statement.

Parameters
sThe statement containing the property to be set. If the predicate has NRL cardinality restrictions existing statements will be updated. Otherwise this method has the same effect as Model::addStatement().

Adding a statement that defines a predicate with a maximum cardinality bigger than 1 which has already been reached fails with an error.

Returns
Error::ErrorNone on success.
QUrl Soprano::NRLModel::createGraph ( const QUrl type,
QUrl metadataGraph = 0 
)

Create a new graph of type type.

This will actually create two graphs: the requested one and its metadata graph which will already contain basic metadata like creation date.

Returns
The URI of the newly created graph.
Since
2.3
Error::ErrorCode Soprano::NRLModel::removeGraph ( const QUrl graph)

Remove a complete graph including its metadata graph

This method can be seen as the counterpart to createGraph

Since
2.3
virtual QueryResultIterator Soprano::NRLModel::executeQuery ( const QString query,
Query::QueryLanguage  language,
const QString userQueryLanguage = QString() 
) const
virtual

If queryPrefixExpansionEnabled is true query prefixes will be expanded before sending the query to the underlying model.

Since
2.4

Reimplemented from Soprano::FilterModel.

virtual Error::ErrorCode Soprano::NRLModel::removeAllStatements ( const Statement statement)
virtual

If the only node defined in statement is the context the graph including its metadata is removed.

See Also
removeGraph
Since
2.4

Reimplemented from Soprano::FilterModel.


The documentation for this class was generated from the following file: