Embodiments include methods, systems and computer program products for storing graph data for a directed graph in a relational database. Aspects include creating a plurality of relational tables for the graph data, using a processor on a computer, the plurality of relational tables including adjacency tables and attribute tables. Each row of the attribute tables is dedicated to a subject of the graph data in the dataset and stores a JavaScript Object Notation (JSON) object corresponding to the subject. Each row of the adjacency tables includes a hashtable containing properties and values of the subject for that row.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A computer program product for storing graph data for a directed graph in a relational database, the computer program product comprising: a non-transitory storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising: creating a plurality of relational tables for the graph data, wherein the graph data comprises a plurality of vertexes and a plurality of edges, wherein the plurality of relational tables include adjacency tables and attribute tables wherein: each row of the attribute tables is dedicated to a subject of the graph data in the dataset and stores a JavaScript Object Notation (JSON) object corresponding to the subject; and each row of the adjacency tables comprises a hashtable comprising properties and values of the subject for that row, wherein the hashtable further comprises an index value corresponding to a value shared by a plurality of edges originating from at least one vertex in the plurality of vertexes, wherein the index value further corresponds to a secondary adjacency table comprising edge data for edges originating from the at least one vertex in the plurality of vertexes; wherein the adjacency tables include: an incoming adjacency table, wherein each row of the incoming adjacency table is dedicated to one of the plurality of vertexes of the graph data and stores data regarding edges that terminate at that vertex; and an outgoing adjacency table, wherein each row of the outgoing adjacency table is dedicated to one of the plurality of the vertexes of the graph data and stores data regarding edges that originate at that vertex; receiving a query for traversing the graph data stored in the relational database; parsing the query into a set of ordered operations; translating each of the set of ordered operations into a fragment using a template selected based on an operation type, wherein the template comprises at least one of a common table expression fragment and a stored procedure; assembling the fragments into a single query; and transmitting the single query to the relational database for processing.
2. The computer program product of claim 1 , wherein the attribute tables includes a vertex attribute table, wherein each row of the vertex attribute table is dedicated to one of a plurality of vertexes of the graph data and stores a JavaScript Object Notation (JSON) object corresponding to that vertex.
3. The computer program product of claim 1 , wherein the attribute tables includes an edge attribute table, wherein each row of the edge attribute table is dedicated to one of the plurality of edges of the directed graph and stores a JavaScript Object Notation (JSON) object corresponding to that edge.
4. A processing system for storing graph data for a directed graph in a relational database, the system comprising a processor configured to: create a plurality of relational tables for the graph data, wherein the graph data comprises a plurality of vertexes and a plurality of edges, wherein the plurality of relational tables include adjacency tables and attribute tables wherein: each row of the attribute tables is dedicated to a subject of the graph data in the dataset and stores a JavaScript Object Notation (JSON) object corresponding to the subject; and each row of the adjacency tables comprises a hashtable comprising properties and values of the subject for that row, wherein the hashtables further comprises an index value corresponding to a value shared by a plurality of edges originating from at least one vertex in the plurality of vertexes, wherein the index value further corresponds to a secondary adjacency table comprising edge data for edges originating from the at least one vertex in the plurality of vertexes; wherein the adjacency tables include: an incoming adjacency table, wherein each row of the incoming adjacency table is dedicated to one of the plurality of vertexes of the graph data and stores data regarding edges that terminate at that vertex; and an outgoing adjacency table, wherein each row of the outgoing adjacency table is dedicated to one of a plurality of the vertexes of the graph data at stores data regarding edges that originate at that vertex; receiving a query for traversing the graph data stored in the relational database; parsing the query into a set of ordered operations; translating each of the set of ordered operations into a fragment using a template selected based on an operation type, wherein the template comprises at least one of a common table expression fragment and a stored procedure; assembling the fragments into a single query; and transmitting the single query to the relational database for processing.
5. The processing system of claim 4 , wherein the attribute tables includes a vertex attribute table, wherein each row of the vertex attribute table is dedicated to one of a plurality of vertexes of the graph data and stores a JavaScript Object Notation (JSON) object corresponding to that vertex.
6. The processing system of claim 4 , wherein the attribute tables includes an edge attribute table, wherein each row of the edge attribute table is dedicated to one of the plurality of edges of the directed graph and stores a JavaScript Object Notation (JSON) object corresponding to that edge.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
May 21, 2015
August 20, 2019
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.