New
relationalai.semantics.frontend.base
New( concept: Concept, args: Sequence[Any], kwargs: dict[str, Any], identity_only: bool = False,)Represents a “new entity” statement for a concept.
New objects are produced by Concept.new (and Concept.to_identity) rather
than constructed directly. They can be passed to Model.define to create/update an
entity, and they can also be used as a value in other statements (for example
as the argument to a relationship).
Parameters
Section titled “Parameters”
(conceptConcept) - The entity concept being constructed/referred to.
(argsSequence[Any]) - Optional attached statements and/or schemas (expanded likeConcept.new).
(kwargsdict[str,Any]) - Property/relationship values to set (or to filter by, when used as a lookup).
(identity_onlybool, default:False) - If True, compile as an identity-only lookup (seeConcept.to_identity).
Examples
Section titled “Examples”>>> from relationalai.semantics import Model>>> m = Model()>>> Person = m.Concept("Person")>>> m.define(Person.new(id=1, name="Alice"))>>> m.where(Person.id == 1).select(Person.name).to_df()Most users should not instantiate this class directly. Prefer
Concept.new.
Inheritance Hierarchy
Section titled “Inheritance Hierarchy”Returned By
Section titled “Returned By”semantics > frontend > base └── Concept ├── new └── to_identity
Referenced By
Section titled “Referenced By”RelationalAI Documentation
└── Build With RelationalAI
└── Understand how PyRel works > Build a semantic model
└── Define base facts
└── Define entities and their properties with Concept.new