Value

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

Bases: ClosedTerm

Abstract base class for values.

template_class

alias of ValueTemplate

variable_class

alias of ValueVariable

datatype_class: ClassVar[type[Datatype]]

Datatype class associated with this value class.

datatype: ClassVar[Datatype]

Datatype associated with this value class.

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.

n3() str[source]

Gets the simple value of value in N3 format.

Returns:

Simple value in N3 format.

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

Bases: Template

Abstract base class for value templates.

object_class

alias of Value

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

Bases: Variable

Value variable.

Parameters:

name – Name.

object_class

alias of Value