Relation#

Import

from scenet import Relation

Defined in

scenet.ir (source)

Install

pip install scenet

Since

0.1

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

class scenet.ir.Relation[source]#

Bases: Strict

One staging fact, written as a sentence.

Authored as alice left_of bob rather than a three-key mapping because staging is read far more often than it is written, and a sentence is legible at a glance.

Raises:

ValidationError – The subject and object are the same actor. No predicate here is meaningful reflexively.

Example

>>> from scenet import Predicate, Relation
>>> relation = Relation(subject="a", predicate="left_of", object="b")
>>> relation.predicate is Predicate.LEFT_OF
True

See also

Predicate, every relation there is.

subject: str#

The actor id the relation is about.

predicate: Predicate#

How the subject stands to the object: left_of, right_of, in_front_of, behind, looking_at or ground_shared_with.

object: str#

The other actor id. For looking_at, it may be somebody heard from off panel.