Soprano 2.9.4
Soprano::RdfSchemaModel Class Reference

Provides convenience methods to handle RDFS data. More...

#include <Soprano/RdfSchemaModel>

Inheritance diagram for Soprano::RdfSchemaModel:

Public Member Functions

 RdfSchemaModel (Model *parentModel=0)
 ~RdfSchemaModel ()
StatementIterator classes () const
StatementIterator directSubClassOf (const Node &subClass, const Node &superClass=Node()) const
StatementIterator directSubPropertyOf (const Node &subProperty, const Node &superProperty=Node()) const
StatementIterator directType (const Node &someClass, const Node &someType) const
StatementIterator domain (const Node &prop, const Node &domain) const
StatementIterator properties () const
StatementIterator range (const Node &prop, const Node &range) const
StatementIterator subClassOf (const Node &subClass, const Node &superClass=Node()) const
StatementIterator subPropertyOf (const Node &subProperty, const Node &superProperty=Node()) const
StatementIterator type (const Node &someClass, const Node &someType) const
bool isClass (const Node &resource) const
bool isProperty (const Node &resource) const
bool isDirectSubClassOf (const Node &subClass, const Node &superClass) const
bool isDirectSubPropertyOf (const Node &subProperty, const Node &superProperty) const
bool isDirectType (const Node &someClass, const Node &someType) const
bool isSubClassOf (const Node &subClass, const Node &superClass) const
bool isSubPropertyOf (const Node &subProperty, const Node &superProperty) const
bool isType (const Node &someClass, const Node &someType) const
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())
virtual Error::ErrorCode removeAllStatements (const Statement &statement)
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 QueryResultIterator executeQuery (const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) 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 ()
Error::ErrorCode removeAllStatements ()
StatementIterator listStatements () const
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 &)
Protected Member Functions inherited from Soprano::Model
 Model ()
Protected Member Functions inherited from Soprano::Error::ErrorCache
 ErrorCache ()
void clearError () const
void setError (const Error &) const
void setError (const QString &errorMessage, int code=ErrorUnknown) const

Detailed Description

Provides convenience methods to handle RDFS data.

Interface based on Sesame's RdfSchemaSource. (Copyright (C) 2002-2006 Aduna BV, GNU LGPL License applies.)

Warning
Backward inferencing has not been implemented yet. Thus, methods like subClassOf() return the same as directSubClassOf().
Author
Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org

Definition at line 46 of file rdfschemamodel.h.

Constructor & Destructor Documentation

◆ RdfSchemaModel()

Soprano::RdfSchemaModel::RdfSchemaModel ( Model * parentModel = 0)

Create a new RDF Schema wrapper model that performs actions on model

◆ ~RdfSchemaModel()

Soprano::RdfSchemaModel::~RdfSchemaModel ( )

Destructor.

Member Function Documentation

◆ classes()

StatementIterator Soprano::RdfSchemaModel::classes ( ) const

Get all defined RDF/S classes.

Returns
a StatementIterator that iterates over all statements in the model defining an RDF/S class.

◆ directSubClassOf()

StatementIterator Soprano::RdfSchemaModel::directSubClassOf ( const Node & subClass,
const Node & superClass = Node() ) const

Gets all direct subClassOf relations with a specific sub- and/or superclass. A class A is a direct subclass of class B if there is no class C such that A is a subclass of C and C is a subclass of B.

Parameters
subClassThe subclass of the relations that should be returned, or an empty node if relations with any subclass should be returned.
superClassThe superclass of the relations that should be returned, or an empty node if relations with any superclass should be returned.
Returns
A StatementIterator containing statements of the form (subClass, rdfs:subClassOf, superClass).

◆ directSubPropertyOf()

StatementIterator Soprano::RdfSchemaModel::directSubPropertyOf ( const Node & subProperty,
const Node & superProperty = Node() ) const

Gets all direct subPropertyOf relations with a specific sub- and/or superproperty. A property A is a direct subproperty of property B if there is no property C such that A is a subproperty of C and C is a subproperty of B.

Parameters
subPropertyThe subproperty of the relations that should be returned, or an empty node if relations with any subproperty should be returned.
superPropertyThe superproperty of the relations that should be returned, or an empty node if relations with any superproperty should be returned.
Returns
A StatementIterator containing statements of the form (subProperty, rdfs:subPropertyOf, superProperty).

◆ directType()

StatementIterator Soprano::RdfSchemaModel::directType ( const Node & someClass,
const Node & someType ) const

Gets all direct type relations with a specific instance and/or class.

Parameters
someClassThe instance of the relations that should be returned, or an empty node if relations with any instance should be returned.
someTypeThe class of the relations that should be returned, or an empty node if relations with any class should be returned.
Returns
A StatementIterator containing statements of the form (someClass, rdf:type, someType).

◆ domain()

StatementIterator Soprano::RdfSchemaModel::domain ( const Node & prop,
const Node & domain ) const

Gets all domain relations with a specific property and/or domain class.

Parameters
propThe property of the relations that should be returned, or an empty node if relations with any property should be returned.
domainThe domain of the relations that should be returned, or an empty node if relations with any domain should be returned.
Returns
A StatementIterator containing statements of the form (prop, rdfs:domain, domain).

◆ properties()

StatementIterator Soprano::RdfSchemaModel::properties ( ) const

