Property Class Reference
from PyKDE4.nepomuk import *
Inherits: Nepomuk.Types.Entity
Namespace: Nepomuk::Types
Detailed Description
\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.
Methods | |
__init__ (self) | |
__init__ (self, QUrl uri) | |
__init__ (self, Nepomuk.Types.Property a0) | |
int | cardinality (self) |
Nepomuk.Types.Class | domain (self) |
Nepomuk.Types.Property | inverseProperty (self) |
bool | isParentOf (self, Nepomuk.Types.Property other) |
bool | isSubPropertyOf (self, Nepomuk.Types.Property other) |
Nepomuk.Types.Literal | literalRangeType (self) |
int | maxCardinality (self) |
int | minCardinality (self) |
[Nepomuk.Types.Property] | parentProperties (self) |
Nepomuk.Types.Class | range (self) |
[Nepomuk.Types.Property] | subProperties (self) |
Method Documentation
__init__ | ( | self ) |
Default constructor. Creates an empty Property.
__init__ | ( | self, | ||
QUrl | uri | |||
) |
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.
__init__ | ( | self, | ||
Nepomuk.Types.Property | a0 | |||
) |
Default copy constructor
int cardinality | ( | self ) |
The cardinality of this property as specified by nrl:cardinality.
- Returns:
- the cardinality of the property or -1 if none was set.
Nepomuk.Types.Class domain | ( | self ) |
The domain of the property.
Nepomuk.Types.Property inverseProperty | ( | self ) |
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.
bool isParentOf | ( | self, | ||
Nepomuk.Types.Property | other | |||
) |
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.
bool isSubPropertyOf | ( | self, | ||
Nepomuk.Types.Property | other | |||
) |
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.
Nepomuk.Types.Literal literalRangeType | ( | self ) |
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.
\sa range
int maxCardinality | ( | self ) |
The maximum cardinality of this property as specified by nrl:maxCardinality.
- Returns:
- the maximum cardinality of the property or -1 if none was set.
int minCardinality | ( | self ) |
The minimum cardinality of this property as specified by nrl:minCardinality.
- Returns:
- the minimum cardinality of the property or -1 if none was set.
[Nepomuk.Types.Property] parentProperties | ( | self ) |
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.
Nepomuk.Types.Class range | ( | self ) |
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.
[Nepomuk.Types.Property] subProperties | ( | self ) |
- 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.