collections.collection¶
Collection ¶
Bases: SlottedDict[Volume]
A collection of volumes and events, corresponding to an XML file in the data/xml/
directory of the Anthology repo.
Provides dictionary-like functionality mapping volume IDs to Volume objects in the collection.
Required Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
The ID of this collection (e.g. "L06" or "2022.emnlp"). |
parent |
CollectionIndex
|
The parent CollectionIndex instance to which this collection belongs. |
path |
Path
|
The path of the XML file representing this collection. |
Non-Init Attributes:
Name | Type | Description |
---|---|---|
event |
Optional[Event]
|
An event represented by this collection. |
is_data_loaded |
bool
|
A flag indicating whether the XML file has already been loaded. |
save ¶
save(path=None)
validate_schema ¶
validate_schema()
Validates the XML file belonging to this collection against the RelaxNG schema.
Raises:
Type | Description |
---|---|
DocumentInvalid
|
If the XML file does not validate against the schema. |