Property
- class Property(*args, **kwargs)[source]
Bases:
Entity
Binary relationship.
- Parameters:
iri – IRI.
range – Datatype.
- datatype_class
alias of
PropertyDatatype
- datatype: ClassVar[PropertyDatatype] = PropertyDatatype()
Datatype associated with this value class.
- template_class
alias of
PropertyTemplate
- variable_class
alias of
PropertyVariable
- property range: Datatype | None
The range of property.
- get_range(default: Datatype | None = None) Datatype | None [source]
Gets the range of property.
If range is
None
, returns default.- Parameters:
default – Default range.
- Returns:
Datatype.
- no_value() NoValueSnak [source]
Constructs a no-value snak from property.
- Returns:
No-value snak.
- some_value() SomeValueSnak [source]
Constructs a some-value snak from property.
- Returns:
Some-value snak.
- class PropertyTemplate(*args, **kwargs)[source]
Bases:
EntityTemplate
Property template.
- Parameters:
iri – IRI, IRI template, or IRI variable.
range – Datatype or datatype variable.
- property range: DatatypeVariable | Datatype | None
The range of property template.
- get_range(default: DatatypeVariable | Datatype | None = None) DatatypeVariable | Datatype | None [source]
Gets the range of property template.
If range is
None
, returns default.- Parameters:
default – Default range.
- Returns:
Datatype or datatype variable.
- no_value() NoValueSnakTemplate [source]
Constructs a no-value snak template from property template.
- Returns:
No-value snak template.
- some_value() SomeValueSnakTemplate [source]
Constructs a some-value snak template from property template.
- Returns:
Some-value snak template.
- class PropertyVariable(name: str, variable_class: type[Variable] | type[Term] | None = None)[source]
Bases:
EntityVariable
Property variable.
- Parameters:
name – Name.
- no_value() NoValueSnakTemplate [source]
Constructs a no-value snak template from property variable.
- Returns:
No-value snak template.
- some_value() SomeValueSnakTemplate [source]
Constructs a some-value snak template from property variable.
- Returns:
Some-value snak template.