Gets all defined properties.

Returns
A StatementIterator containing statements of the form (someProperty, rdf:type, rdf:Property).

◆ range()

StatementIterator Soprano::RdfSchemaModel::range ( const Node & prop,
const Node & range ) const

Gets all range relations with a specific property and/or range class.

Parameters
propThe property of the relations that should be returned, or an empty node if relations with any property should be returned.
rangeThe range of the relations that should be returned, or an empty node if relations with any range should be returned.
Returns
A StatementIterator containing statements of the form (prop, rdfs:range, range).

◆ subClassOf()

StatementIterator Soprano::RdfSchemaModel::subClassOf ( const Node & subClass,
const Node & superClass = Node() ) const

Gets all subClassOf relations with a specific sub- and/or superclass. Note that the subClassOf relation is reflexive: a class is implicitly always a subclass of itself.

Do not use this method if the Soprano backend supports inferencing. Use directSubClassOf instead which is much faster.

Parameters
subClassThe subclass of the relations that should be returned, or an empty node if relations with any subclass should be returned.
superClassThe superclass of the relations that should be returned, or an emtpy node if relations with any superclass should be returned.
Returns
A StatementIterator containing all valid statements of the form (subClass, rdfs:subClassOf, superClass) including those calculated through direct inferencing.

◆ subPropertyOf()

StatementIterator Soprano::RdfSchemaModel::subPropertyOf ( const Node & subProperty,
const Node & superProperty = Node() ) const

Gets all subPropertyOf relations with a specific sub- and/or superproperty. Note that the subPropertyOf relation is reflexive: a property is implicitly always a subproperty of itself.

Do not use this method if the Soprano backend supports inferencing. Use directSubPropertyOf instead which is much faster.

Parameters
subPropertyThe subproperty of the relations that should be returned, or an empty node if relations with any subproperty should be returned.
superPropertyThe superproperty of the relations that should be returned, or an empty node if relations with any superproperty should be returned.
Returns
A StatementIterator containing all valid statements of the form (subProperty, rdfs:subPropertyOf, superProperty) including those calculated through direct inferencing.

◆ type()

StatementIterator Soprano::RdfSchemaModel::type ( const Node & someClass,
const Node & someType ) const

Gets all type relations with a specific instance and/or class.

Do not use this method if the Soprano backend supports inferencing. Use directType instead which is much faster.

Parameters
someClassThe instance of the relations that should be returned, or an empty node if relations with any instance should be returned.
someTypeThe class of the relations that should be returned, or an empty node if relations with any class should be returned.
Returns
A StatementIterator containing all valid statements of the form (someClass, rdf:type, someType) including those calculated through direct inferencing.

◆ isClass()

bool Soprano::RdfSchemaModel::isClass ( const Node & resource) const

Checks whether the supplied resource represents a class.

Parameters
resourceThe resource to check.
Returns
true if resource is a class, false otherwise.

◆ isProperty()

bool Soprano::RdfSchemaModel::isProperty ( const Node & resource) const

Checks whether the supplied resource represents a property.

Parameters
resourceThe resource to check.
Returns
true if resource is a property, false otherwise.

◆ isDirectSubClassOf()

bool Soprano::RdfSchemaModel::isDirectSubClassOf ( const Node & subClass,
const Node & superClass ) const

Checks whether one resource is a direct subclass of another.

Parameters
subClassA class.
superClassA class.
Returns
true if subClass is a direct subclass of superClass, false otherwise.

◆ isDirectSubPropertyOf()

bool Soprano::RdfSchemaModel::isDirectSubPropertyOf ( const Node & subProperty,
const Node & superProperty ) const

Checks whether one resource is a direct subproperty of another.

Parameters
subPropertyA property.
superPropertyA property.
Returns
true if subProperty is a direct subproperty of superProperty, false otherwise.

◆ isDirectType()

bool Soprano::RdfSchemaModel::isDirectType ( const Node & someClass,
const Node & someType ) const

Checks whether one resource is a direct instance of another.

Parameters
someClassAn instance.
someTypeA class.
Returns
true if someClass is a direct instance of someType, false otherwise.

◆ isSubClassOf()

bool Soprano::RdfSchemaModel::isSubClassOf ( const Node & subClass,
const Node & superClass ) const

Checks whether one resource is a subclass of another.

Do not use this method if the Soprano backend supports inferencing. Use isDirectSubClassOf instead which is much faster.

Parameters
subClassA class.
superClassA class.
Returns
true if subClass is a subclass of superClass, false otherwise.

◆ isSubPropertyOf()

bool Soprano::RdfSchemaModel::isSubPropertyOf ( const Node & subProperty,
const Node & superProperty ) const

Checks whether one resource is a subproperty of another.

Do not use this method if the Soprano backend supports inferencing. Use isDirectSubPropertyOf instead which is much faster.

Parameters
subPropertyA property.
superPropertyA property.
Returns
true if subProperty is a subproperty of superProperty, false otherwise.

◆ isType()

bool Soprano::RdfSchemaModel::isType ( const Node & someClass,
const Node & someType ) const

Checks whether one resource is a instance of another.

Do not use this method if the Soprano backend supports inferencing. Use isDirectType instead which is much faster.

Parameters
someClassAn instance.
someTypeA class.
Returns
true if someClass is an instance of someType, false otherwise.

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