The ObjectData class¶
gamslib.objectcsv.objectdata.ObjectData
dataclass
¶
ObjectData(recid, title='', project='', description='', creator='', rights='', publisher='', source='', objectType='', mainResource='', funder='', tags='')
Represents CSV metadata for a single GAMS object.
Fields:
- recid (str): Object identifier.
- title (str): Title of the object.
- project (str): Project name or identifier.
- description (str): Description of the object.
- creator (str): Creator of the object.
- rights (str): Rights statement for the object.
- publisher (str): Publisher of the object.
- source (str): Source of the object.
- objectType (str): Type of the object.
- mainResource (str): Main datastream identifier.
- funder (str): Funder information.
- tags (str): Additional tags for the object.
fieldnames
classmethod
¶
merge
¶
Merge the object data with another ObjectData instance.
Both objects must have the same recid.
Some field are always replacd by the new value if the new value is non-empty ('title', 'project', 'creator', 'rights', 'publisher', 'source', 'objectType', 'mainResource', 'funder').
Other fields are only updated if they are empty in the current instance and non-empty in the other instance.
| PARAMETER | DESCRIPTION |
|---|---|
other
|
Another ObjectData instance to merge from.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If recid values do not match. |
validate
¶
Validate required metadata fields.
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If any required field is empty. |