🔌 Concept example

🔌 Concept example#

galactic.algebras.concept.examples.animals module

Variables

  • animals a dictionary containing a sample table

  • context a binary context representing the animals dictionary

Examples

>>> from galactic.algebras.concept.examples.animals import context
>>> context
<galactic.algebras.concept.core.Context object at 0x...>
>>> context.domain
<galactic.algebras.concept.core.ItemUniverse object at 0x...>
>>> [str(item) for item in context.domain]
['Dove', 'Hen', 'Duck', 'Goose', ..., 'Tiger', 'Lion', 'Horse', 'Zebra', 'Cow']
>>> context.co_domain
<galactic.algebras.concept.core.AttributeUniverse object at 0x...>
>>> [str(attribute) for attribute in context.co_domain]
['small', 'medium', 'big', 'twolegs', 'fourlegs', ..., 'hooves']
>>> [(str(item), str(attribute)) for item, attribute in context]
[('Dove', 'small'), ('Dove', 'twolegs'), ..., ('Cow', 'hooves')]