Skip to content

Placeholder Files

PlaceholderFile

Bases: StrEnum

Temporary stand-in to use instead of a real file when the actual file is not yet available.

Attention

This is only allowed on localhost and test servers. Production environments do not allow a resource with a placeholder.

The chosen value must match the representation type defined in the ontology.

For example, if the super of the resource is StillImageRepresentation, use PlaceholderFile.STILL_IMAGE_REPRESENTATION.

Examples:

resource = resource.add_file(
    filename=PlaceholderFile.STILL_IMAGE_REPRESENTATION,
    license=xmllib.LicenseRecommended.CC.BY_NC_ND,
    copyright_holder="Example University",
    authorship=["Jane Doe"],
)
Source code in dsp/dsp-tools/src/dsp_tools/xmllib/models/placeholder.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class PlaceholderFile(StrEnum):
    """
    Temporary stand-in to use instead of a real file when the actual file is not yet available.

    Attention:
        This is only allowed on localhost and test servers.
        Production environments do not allow a resource with a placeholder.

    The chosen value must match the representation type defined in the ontology.

    For example, if the `super` of the resource is `StillImageRepresentation`,
    use `PlaceholderFile.STILL_IMAGE_REPRESENTATION`.

    Examples:
        ```python
        resource = resource.add_file(
            filename=PlaceholderFile.STILL_IMAGE_REPRESENTATION,
            license=xmllib.LicenseRecommended.CC.BY_NC_ND,
            copyright_holder="Example University",
            authorship=["Jane Doe"],
        )
        ```
    """

    ARCHIVE_REPRESENTATION = "ArchiveRepresentation"
    AUDIO_REPRESENTATION = "AudioRepresentation"
    DOCUMENT_REPRESENTATION = "DocumentRepresentation"
    MOVING_IMAGE_REPRESENTATION = "MovingImageRepresentation"
    STILL_IMAGE_REPRESENTATION = "StillImageRepresentation"
    TEXT_REPRESENTATION = "TextRepresentation"