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:
semantics.frontend.core.Stringfor text valuessemantics.frontend.core.Numberfor decimal numeric values (with specific precision and scale defined viaNumber.size)semantics.frontend.core.Integerfor whole numbers (alias forNumber(38, 0))semantics.frontend.core.Booleanfor true/false valuessemantics.frontend.core.Datefor calendar datessemantics.frontend.core.DateTimefor timestamps
Most end users should import core types from relationalai.semantics:
>>> from relationalai.semantics import String, Integer, NumberExamples
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
Attributes exposed by this module.
AnyA concept type that matches any value.
AnyEntityA concept type that matches any entity.
NumericA concept type for numeric values.
NumberA concept type for decimal numbers.
ScaledNumberA numeric concept type whose precision and scale are inferred from operands.
BooleanA concept type for boolean values.
StringA concept type for string values.
DateA concept type for date values.
DateTimeA concept type for date-time values.
FloatA concept type for floating-point numeric values.
HashA concept type for opaque hash identifiers.
DefaultNumberThe default decimal number type,
Number(38, 14).IntegerThe integer number type,
Number(38, 0).Int64The 64-bit integer number type,
Number(19, 0).IntAlias for
semantics.frontend.core.Integer.Int128Alias for
semantics.frontend.core.Integer.DecimalAlias for
semantics.frontend.core.DefaultNumber.BoolAlias for
semantics.frontend.core.Boolean.Classes
Classes exposed by this module.
AnyNumberRepresent the family of decimal
Number(precision, scale) types.