Skip to content

index_metadb

DefaultRelationship

Enumeration of key(s) for relationship dictionary in IndexInfoResource

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

    DEFAULT = "default"

DEFAULT = 'default' class-attribute

IndexInfoAttributes

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

Source code in optimade/models/index_metadb.py
26
27
28
29
30
31
32
class IndexInfoAttributes(BaseInfoAttributes):
    """Attributes for Base URL Info endpoint for an Index Meta-Database"""

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

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

IndexInfoResource

Index Meta-Database Base URL Info endpoint resource

Source code in optimade/models/index_metadb.py
51
52
53
54
55
56
57
58
59
60
61
62
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.""",
    )

attributes: IndexInfoAttributes = Field(Ellipsis) class-attribute

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

IndexRelationship

Index Meta-Database relationship

Source code in optimade/models/index_metadb.py
41
42
43
44
45
46
47
48
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: Union[None, RelatedLinksResource] = StrictField(Ellipsis, description='[JSON API resource linkage](http://jsonapi.org/format/1.0/#document-links).\nIt MUST be either `null` or contain a single Links identifier object with the fields `id` and `type`') class-attribute

RelatedLinksResource

A related Links resource object

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

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

type: str = Field('links', regex='^links$') class-attribute