Did column meta
Classes¶
DidColumnMeta ¶
DidColumnMeta()
A metadata plugin to interact with the base DID table metadata.
Initialize the DID column metadata plugin.
Functions¶
get_metadata ¶
get_metadata(scope, name, *, session)
Get all the metadata of some data identifier.
PARAMETER | DESCRIPTION |
---|---|
scope
|
The scope of the DID.
TYPE:
|
name
|
The name of the DID.
TYPE:
|
session
|
The database session in use.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
DID metadata as a dictionary. |
set_metadata ¶
set_metadata(
scope, name, key, value, recursive=False, *, session
)
Add a single key-value metadata pair to a data identifier.
PARAMETER | DESCRIPTION |
---|---|
scope
|
The scope of the DID.
TYPE:
|
name
|
The name of the DID.
TYPE:
|
key
|
The metadata key.
TYPE:
|
value
|
The metadata value.
TYPE:
|
recursive
|
Option to propagate the metadata updates to child content.
TYPE:
|
session
|
The database session in use.
TYPE:
|
set_metadata_bulk ¶
set_metadata_bulk(
scope, name, metadata, recursive=False, *, session
)
Add multiple key-value metadata pairs to a data identifier.
PARAMETER | DESCRIPTION |
---|---|
scope
|
The scope of the DID.
TYPE:
|
name
|
The name of the DID.
TYPE:
|
metadata
|
All key-value metadata pairs to set.
TYPE:
|
recursive
|
Option to propagate the metadata updates to child content.
TYPE:
|
session
|
The database session in use.
TYPE:
|
list_dids ¶
list_dids(
scope,
filters,
did_type="collection",
ignore_case=False,
limit=None,
offset=None,
long=False,
recursive=False,
ignore_dids=None,
*,
session
)
Search data identifiers.
:yields: - If long is False: DID names (str). - If long is True: dicts with keys: {'scope', 'name', 'did_type', 'bytes', 'length'}.
PARAMETER | DESCRIPTION |
---|---|
scope
|
The scope of the DIDs to list.
TYPE:
|
filters
|
A single dict or a list of dicts representing OR groups (disjunction). Each group can include a semantic 'type' expanded into did_type filters.
TYPE:
|
did_type
|
Option to filter by a specific DID type: all(container, dataset, file), collection(dataset or container), dataset, container, file.
TYPE:
|
ignore_case
|
Has no effect.
TYPE:
|
limit
|
Option to limit the number of returned results.
TYPE:
|
offset
|
Has no effect.
TYPE:
|
long
|
Option to display more information for each DID.
TYPE:
|
recursive
|
Option to recursively list child-DIDs content.
TYPE:
|
ignore_dids
|
A set of 'scope:name' strings to de-duplicate results across OR groups and recursion.
TYPE:
|
session
|
The database session in use.
TYPE:
|
delete_metadata ¶
delete_metadata(scope, name, key, *, session=None)
Deletes the metadata stored for the given key. (Currently not implemented)
PARAMETER | DESCRIPTION |
---|---|
scope
|
The scope of the DID.
TYPE:
|
name
|
The name of the DID.
TYPE:
|
key
|
Key of the metadata.
TYPE:
|
session
|
The database session in use.
TYPE:
|
manages_key ¶
manages_key(key, *, session=None)
Return whether a metadata key is managed by this plugin.
PARAMETER | DESCRIPTION |
---|---|
key
|
Key of the metadata.
TYPE:
|
session
|
Unused; accepted for interface compatibility.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
|
get_plugin_name ¶
get_plugin_name()
Return a unique identifier for this plugin.
RETURNS | DESCRIPTION |
---|---|
str
|
The name of the plugin. |