# class Property

###

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

\class Property property.h Nepomuk/Types/Property

A property is a resource of type rdf:Property which relates a domain with a range. The latter one can be a Literal or a Class.

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

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

Author Sebastian Trueg <trueg@kde.org>

### methods

- Property ( )

  returns ctor

  Default constructor. Creates an empty Property.

- Property (uri)

  returns ctor

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

  Create the property referred to by uri. The result is either a valid property which could be loaded from the Nepomuk store or a simple property 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.

- Property (a0)

  returns ctor

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

  Default copy constructor

- cardinality ( )

  returns int

  The cardinality of this property as specified by nrl:cardinality.

  Returns the cardinality of the property or -1 if none was set.

- domain ( )

  returns Nepomuk.Types.Class

  The domain of the property.

- inverseProperty ( )

  returns Nepomuk.Types.Property

  The inverse property (nrl:inverseProperty). Returns A Property instance representing the inverse property of this one or 0 if none was specified in the ontology.

- isParentOf (other)

  returns bool

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

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

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

- isSubPropertyOf (other)

  returns bool

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

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

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

- literalRangeType ( )

  returns Nepomuk.Types.Literal

  If the rage of this property is a literal (i.e. range returns an invalid Class) this method provides the literal type.

  \returns the literal type of this property or an empty, invalid Literal if the range is a Class.

  See also range

- maxCardinality ( )

  returns int

  The maximum cardinality of this property as specified by nrl:maxCardinality.

  Returns the maximum cardinality of the property or -1 if none was set.

- minCardinality ( )

  returns int

  The minimum cardinality of this property as specified by nrl:minCardinality.

  Returns the minimum cardinality of the property or -1 if none was set.

- parentProperties ( )

  returns QList<Nepomuk::Types::Property>

  Each property can have multiple parent properties. Returns A list of all parent properties of this property. If the list is emppty it means that the property has no direct parents, i.e. it is derived from rdf:Resource.

- range ( )

  returns Nepomuk.Types.Class

  The range of the property. Returns The range of the property or an invalid Class in case the range of this poperty is a literal.

  See also literalRange

- subProperties ( )

  returns QList<Nepomuk::Types::Property>

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