Skip to content

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

Group

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

User

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 email email address
avatar URL avatar image URL
avatars object map of available avatars
root boolean super admin flag

Avatars (subdocument only)

Field Type Description
provider URL OAuth provider avatar URL (automatically set)
gravatar URL Gravatar URL (automatically set)
custom URL user-defined avatar URL

Permission (subdocument only)

Field Type Description
uid string database ID of permission holder
access ro|rw|admin access level
site string permission holder's scitran instance

Container

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.

Project (extends Container)

Field Type Description
group string database ID of project owner

Session (extends Container)

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

Subject (subdocument only)

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

Acquisition (extends Container)

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

Collection (extends Container)

Field Type Description
curator string user ID of collection creator

Note (subdocument only)

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

File (subdocument only)

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

Analysis (currently undefined)

Field Type Description
…
tags [string, …] array of application-specific tags
metadata† object application-specific information

Migration steps (currently incomplete)

  • 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

Clone this wiki locally