igneus / calendarium-romanum

liturgical calendar library (Roman Catholic, post-Vatican II)
50 stars 21 forks source link

Make Celebration machine-readable #22

Closed igneus closed 6 years ago

igneus commented 6 years ago

The Day objects emitted by Calendar#day or Calendar#[] are mostly well readable for humans as well as for machines. With one exception: when client code needs to know exactly what celebration it is. Typical use-case would be a lectionary/missal/breviary app using calendarium-romanum to handle calendar. Currently the only possible way to exactly identify a celebration requires parsing Celebration#title, which is intended for humans, not for machines, is locale- and data-file-specific and should not really be relied upon.

The first step towards machine-readability was recent addition of Celebration#symbol, which currently uniquely identifies at least the most important temporale feasts. But alone it, of course, doesn't satisfy the use-cases described above.

Will proper support of Celebration#symbol for sanctorale feasts (by adding support for optionally specifying it in data files and drafting a standard set of symbols for the most common feasts) close the hole? It seems that

igneus commented 6 years ago

Sundays and ferials are uniquely identified by a combination of season, rank and season week

Not true at least for days

igneus commented 6 years ago

Now both temporale feasts are and sanctorale feasts can be (if data creator provides them) uniquely identified by Celebration#symbol.

The edge case mentioned in the comment above in my opinion belongs to the business logic of the liturgical books in question, not to the calendar layer, and the calendar already provides public interface sufficient to implement it. Therefore I consider this issue fixed.