Skip to main content

Table Schema

When using SQL database, a very important aspect is table schema. Presently for comment system the table schema has to support association of graph with comments, comments association with nodes and edges. Also later we came up with the idea of pinned comments where the user can pin some comments and revisit them later. So the table schema was designed as below:

  1. Comment table for storing comments.
  2. CommentToNode table for association between nodes and comments.
  3. CommentToEdge table for association between nodes and comments.
  4. PinComment table for association between users and their pinned comments.
 Comment table schema is as follows:
Column Name
Data Type
Description
message
string
Comment message
owner_email
string
Email Id of user who
created the comment.
graph_id
Integer
Id of the graph on which the comment is
being created
parent_comment_id
Integer
If the comment is the parent then it’s value
is NULL otherwise comment is a reply to 
some other comment and parent-id exists
for the comment.
is_resolved
Integer
Value is 0 if the comment is resolved
otherwise 1.
Comment is a weak entity because it cannot exist without a graph. So there is no association table for comment and graph and graph_id attribute is added in the Comment table.

CommentToNode table schema is as follows:
Column Name
Data Type
Description
comment_id
Integer
Id of comment.
node_id
Integer
Id of node on which the comment is made.
Multiple entries will be present in this table if a comment is associated with more than one node.

 CommentToEdge table schema is as follows:
Column Name
Data Type
Description
comment_id
Integer
Id of comment
edge_id
Integer
Id of edge on which the comment is made.
Multiple entries will be present in this table if a comment is associated with more than one edge.

 PinComment table schema is as follows:
Column Name
Data Type
Description
comment_id
Integer
Id of comment
owner_email
string
Email Id of the user who pinned the comment.
For pinning comments we store email of the user who pinned the comment and id of the comment.

Comments

Popular posts from this blog

Project Introduction

Comment System for GraphSpace Organization : National Resource for Network Biology (NRNB) GraphSpace is an user-friendly web-based platform that collaborating research groups can utilize for storage, interaction, and network sharing. A GraphSpace user can import graphs created in Cytoscape , upload them through a REST API, interact with them by customizing and saving layouts, share them within and between groups of collaborators, search for different graphs, and organize them using tags. These functions are enabled through GraphSpace’s comprehensive REST API, which allows users to communicate. Several research groups and people using GraphSpace would like not only to visualize the graph but also discuss about different nodes, edges and subgraphs present in the graph. Effective discussion about the graphs can be promoted with the help of comments. The aim of this project is to implement a real-time system that will allow users to comment on graphs and discuss ideas with each...