Data Model¶
The data model includes:
Sample
Container
For each type we document here the formal schema, given as a JSON schema. When objects are created or updated, the proposed change is validated against the corresponding schema and rejected if it fails to satify it.
Sample¶
{
"properties": {
"uuid": {
"type": "string",
"description": "Globally unique ID"
},
"revision": {
"type": "integer",
"description": "Revision number"
},
"name": {
"type": "string",
"description": "Sample name",
"minLength": 0
},
"projects": {
"type": "array",
"items": {"type": "string"},
"description": "List of foreign keys to Projects"
},
"composition": {
"type": "string",
"description": "Sample composition (IUCr specification)"
},
"tags": {
"type": "array",
"items": {"type": "string"},
"description": "Arbitrary useful labels"
},
"description": {
"type": "string",
"description": "Longer sample description"
}
},
"additionalProperties": false,
"required": [
"uuid",
"revision",
"name"
],
"type": "object",
"description": "Document created for a single sample"
}
Container¶
{
"properties": {
"uuid": {
"type": "string",
"description": "Globally unique ID"
},
"revision": {
"type": "integer",
"description": "Revision number"
},
"kind": {
"type": "string",
"description": "Type of the container"
},
"name": {
"type": "string",
"description": "Container name"
},
"contents": {
"type": "object",
"description": "Maps a Sample Foreign key to a location"
}
},
"additionalProperties": false,
"required": [
"uuid",
"revision",
"name"
],
"type": "object",
"description": "Document created for group of containers."
}
Project¶
{
"properties": {
"uuid": {
"type": "string",
"description": "Globally unique ID"
},
"revision": {
"type": "integer",
"description": "Revision number"
},
"name": {
"type": "string",
"description": "Project name"
},
"owners": {
"type": "array",
"description": "Foreign key to an Owner"
}
}
}
Owner¶
{
"properties": {
"uuid": {
"type": "string",
"description": "Globally unique ID"
},
"revision": {
"type": "integer",
"description": "Revision number"
},
"name": {
"type": "string",
"description": "Project name"
},
"institutions": {
"type": "array",
"description": "List of institutions"
}
}
}
Institution¶
{
"properties": {
"uuid": {
"type": "string",
"description": "Globally unique ID"
},
"revision": {
"type": "integer",
"description": "Revision number"
},
"name": {
"type": "string",
"description": "Project name"
}
}
}