bridge2ai / standards-schemas

Data schema for Bridge2AI Standards.
https://bridge2ai.github.io/standards-schemas/
MIT License
2 stars 2 forks source link

Add container classes #8

Closed caufieldjh closed 1 year ago

caufieldjh commented 1 year ago

Container classes allow sets of data objects to be defined together, like in this example borrowed from the LinkML tests:

persons:
  - id: P:001
    name: fred bloggs
    age_in_years: 33
  - id: P:002
    name: joe schmoe
    has_employment_history:
      - employed_at: ROR:1
        started_at_time: 2019-01-01
        is_current: true

In that example, the schema defines the container like this:

classes:
  Dataset:
    attributes:
      persons:
        range: Person
        inlined: true
        inlined_as_list: true
        multivalued: true

It could also look like:

classes:
  Container:
    tree_root: true
    slots:
      - name
      - persons
      - organizations
      - places

slots:
  persons:
    range: Person
    inlined: true
    inlined_as_list: true
    multivalued: true

The containers could be defined in a generic way for standards-schemas within standards_schema_all.yaml, but that limits some of the point of having the schemas treated as different modules. The modules could still have their own container types, defined in each schema.