Skip to content

index_metadb

DefaultRelationship

Enumeration of key(s) for relationship dictionary in IndexInfoResource

Source code in optimade/models/index_metadb.py
class DefaultRelationship(Enum):
    """Enumeration of key(s) for relationship dictionary in IndexInfoResource"""

    DEFAULT = "default"

DEFAULT

IndexInfoAttributes pydantic-model

Attributes for Base URL Info endpoint for an Index Meta-Database

Source code in optimade/models/index_metadb.py
class IndexInfoAttributes(BaseInfoAttributes):
    """Attributes for Base URL Info endpoint for an Index Meta-Database"""

    is_index: bool = StrictField(
        True,
        const=True,
        description="This must be `true` since this is an index meta-database (see section Index Meta-Database).",
    )

IndexInfoResource pydantic-model

Index Meta-Database Base URL Info endpoint resource

Source code in optimade/models/index_metadb.py
class IndexInfoResource(BaseInfoResource):
    """Index Meta-Database Base URL Info endpoint resource"""

    attributes: IndexInfoAttributes = Field(...)
    relationships: Union[
        None, Dict[DefaultRelationship, IndexRelationship]
    ] = StrictField(
        ...,
        title="Relationships",
        description="""Reference to the Links identifier object under the `links` endpoint that the provider has chosen as their 'default' OPTIMADE API database.
A client SHOULD present this database as the first choice when an end-user chooses this provider.""",
    )

IndexRelationship pydantic-model

Index Meta-Database relationship

Source code in optimade/models/index_metadb.py
class IndexRelationship(BaseModel):
    """Index Meta-Database relationship"""

    data: Union[None, RelatedLinksResource] = StrictField(
        ...,
        description="""[JSON API resource linkage](http://jsonapi.org/format/1.0/#document-links).
It MUST be either `null` or contain a single Links identifier object with the fields `id` and `type`""",
    )

data: RelatedLinksResource pydantic-field required

JSON API resource linkage. It MUST be either null or contain a single Links identifier object with the fields id and type

RelatedLinksResource pydantic-model

A related Links resource object

Source code in optimade/models/index_metadb.py
class RelatedLinksResource(BaseResource):
    """A related Links resource object"""

    type: str = Field("links", const="links", regex="^links$")