This documentation provides an insight into the database structure of the Decision Model Tool and its elements.
Visual representation¶
Here is a visual representation of the database. The database can have several Project vertices which might not be connected through edges.
Database Overview¶
Data models¶
Elements of the database are defined as data models. and are found $DOTDIR/api/src/v0/models.
Metadata¶
All database components¶
- pydantic model MetaData[source]¶
Bases:
DOTModel
Metadata for database components. They are automatically generated.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "MetaData", "description": "Metadata for database components. They are automatically generated.", "type": "object", "properties": { "version": { "default": "v0", "title": "Version", "type": "string" }, "uuid": { "format": "uuid", "title": "Uuid", "type": "string" } }, "additionalProperties": false }
- field version: str = 'v0'¶
version of the database
- field uuid: UUID [Optional]¶
Unique identifier of the vertex
Vertices¶
- pydantic model VertexMetaData[source]¶
Bases:
MetaData
Metadata for Vertices. They are automatically generated.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "VertexMetaData", "description": "Metadata for Vertices. They are automatically generated.", "type": "object", "properties": { "version": { "default": "v0", "title": "Version", "type": "string" }, "uuid": { "format": "uuid", "title": "Uuid", "type": "string" }, "timestamp": { "title": "Timestamp", "type": "number" }, "date": { "format": "date-time", "title": "Date", "type": "string" }, "ids": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "test", "title": "Ids" } }, "additionalProperties": false }
- field timestamp: float [Optional]¶
Timestamp at vertex creation
- field date: datetime [Optional]¶
Date at vertex creation
- field ids: str | None = 'test'¶
Partition key for Azure cosmos DB
- field version: str = 'v0'¶
version of the database
- field uuid: UUID [Optional]¶
Unique identifier of the vertex
Edges¶
- pydantic model EdgeMetaData[source]¶
Bases:
MetaData
Metadata for Edges. They are automatically generated.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "EdgeMetaData", "description": "Metadata for Edges. They are automatically generated.", "type": "object", "properties": { "version": { "default": "v0", "title": "Version", "type": "string" }, "uuid": { "format": "uuid", "title": "Uuid", "type": "string" } }, "additionalProperties": false }
Project¶
- pydantic model ProjectCreate[source]¶
Bases:
DOTModel
Project data model
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "ProjectCreate", "description": "Project data model", "type": "object", "properties": { "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Name" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Description" }, "tag": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Tag" }, "decision_maker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Decision Maker" }, "decision_date": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Decision Date" }, "sensitivity_label": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "Restricted", "title": "Sensitivity Label" }, "index": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Index" } }, "additionalProperties": false, "examples": [ { "decision_date": "2021-01-01", "decision_maker": "John Doe", "description": "This is a project example", "index": "0", "name": "the little project example", "sensitivity_label": "Restricted", "tag": "subsurface" } ], "required": [ "name" ] }
- field name: str | None [Required]¶
Name of the project
- field description: str | None = None¶
Description of the project
- field tag: list[str] | None = None¶
List of user input keywords
- field decision_maker: str | None = None¶
Name of the decision maker
- field decision_date: str | None = None¶
Date by which the project needs to be ended
- field sensitivity_label: str | None = 'Restricted'¶
Security level of the project (Open, Internal, Restricted, Confidential)
- field index: str | None = None¶
Index of the project
Opportunity¶
- pydantic model OpportunityCreate[source]¶
Bases:
DOTModel
Opportunity data model
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "OpportunityCreate", "description": "Opportunity data model", "type": "object", "properties": { "description": { "title": "Description", "type": "string" }, "tag": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Tag" }, "index": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Index" } }, "additionalProperties": false, "examples": [ { "description": "opportunistic opportunity", "index": "0", "tag": [ "subsurface" ] } ], "required": [ "description" ] }
- field description: str [Required]¶
Description of the opportunity
- field tag: list[str] | None = None¶
List of user input keywords
- field index: str | None = None¶
Index of the opportunity
Objective¶
- pydantic model ObjectiveCreate[source]¶
Bases:
DOTModel
Objective data model
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "ObjectiveCreate", "description": "Objective data model", "type": "object", "properties": { "description": { "title": "Description", "type": "string" }, "hierarchy": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Hierarchy" }, "tag": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Tag" }, "index": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Index" } }, "additionalProperties": false, "examples": [ { "description": "objectively objecting the objectives", "hierarchy": "Fundamental", "index": "0", "tag": [ "subsurface" ] } ], "required": [ "description" ] }
- field description: str [Required]¶
Description of the opportunity
- field hierarchy: str | None = None¶
Hierarchy of the opportunity (Strategic, Fundamental, Mean)
- field tag: list[str] | None = None¶
List of user input keywords
- field index: str | None = None¶
Index of the objective
Issue¶
- pydantic model IssueCreate[source]¶
Bases:
IssueValidator
Issue data model
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "IssueCreate", "description": "Issue data model", "type": "object", "properties": { "description": { "title": "Description", "type": "string" }, "shortname": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Shortname" }, "category": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Category" }, "tag": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Tag" }, "keyUncertainty": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Keyuncertainty" }, "decisionType": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Decisiontype" }, "probabilities": { "anyOf": [ { "$ref": "#/$defs/ProbabilityData" }, { "type": "null" } ], "default": null }, "alternatives": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Alternatives" }, "boundary": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Boundary" }, "comments": { "anyOf": [ { "items": { "$ref": "#/$defs/CommentData" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Comments" }, "influenceNodeUUID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Influencenodeuuid" }, "index": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Index" } }, "$defs": { "CommentData": { "additionalProperties": false, "description": "Model for comments on issues", "properties": { "comment": { "title": "Comment", "type": "string" }, "author": { "title": "Author", "type": "string" } }, "required": [ "comment", "author" ], "title": "CommentData", "type": "object" }, "ProbabilityData": { "additionalProperties": false, "description": "Model for the probability description", "properties": { "dtype": { "title": "Dtype", "type": "string" }, "probability_function": { "anyOf": [ { "items": { "items": { "type": "number" }, "type": "array" }, "type": "array" }, { "items": { "items": { "type": "null" }, "type": "array" }, "type": "array" } ], "title": "Probability Function" }, "variables": { "additionalProperties": { "items": { "type": "string" }, "type": "array" }, "title": "Variables", "type": "object" } }, "required": [ "dtype", "probability_function", "variables" ], "title": "ProbabilityData", "type": "object" } }, "additionalProperties": false, "examples": [ { "alternatives": "[\"do or do not\", \"there is no try\"]", "boundary": "in", "category": "Decision", "comments": { "author": "John Doe", "comment": "Question: is this correct?" }, "decisionType": "tactical", "description": "this is an issue to call yours", "index": "0", "influenceNodeUUID": "123", "keyUncertainty": "true", "probabilities": { "dtype": "DiscreteUnconditionalProbability", "probability_function": [ [ 0.5, 0.5 ], [ 0.4, 0.6 ] ], "variables": { "Node1": [ "Outcome1", "Outcome2" ], "Node2": [ "Outcome21", "Outcome22" ] } }, "shortname": "thelitissue", "tag": [ "subsurface" ] } ], "required": [ "description" ] }
- Validators:
- field description: str [Required]¶
Description of the issue
- field shortname: str | None = None¶
Name of the issue. It should be given for at least all issues which will appear in the influence diagram and should be short as it will be displayed there
- field category: str | None = None¶
- field tag: list[str] | None = None¶
List of user input keywords
- field keyUncertainty: str | None = None¶
In case the issue is an uncertainty, true if it is a key uncertainty, false otherwise
- field decisionType: str | None = None¶
In case the issue is a decision, type of decision (Strategic, Focus, Tactical)
- field probabilities: ProbabilityData | None = None¶
In case the issue is an uncertainty, probability description
- field alternatives: list[str] | None = None¶
In case the issue is a decision, list of alternatives
- field boundary: str | None = None¶
Boundary of the issue (in, on, or out)
- field comments: list[CommentData] | None = None¶
List of comments added to the issue
- field influenceNodeUUID: str | None = None¶
Deprecated
- field index: str | None = None¶
Index of the opportunity
Edge¶
- pydantic model EdgeCreate[source]¶
Bases:
DOTModel
Edge data model. They are directed edge and have thus a tail and a head vertex.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "EdgeCreate", "description": "Edge data model. They are directed edge and have thus a tail and a head vertex.", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "outV": { "title": "Outv", "type": "string" }, "inV": { "title": "Inv", "type": "string" }, "label": { "default": "", "title": "Label", "type": "string" } }, "additionalProperties": false, "examples": [ { "id": "22222222-bbbb-eeee-aaaa-333333333333", "inV": "11111111-aaaa-2222-bbbb-888888888888", "label": "contains", "outV": "44444444-0000-1111-ffff-cccccccccccc" } ], "required": [ "id", "outV", "inV" ] }
- field id: str [Required]¶
identifier of the edge (same as uuid, generated by Gremlin)
- field outV: str [Required]¶
UUID of tail vertex
- field inV: str [Required]¶
UUID of head vertex
- field label: str = ''¶
Label of the edge. Can be ‘contains’, ‘influences’, ‘has_value_metric, or ‘merged_into’. ‘contains’ means a project contains a vertex, ‘influences’ means a vertex influences another vertex (e.g. an uncertaintyinfluences a decision), ‘has_value_metric’ means an objective may have a Value Metric issue, and ‘merged_into’ means two issues may be merged into a merged issue.