The DSData class¶
gamslib.objectcsv.dsdata.DSData
dataclass
¶
DSData(dspath, dsid='', title='', description='', mimetype='', creator='', rights='', lang='', tags='')
Represents metadata for a single datastream of a GAMS object.
Fields:
- dspath (str): Relative path to the datastream file.
- dsid (str): Datastream identifier.
- title (str): Title of the datastream.
- description (str): Description of the datastream.
- mimetype (str): MIME type of the datastream.
- creator (str): Creator of the datastream.
- rights (str): Rights statement for the datastream.
- lang (str): Language(s) of the datastream.
- tags (str): Additional tags for the datastream.
fieldnames
classmethod
¶
merge
¶
Merge metadata from another DSData instance.
Selectively overwrites fields ('title', 'mimetype', 'creator', 'rights') with non-empty values from the other instance. Both datastreams must have the same dspath and dsid.
| PARAMETER | DESCRIPTION |
|---|---|
other_dsdata
|
Another DSData instance to merge from.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If dspath or dsid do not match. |
validate
¶
Validate required metadata fields.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If any required field (dspath, dsid, mimetype, rights) is empty. |