# class Class

###

Module | nepomuk
Namespace | Nepomuk::Types
Class | Class
Inherits | Nepomuk::Types::Entity

\class Class class.h Nepomuk/Types/Class

A Class is a resource of type rdf:Class.

Class instances are explicitly shared. Two instances created with the same uri reference the same data.

While Resource objects can be changed Class instances are considered to be static and never changed during their lifetime.

Author Sebastian Trueg <trueg@kde.org>

### methods

- Class ( )

  returns ctor

  Default constructor. Creates an empty Class.

- Class (uri)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  uri | QUrl |

  Create the class referred to by uri. The result is either a valid class which could be loaded from the Nepomuk store or a simple class which only contains the uri.

  Be aware that the data is only loaded once read.

  Subsequent calls result in a simple hash lookup of cached data.

- Class (a0)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  a0 | Nepomuk.Types.Class |

  Default copy constructor

- allParentClasses ( )

  returns QList<Nepomuk::Types::Class>

  Recursively determines all parent classes of this class, not only the direct ones. Returns A list of parent classes of this class.

  See also parentClasses()

- allSubClasses ( )

  returns QList<Nepomuk::Types::Class>

  Recursively determines all sub classes of this class, not only the direct ones. Returns A list of sub classes of this class.

  See also subClasses()

- domainOf ( )

  returns QList<Nepomuk::Types::Property>

  A Property has a certain domain which is a Class. Returns A list of all properties that have this Class as a domain.

  See also Property.domain()

- findPropertyByLabel (label, language)

  returns Nepomuk.Types.Property

  Argument | Type | Default
  --- | --- | ---
  label | QString |
  language | QString | QString()

  Search for a property in the class by its label.

  label - The label of the property (i.e. rdfs:label)

  language - The language in which the label was specified. If empty the default rdfs:label is returned. Returns the Property object identified by label or an invalid property if it could not be found.

- findPropertyByName (name)

  returns Nepomuk.Types.Property

  Argument | Type | Default
  --- | --- | ---
  name | QString |

  Search for a property in the class by its name.

  name - The name of the property. Returns the Property object identified by name or an invalid property if it could not be found.

- isParentOf (other)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  other | Nepomuk.Types.Class |

  Check if a class inherits this class. This is a recursive method which does not only check direct child classes.

  Returns true if other is derived from this class, false otherwise.

- isSubClassOf (other)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  other | Nepomuk.Types.Class |

  Check if this class is derived from another class. This is a recursive method which does not only check direct child classes.

  Returns true if this class is derived from other, false otherwise.

- parentClasses ( )

  returns QList<Nepomuk::Types::Class>

  Each class can have multiple parent classes. This method provides a list of all direct parents. Returns A list of all parent classes of this class. If the list is emppty it means that the class has no direct parents, i.e. it is derived from rdf:Resource.

  See also allParentClasses()

- rangeOf ( )

  returns QList<Nepomuk::Types::Property>

  A Property has a certain range which is a Class or a Literal. Returns A list of all properties that have this Class as a range.

  See also Property.range()

- subClasses ( )

  returns QList<Nepomuk::Types::Class>

  Returns A list of all classes that have this class as a parent. Be aware that this list can never be final since other ontologies that have not been loaded yet may contain classes that are derived from this class.