lenskit.data.schema.DataSchema ============================== .. py:class:: lenskit.data.schema.DataSchema(/, **data) Bases: :py:obj:`pydantic.BaseModel` Description of the entities and layout of a dataset. .. py:attribute:: version :type: str :value: '2025.3' The data layout version. .. note:: When a new schema model is created, this defaults to the current version instead of the oldest version. .. py:attribute:: name :type: str | None :value: None The dataset name. .. py:attribute:: default_interaction :type: Name | None :value: None The default interaction type. .. py:attribute:: entities :type: dict[Name, EntitySchema] Entity classes defined for this dataset. .. py:attribute:: relationships :type: dict[Name, RelationshipSchema] Relationship classes defined for this dataset. .. py:method:: model_validate_json(json_data, *, context = None, **kwargs) :classmethod: !!! abstract "Usage Documentation" [JSON Parsing](../concepts/json.md#json-parsing) Validate the given JSON data against the Pydantic model. A [`ValidationError`][pydantic_core.ValidationError] raised here reports the rejected locations and values, but may not retain the complete source document. Recording validations with [Logfire](../integrations/logfire.md) keeps the complete JSON input alongside the error — see [Troubleshooting validation errors](../errors/troubleshooting.md). :param json_data: The JSON data to validate. :param strict: Whether to enforce types strictly. :param extra: Whether to ignore, allow, or forbid extra data during model validation. See the [`extra` configuration value][pydantic.ConfigDict.extra] for details. :param context: Extra variables to pass to the validator. :param by_alias: Whether to use the field's alias when validating against the provided input data. :param by_name: Whether to use the field's name when validating against the provided input data. :returns: The validated Pydantic model. :raises ValidationError: If `json_data` is not a JSON string or the object could not be validated.