Snak

class Snak(*args, **kwargs)[source]

Bases: ClosedTerm

Abstract base class for snaks.

template_class

alias of SnakTemplate

variable_class

alias of SnakVariable

classmethod check(arg: Any, function: Callable[[...], Any] | str | None = None, name: str | None = None, position: int | None = None) Self[source]

Coerces arg into an instance of this class.

If arg cannot be coerced, raises an error.

Parameters:
  • arg – Value.

  • function – Function or function name.

  • name – Argument name.

  • position – Argument position.

Returns:

Object.

property property: Property

The property of snak.

get_property() Property[source]

Gets the property of snak.

Returns:

Property.

class SnakTemplate(*args, **kwargs)[source]

Bases: Template

Abstract base class for snak templates.

object_class

alias of Snak

property property: PropertyTemplate | PropertyVariable | Property

The property of snak template.

get_property() PropertyTemplate | PropertyVariable | Property[source]

Gets the property of snak template.

Returns:

Property, property template, or property variable.

class SnakVariable(name: str, variable_class: type[Variable] | type[Term] | None = None)[source]

Bases: Variable

Snak variable.

Parameters:

name – Name.

object_class

alias of Snak