Skip to content

rocrate

RO Crate compatible Metadata.

Here we do impose certain constraints (make fields mandatory).

See https://www.researchobject.org/ro-crate/1.1/

FileMeta

Bases: MediaObject

Source code in src/metador_core/schema/common/rocrate.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@make_mandatory("contentSize", "sha256")
@rocrate(type="File")
class FileMeta(schemaorg.MediaObject):
    class Plugin:
        name = "core.file"
        version = (0, 1, 0)

    # NOTE: We do not use `name` here because `name` is used semantically
    # like a title in schema.org, which could also make sense for a file to have.
    filename: NonEmptyStr
    """Original name of the file in source directory."""

    encodingFormat: MimeTypeStr
    """MIME type of the file."""

filename instance-attribute

filename: NonEmptyStr

Original name of the file in source directory.

encodingFormat instance-attribute

encodingFormat: MimeTypeStr

MIME type of the file.

DirMeta

Bases: Dataset

Source code in src/metador_core/schema/common/rocrate.py
40
41
42
43
44
45
46
47
@rocrate(type="Dataset")
class DirMeta(schemaorg.Dataset):
    class Plugin:
        name = "core.dir"
        version = (0, 1, 0)

    hasPart: Set[LDIdRef] = set()
    """References to (a subset of) contained files and subdirectories."""

hasPart class-attribute instance-attribute

hasPart: Set[LDIdRef] = set()

References to (a subset of) contained files and subdirectories.