IdentityData
Class that holds data for a person.
Note: this design is generic enough to handle some interesting and illustrative cases, but it is simplistic and would not scale for may real-life scenarios!
Data is split in two parts: core data and records. Core data contains information that is shared across most credentials and is common for all people: name, date of birth, etc. On the other hand, records are specialized pieces of data, each of which contains information about a particular event in person's life (e.g. graduation) or some kind of grant (i.e. driving privileges).
Core data maps core field name (such as "family_name") to a particular piece of data.
Records map record type to a map that holds all of the person's records of a given type indexed by unique record ids. Even though for certain record types (e.g. diving privileges) multiple records of that type do not make much sense, for other record types (e.g. graduations) they are necessary and the structure is the same in all cases. While DataItem that holds record data can be of any cbor type, in most cases it is a map.
Note that records in general do not correspond to credentials 1:1. For instance, one could have a credential that certifies that a person does not have any criminal records on file.