flowchart TD A[Session] --> B(session_id) A --> C(date_time) A --> D(location) A --> E(type) A --> F(volume_ID)
Spreadsheet
About
This page documents work related to an overhaul of the Databrary 2.0 spreadsheet interface.
Data model
This section represents an informal attempt to capture the data model that underlies the Databrary spreadsheet. There are three main tables, Session, Person, and File, with two linking tables SessionPerson, and PersonFile.
Session
Person
flowchart TD A[Person] --> B(person_ID) A --> C(birthdate) A --> G(age_entered) A --> H(age_units) A --> D(gender) A --> E(race) A --> F(ethnicity)
File
flowchart TD A[File] --> B(file_ID) A --> C(file_type) A --> D(date_created) A --> E(permission)
PersonFile
flowchart TD A[PersonFile] --> B(personFile_ID) A --> C(person_ID) A --> D(file_ID)
SessionPerson
flowchart TD A[SessionPerson] --> B(sessionPerson_ID) A --> C(person_ID) A --> D(session_id)
Combined
flowchart TD A[Session] --> B(session_id) A --> C(date_time) A --> D(location) A --> E(type) A --> F(volume_ID) B --> H[SessionPerson] H --> I[Person] I --> J(person_ID) I --> L(birthdate) L --> R(age_calculated) I --> S(age_entered) C --> R J --> K[PersonFile] K --> O(file_ID) O --> Q[File] Q --> M(type) Q --> N(permission)
Here’s an alternative that uses Mermaid’s entity-relationship (erDiagram) syntax.
erDiagram
  SESSION ||--o{ PERSON : depicts
  SESSION {
    string sessionID
    string sessionDate
  }
  PERSON {
    string personID
    string birthDate
    string gender
  }
  SESSION ||--o{ FILE : contains
  FILE {
    string fileID
    string fileType
    string filePermission
  }
  PERSONFILE ||--|| PERSON: links
  PERSONFILE ||--|| FILE: links
  PERSONFILE {
    string ID
  }
Let’s try another that depicts the SETTING separately.
erDiagram
  SESSION ||--o{ PERSON : ""
  SESSION {
    string sessionID
    string sessionDate
  }
  PERSON {
    string personID
    string birthDate
    string gender
  }
  SESSION ||--o{ FILE : ""
  FILE {
    string fileID
    string fileType
    string filePermission
  }
  PERSONFILE ||--|| PERSON: ""
  PERSONFILE ||--|| FILE: ""
  PERSONFILE {
    string personFileID
  }
  SETTING ||--o{ FILE: ""
  SETTING {
    string settingID
    string settingType
    string lat
    string lon
    string city
    string state
    string county
    string country
  }
Finally, let’s consider MEASURES as separate from PERSON.
erDiagram
  PERSON {
    string personID
  }
  MEASURE {
    string measureID
    string measureName
    string measureType
    string measurePermission
  }
  PERSONMEASURE |{--|{ PERSON : ""
  PERSONMEASURE |{--|{ MEASURE : ""
  PERSONMEASURE {
    string personMeasureID
  }
Finally, we could consider a BIDS-inspired scheme:
Commentary
- Consider thinking about sessions as containers, as DB1 did or as collections of people and files.
- Consider desig
