acl-org / acl-org/acl-anthology

CollectionItem refactoring

未关闭
#8,000 14 条评论 0 个 reaction 已指派 1 人 已被 @mbollmann 认领 在 GitHub 查看
enhancement python-library
主要语言
Python
星标
797
派生
408
平均合并
3 天 19 小时
30 天内合并 PR
36

描述

Opening this issue to document a project I would like to tackle soon: refactoring the code to introduce an abstract CollectionItem class.

## Current state

Our XML files (called Collections internally) store a variety of items that can be linked to people:

- Volumes, which have Anthology IDs
- Papers, which have Anthology IDs
- Talks, which don’t currently have IDs

Some of the consequences of how we currently handle this are:

- Talks are "second-class citizens" in that they don’t have IDs, creating challenges for displaying them on the website (#5612)
- Only Papers get displayed on author pages, and it creates overhead to generalize this to other contribution types (e.g. volumes without frontmatter, #7973)
- There’s currently no way to represent items that don’t fit into one of these predefined categories, e.g. podcasts (#497)
- In Python scripts, typing is tricky as functions may return e.g. `Volume | Paper | Talk`, which have different attributes and do not inherit from a common parent class.

## Proposal

I want to introduce a CollectionItem class that serves as the base class for anything that

- Can be represented in a Collection (i.e. an XML data file)
- Can be referred to by a unique ID
- Can have NameSpecifications attached to it linking it to people

This would mean that

- Volumes, Papers, Talks all inherit from CollectionItem
- Frontmatter will become a separate type from Paper, as they function slightly differently, allow only a subset of fields, and need a lot of special handling in the current Paper class
- There will be a common interface (as defined by CollectionItem) for all item types, reducing the need to handle each one seperately in e.g. build scripts
- New types of contributions (e.g. podcasts) can more easily be added in the future by creating a new class that inherits from CollectionItem

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start by reviewing the existing Volume, Paper, and Talk representations and how Collection XML data is consumed by the Python and build scripts. Map the shared identity and NameSpecifications requirements, then confirm that the proposed CollectionItem hierarchy, separate Frontmatter type, and future contribution types are supported consistently across those uses.

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
backend, data
Issue 类型
重构
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。