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

__init__(iri: VTPropertyContent, range: VTDatatype | None = None) None[source]
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.

object_class

alias of Property

__init__(iri: VT_IRI, range: VTDatatype | None = None) None[source]
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.

object_class

alias of Property

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.