🐬 MySQL ⛁ relational database connection to the 🖇 pathchain
This design document explains the relational database structure on how the pathchain is connected to the user interface features. It is very helpful to look at in order to understand the recursive properties of the tracking nature of pathos.cloud.
This is the seed for the primal feature of ☁ pathos.cloud that is a user posting a path.
☁ pathos.cloud::= It is a tool to build paths of data and knowledge that are cryptographically secured by being tied into healthy backtracking-able origin chains. This tool is currently a web application where path-crafting is done manually.
⛁ relational database::=⛁ RDB::= 🐬 MySQL relational database that stores the pointers to the🖇 pathchainhashes and holds a minimalistic table infrastructure to manage the login and posting features for the user interface.
🖇 pathchain::= The pathchain is the abstract representation of the digital trees of knowledge on☁ pathos.cloud.
The tables of the ⛁ RDB
This a representation on how the active entites on the system relate to each other (an entity-relationship model of the RDB).
The active tables' references: entity 👾, user 👤, node, path, label, link, skeleton, post, action 🕹️.
☁ pathos.cloud API REST TABLE DOCUMENTATION:
Entities are the ones who post on pathos.cloud. They can be human users, human user extensions, organizations of humans or bots
SQL definition:
`id` varchar(64) NOT NULL,
`ancestor_id` varchar(64) NOT NULL,
`secret_id` varchar(64) NOT NULL,
`type_id` varchar(64) NOT NULLRelationships
The entity.ancestor_id field
requiresan existing entity record.The entity.type_id field
requiresan existing entity type record.The entity.secret_id field
requiresan existing secret record.
This is a Type seeder table that serves as a catalogue for entity types
Types: USER, BOT, ORGANIZATION, COMMUNITY
Secrets are hashes that represent unique tokens to perform actions at several layers on the pathchain.
SQL Definition
`id` varchar(64) NOT NULL,
`owner_id` varchar(64) NOT NULL,
`password` varchar(255),
`receiver_id` varchar(64),
`type_id` INT NOT NULL,
`used` varchar(64)Relationships
The secret.owner_id field
requiresan existing entity record.The secret.receiver_id field
requiresan existing entity record.The secret.type_id field
requiresan existing secret record.
This is a Type seeder table that serves as a catalogue for entity types
Types: INVITE_SECRET, TOKEN
The user tables keep the record to manage the login process while taking care of the integrity of the user related to the entity chain on the patchain.
SQL Definition
`id` varchar(64) NOT NULL,
`entity_id` varchar(64) NOT NULL,
`login` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`username` varchar(255) NOT NULLRelationships
The user.entity_id field
requiresan existing entity record.
Nodes are the prime elements of paths.
Node representation
SQL definition:
`id` varchar(64) NOT NULL,
`ancestor_id` varchar(64) NOT NULL,
`owner_id` varchar(64) NOT NULLRelationships:
The node.ancestor_id field
requiresa existing node record.The node.owner_id field
requiresan existing entity record.
Labels are the classification elements of the pathchain.
Single label representation
Labels can classify each other recursively. This feature allows a multi-dimensional classification structure for paths. Label relevance depends on context and how users rank them.
Nested label representation
SQL definition:
`id` varchar(64) NOT NULL,
`ancestor_id` varchar(64) NOT NULL,
`name` varchar(255) DEFAULT '',
`owner_id` varchar(64) NOT NULLRelationships:
The label.ancestor field
requiresan exisging label record.The label.owner field
requiresan existing entity record.
Linear path representation
The first node with the red dot is the head of the path
SQL definition:
`id` varchar(64) NOT NULL,
`ancestor_id` varchar(64) NOT NULL,
`head_id` varchar(64) NOT NULL,
`owner_id` varchar(64) NOT NULLRelationships:
The path.ancestor_id field
requiresan existing path record.The path.head_id field
requiresan existing link record.The path.owner_id field
requiresan existing entity record.
Links are the representation of all the bonds inside the pathchain. The pathchain can be described as a tree with labels.
The tree is just a path of bonded paths. Paths come from bonded nodes that can be bonded to paths and paths of bonded paths.
All links look the same in SQL structure:
`id` varchar(64) NOT NULL,
`next_id` varchar(64) NOT NULL,
`prev_id` varchar(64) NOT NULL,
`target_id` varchar(64) NOT NULL,
`type_id` varchar(64) NOT NULLRelationships:
The link.next_id field
requiresa link. When the link is the last element of a path, link.next_id should point to the link.id itself.The link.prev_id field
requiresa link. When the link is the head of a path, link.prev_id should point to the link.id itself.The link.target_id field
requiresa path, node or label field.
This is how paths of any dimension can be built through link connections using the links
node ➡ path of paths link representation
node ➡ path of paths of paths link representation
path of paths ➡ path of paths link representation
label ➡ path of paths link representation
Skeletons are a pair of paths, one of labels and another one of nodes and paths. Skeletons are dictionaries of data structures where the labels define the meaning for who are using them.
Skeleton representation
SQL definition:
`id` varchar(64) NOT NULL,
`ancestor_id` varchar(64) NOT NULL,
`name` varchar(255) DEFAULT '',
`keys_head_id` varchar(64) NOT NULL,
`vals_head_id` varchar(64) NOT NULL,
`owner_id` varchar(64) NOT NULLRelationships:
The skeleton.ancestor_id field
requiresan existing skeleton record.The skeleton.keys_head_id field
requiresan existing path record.The skeleton.keys_vals_id field
requiresan existing path record.The skeleton.owner_id field
requiresan existing entity record.
Posts are elements that hold nodes and paths. They are posted by entities and they allow other users to interact with them and also branch or mirror content into new connected posts coming from them.
SQL definition:
`id` varchar(64) NOT NULL,
`ancestor_id` varchar(64) NOT NULL,
`target_id` varchar(64) NOT NULL,
`title` varchar(255) DEFAULT '',
`owner_id` varchar(64) NOT NULLRelationships:
The post.ancestor_id field
requiresan existing post record.The post.target_id field
requiresan existing link or node record.The path.owner_id field
requiresan existing entity record.
Actions are performed by entities in relationships with posts. They could be understood better by assuming the preffix "to" to them in relationship with a post c:
SQL Definition
`id` varchar(64) NOT NULL,
`message` varchar(255) DEFAULT '',
`moment` varchar(255) DEFAULT '',
`owner_id` varchar(64) NOT NULL,
`post_id` varchar(64) NOT NULL,
`type_id` INT NOT NULLRelationships
The action.owner_id field
requiresan existing entity record.The action.post_id field
requiresan existing post record.The action.type_id field
requiresan existing action type record.
This is a Type seeder table that serves as a catalogue for entity types
Types: SHARE, HOLD, OWN, CREATE, INTERACT, CONNECT, LABEL
A connection connects one post with another
SQL Definition
`id` varchar(64) NOT NULL,
`action_id` varchar(64) NOT NULL,
`message` varchar(255) DEFAULT '',
`post_id` varchar(64) NOT NULL,
`type_id` INT NOT NULLRelationships
The connection.action_id field
requiresan existing action record.The connection.post_id field
requiresan existing post record.The connection.type_id field
requiresan existing connection type record.
This is a Type seeder table that serves as a catalogue for entity types
Types: CONNECTION, REFLECTION, MUTATION
Measurable things user do with posts
SQL Definition
`id` varchar(64) NOT NULL,
`action_id` varchar(64) NOT NULL,
`message` varchar(255) DEFAULT '',
`references_id` varchar(64),
`type_id` INT NOT NULL,
`value` varchar(255) DEFAULT ''Relationships
The interaction.action_id field
requiresan existing action record.The interaction.references_id field
requiresan existing skeleton record.The interaction.type_id field
requiresan existing interaction type record.
This is a Type seeder table that serves as a catalogue for entity types
Types: COMMENT, VOTE_UP, VOTE_DOWN, ⚡
These tables contain the minimum expression to represent the "do-able" things in pathos.cloud. They're the minimum catalog of types for the system to operate with a login and a posting platform behaviour. The seeders are pretty self-explaining for the kind of information that they're supposed to label. Altough the labels do exist in pathos.cloud, this is an attempt to cut down a lot of redundancies that will cause a lot of problems.
All of the following tables share the following structure described in SQL:
`id` integer(64) NOT NULL,
`name` varchar(64) NOT NULLAPPENDIX: CLASS DIAGRAM & RDB
http://pathos.cloud/secrets/pioneer/
{
"message": "GET PIONEER SECRET",
"pioneer": {
"birthday": "moments/18fe44feca315e346964887a21364f71943153cb76b66a0aebf9b1d02cdc736f",
"register": "moments/bb37cc06cdaf8f393bfbe18db68a7f95d04d6ed9edeaddfc85db8ac8cf39873c",
"invite": "users/cad25e0c5864e597fdf45ea13a3a11ce8e46ddaee060de91d2a82e8e649d0cb4",
"tag": "users/cad25e0c5864e597fdf45ea13a3a11ce8e46ddaee060de91d2a82e8e649d0cb4"
},
"results": {
"register": "moments/7d4d3131fcd20e606090d91f3bdc0d4831798e6af24001ee25dcac8a6426a50c",
"author": "pioneer/cad25e0c5864e597fdf45ea13a3a11ce8e46ddaee060de91d2a82e8e649d0cb4",
"used": false,
"tag": "secrets/4acda9de3b4720ecf504f7661f2ce47180226af4380a40507eea0e2a37012ed0"
}
}