Skip to content

core

relationalai.semantics.frontend

Core concept types used when declaring properties and relationships.

These concept types are used as field types when you define a Property or Relationship in a semantic model.

Common core types include:

Most end users should import core types from relationalai.semantics:

>>> from relationalai.semantics import String, Integer, Number

Use core types in a property definition:

>>> from relationalai.semantics import Integer, Model, String
>>> m = Model()
>>> Person = m.Concept("Person", identify_by={"id": Integer})
>>> Person.name = m.Property(f"{Person} has {String:name}")

Use a concrete decimal type in a property:

>>> Product = m.Concept("Product")
>>> Product.price = m.Property(f"{Product} costs ${Number.size(12, 2):price}")

Attributes exposed by this module.

Classes exposed by this module.