Skip to content

matsci

Example schema for Metador in Materials Science tutorial.

The metadata modelling here is intentionally left simple and minimal.

Material

Bases: MetadataSchema

A material that was used in an experiment or simulation.

Source code in src/metador_core/schema/examples/matsci.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class Material(MetadataSchema):
    """A material that was used in an experiment or simulation."""

    class Plugin:
        name = "example.matsci.material"
        version = (0, 1, 0)

    materialName: schemaorg.Text
    """The name of material."""

    chemicalComposition: Optional[schemaorg.Text]
    """Chemical formula reflecting distribution of elements in the material."""

    density: Optional[PositiveFloat]
    """The density of the material (in g/cm3)."""

    crystalGrainType: Optional[Literal["single_crystal", "bi_crystal", "poly_crystal"]]
    """Type of a grain of a crystalline material."""

materialName instance-attribute

materialName: schemaorg.Text

The name of material.

chemicalComposition instance-attribute

chemicalComposition: Optional[schemaorg.Text]

Chemical formula reflecting distribution of elements in the material.

density instance-attribute

density: Optional[PositiveFloat]

The density of the material (in g/cm3).

crystalGrainType instance-attribute

crystalGrainType: Optional[
    Literal["single_crystal", "bi_crystal", "poly_crystal"]
]

Type of a grain of a crystalline material.

Instrument

Bases: MetadataSchema

Metadata of the instrument used to generate some data.

Source code in src/metador_core/schema/examples/matsci.py
36
37
38
39
40
41
42
43
44
45
class Instrument(MetadataSchema):
    """Metadata of the instrument used to generate some data."""

    class Plugin:
        name = "example.matsci.instrument"
        version = (0, 1, 0)

    instrumentName: schemaorg.Text
    instrumentModel: schemaorg.Text
    instrumentManufacturer: Optional[rocrate.Organization]

Specimen

Bases: MetadataSchema

Metadata of the specimen tested in an experiment.

Source code in src/metador_core/schema/examples/matsci.py
48
49
50
51
52
53
54
55
56
57
58
59
class Specimen(MetadataSchema):
    """Metadata of the specimen tested in an experiment."""

    class Plugin:
        name = "example.matsci.specimen"
        version = (0, 1, 0)

    diameter: PositiveFloat
    """The diameter of the specimen (in mm)."""

    gaugeLength: PositiveFloat
    """The gauge length of the specimen (in mm)."""

diameter instance-attribute

diameter: PositiveFloat

The diameter of the specimen (in mm).

gaugeLength instance-attribute

gaugeLength: PositiveFloat

The gauge length of the specimen (in mm).

Method

Bases: MetadataSchema

A method used to conduct a materials science experiment or simulation.

Source code in src/metador_core/schema/examples/matsci.py
62
63
64
65
66
67
68
69
70
71
72
73
class Method(MetadataSchema):
    """A method used to conduct a materials science experiment or simulation."""

    class Plugin:
        name = "example.matsci.method"
        version = (0, 1, 0)

    methodType: Optional[Literal["tensile_test", "other"]]
    """Type of method used to obtain the resulting data."""

    instrument: Instrument
    specimen: Specimen

methodType instance-attribute

methodType: Optional[Literal['tensile_test', 'other']]

Type of method used to obtain the resulting data.

MatsciFileInfo

Bases: CreativeWork

Metadata for a file with data obtained from research in Materials Science.

Note: To state authors or contributors, use the core.person schema.

Source code in src/metador_core/schema/examples/matsci.py
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@make_mandatory("abstract", "dateCreated", "author")
class MatsciFileInfo(schemaorg.CreativeWork):
    """Metadata for a file with data obtained from research in Materials Science.

    **Note:** To state authors or contributors, use the `core.person` schema.
    """

    class Plugin:
        name = "example.matsci.info"
        version = (0, 1, 0)

    material: Annotated[List[Material], Field(default_factory=lambda: [], min_items=1)]
    """Physical material associated with the file."""

    method: Annotated[List[Method], Field(default_factory=lambda: [])]
    """Materials Science method associated with the file."""

material instance-attribute

material: Annotated[
    List[Material],
    Field(default_factory=lambda: [], min_items=1),
]

Physical material associated with the file.

method instance-attribute

method: Annotated[
    List[Method], Field(default_factory=lambda: [])
]

Materials Science method associated with the file.