Skip to content

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.

recid instance-attribute

recid

title class-attribute instance-attribute

title = ''

project class-attribute instance-attribute

project = ''

description class-attribute instance-attribute

description = ''

creator class-attribute instance-attribute

creator = ''

rights class-attribute instance-attribute

rights = ''

publisher class-attribute instance-attribute

publisher = ''

source class-attribute instance-attribute

source = ''

objectType class-attribute instance-attribute

objectType = ''

mainResource class-attribute instance-attribute

mainResource = ''

funder class-attribute instance-attribute

funder = ''

tags class-attribute instance-attribute

tags = ''

fieldnames classmethod

fieldnames()

Return the list of field names for ObjectData.

RETURNS DESCRIPTION
list[str]

list[str]: Names of all fields in the ObjectData dataclass.

merge

merge(other)

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: ObjectData

RAISES DESCRIPTION
ValueError

If recid values do not match.

validate

validate()

Validate required metadata fields.

RAISES DESCRIPTION
ValueError

If any required field is empty.