Schemas overview
While RelatedItems are schema-less, platform v5.0 introduces the option to create Schemas. Schemas serve the following purposes:
- AI integration: Provide context for the platform AI service to generate related queries
- Data consistency: Define expected structures for RelatedItem objects, improving data consistency without strict enforcement
Involved types#
Creating RelatedItem schemas involve the following Item Service resources:
| Type | Relevance |
|---|---|
| Schema | Defines a schema that RelatedItems can adhere to. |
| SchemaDefinition | A first-class resource that contains the Schemas for each collection's RelatedItems in a namespace |
| Namespace | Can contain one SchemaDefinition |
| NamedUserCollection | You can add or update a Schema to the SchemaDefinition when you create a NamedUserCollection. NamedUserCollections must reference an existing Schema's _typeName field or create a new one. |
| RelatedItem | Can follow the Schemas in the SchemaDefinition based on the Schema referenced in its NamedUserCollection |