Record

class Record(*, prefix: str, uri_prefix: str, prefix_synonyms: list[str] = None, uri_prefix_synonyms: list[str] = None, pattern: str | None = None)[source]

Bases: BaseModel

A record of some prefixes and their associated URI prefixes.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Attributes Summary

model_computed_fields

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

Methods Summary

prefix_not_in_synonyms(v, values)

Check that the canonical prefix does not apper in the prefix synonym list.

uri_prefix_not_in_synonyms(v, values)

Check that the canonical URI prefix does not apper in the URI prefix synonym list.

Attributes Documentation

model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'pattern': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='The regular expression pattern for entries in this semantic space. Warning: this is an experimental feature.'), 'prefix': FieldInfo(annotation=str, required=True, title='CURIE prefix', description='The canonical CURIE prefix, used in the reverse prefix map'), 'prefix_synonyms': FieldInfo(annotation=list[str], required=False, default_factory=list, title='CURIE prefix synonyms'), 'uri_prefix': FieldInfo(annotation=str, required=True, title='URI prefix', description='The canonical URI prefix, used in the forward prefix map'), 'uri_prefix_synonyms': FieldInfo(annotation=list[str], required=False, default_factory=list, title='URI prefix synonyms')}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

Methods Documentation

classmethod prefix_not_in_synonyms(v: str, values: Mapping[str, Any]) str[source]

Check that the canonical prefix does not apper in the prefix synonym list.

classmethod uri_prefix_not_in_synonyms(v: str, values: Mapping[str, Any]) str[source]

Check that the canonical URI prefix does not apper in the URI prefix synonym list.