Repository navigation
Data Model
Gunnar Schaefer edited this page Nov 2, 2015
·
25 revisions
This page contains a proposal for a streamlined and generalized SciTran data model as delivered by the RESTful API.
- Fields marked with † are only returned by detail endpoints, such as
/projects/123, but suppressed by list endpoints for efficiency, such as/projects. - Only italicized fields are guaranteed to be returned by all requests.
- Timestamps are in ISO 8601 format
| Field | Type | Description |
|---|---|---|
| _id | string | database ID |
| created | timestamp | creation time (automatically set) |
| modified | timestamp | modification time (automatically updated) |
| name | string | group name |
| roles | [Permission, …] | array of user roles |
| Field | Type | Description |
|---|---|---|
| _id | string | database ID |
| created | timestamp | creation time (automatically set) |
| modified | timestamp | modification time (automatically updated) |
| firstname | string | first name |
| lastname | string | last name |
| email address | ||
| avatar | URL | avatar image URL |
| avatars | object | map of available avatars |
| root | boolean | super admin flag |
| Field | Type | Description |
|---|---|---|
| provider | URL | OAuth provider avatar URL (automatically set) |
| gravatar | URL | Gravatar URL (automatically set) |
| custom | URL | user-defined avatar URL |
| Field | Type | Description |
|---|---|---|
| uid | string | database ID of permission holder |
| access | ro|rw|admin | access level |
| site | string | permission holder's scitran instance |
| Field | Type | Description |
|---|---|---|
| _id | string | database ID |
| created | timestamp | creation time (automatically set) |
| modified | timestamp | modification time (automatically updated) |
| views | integer | number of views (automatically updated) |
| downloads | integer | number of downloads (automatically updated) |
| notes | [Note, …] | array of Note objects |
| files | [File, …] | array of File objects |
| analyses† | [Analysis, …] | array of Analysis objects |
| permissions‡ | [Permission, …] | array of Permission objects |
| public | boolean | indicates whether or not container is public |
| label | string | application-specific label |
| tags | [string, …] | array of application-specific tags |
| metadata† | object | application-specific information |
‡ Only the permission of the requesting user is included for list requests and also for detail requests, if the current user does not have admin permissions.
| Field | Type | Description |
|---|---|---|
| group | string | database ID of project owner |
| Field | Type | Description |
|---|---|---|
| group | string | database ID of parent project owner |
| project | string | database ID of parent project |
| uid | string | data-derived unique ID |
| timestamp | string | data capture time |
| timezone | string | data capture time zone |
| subject | Subject | subject information |
| operator | string | operator name or ID |
| Field | Type | Description |
|---|---|---|
| firstname | string | first name |
| lastname | string | last name |
| firstname_hash | string | hash of first name |
| lastname_hash | string | hash of last name |
| sex | male|female | sex |
| age | int | age at time of session in seconds |
| code | string | subject code |
| tags | [string, …] | array of application-specific tags |
| metadata† | object | application-specific sub-document |
| Field | Type | Description |
|---|---|---|
| session | string | database ID of parent session |
| collections† | [string, …] | array of collection IDs |
| uid | string | data-derived unique ID |
| instrument | string | instrument type of primary data (e.g., MRI) |
| measurement | string | type of primary measurement |
| timestamp | string | data capture time |
| timezone | string | data capture time zone |
| Field | Type | Description |
|---|---|---|
| curator | string | user ID of collection creator |
| Field | Type | Description |
|---|---|---|
| _id | string | database ID |
| created | timestamp | creation time (automatically set) |
| modified | timestamp | modification time (automatically updated) |
| user | string | user ID of note writer |
| text | string | note text |
| Field | Type | Description |
|---|---|---|
| name | string | name of file |
| created | timestamp | creation time (automatically set) |
| modified | timestamp | modification time (automatically updated) |
| type | string | type of file (e.g., image, PDF, montage) |
| size | int | size of file |
| hash | string | hash of file |
| instrument | string | instrument type (e.g., MRI) |
| measurements | [string, …] | types of measurements |
| unprocessed | boolean | true if file has not been processed |
| tags | [string, …] | array of application-specific tags |
| metadata† | object | application-specific information |
| Field | Type | Description |
|---|---|---|
| … | ||
| tags | [string, …] | array of application-specific tags |
| metadata† | object | application-specific information |
- All documents missing "created" or "modified" fields will be given them, set to epoch
- Remove notes.timestamp, update notes.created and notes.modified accordingly
- Each file "datatypes" array will be combined with its "tags" array
- Delete file.datatypes field