Model TypeDB data¶
TypeBridge models TypeDB concepts directly: attributes are independent types, entities and relations own attributes, relations declare roles, and player types play those roles.
Build a model¶
- Define attribute types and their value domains.
- Define entities, ownership, and inheritance.
- Define relations and roles.
- Express cardinality, keys, uniqueness, ordering, and metadata.
- Use abstract types for polymorphic contracts.
- Apply validation and serialization at the application boundary.
Python models are Pydantic classes. The TypeScript facade uses branded attribute and model constructors. Schema-first workspaces can generate both surfaces plus a Rust schema crate from the same authority.
Application projections¶
- API DTOs generate create, patch, and output shapes without exposing persistence-only fields.
- Code generation projects TypeQL or canonical workspace schemas into application-owned model packages.
- TypeScript/Node explains branded attribute values and the
JavaScript
bigintboundary. - Rust explains generated create/model types and schema binding.
Once the model is defined, continue with read and write workflows.