TECHNICAL FIELD

This disclosure relates generally to data processing and, in particular, to querying graph data from a relational database, and more particularly, ad-hoc graph definition from input tables in a stored procedure.

BACKGROUND

A database may be configured to store data in accordance with a database schema. For example, in a graph database, data may be represented and stored using graph structures including, for example, vertices, directed edges, undirected edges, and/or the like. Notably, the graph database may store the relationships between different data items explicitly. For instance, the vertices of a graph may correspond to the individual data items stored in the graph database while the edges of the graph may define the relationships between these data items. Attributes associated with the vertices and/or the edges may provide additional properties for the data items stored in the graph database and/or the relationships that exist between different data items.

By contrast, a relational database may store the relationships between different data items implicitly, for example, by organizing the data items into one or more database tables. Each database table may store a set of data items referred to as a relation. Furthermore, the rows of the database table may hold individual data items while the columns of the database table may hold the attributes that are present in each of the data items. Meanwhile, relationships between data items residing in different database tables may be implicitly defined by cross referencing the key that is associated with each data item in the relational database. For instance, a first database table may store the keys of data items from a second database table, thereby linking data items held in two separate database tables. Alternately and/or additionally, data items from the first database table and the second database table may be linked via a third database table storing the keys of data items from both the first database table and the second database table.

SUMMARY

In some implementations, the current subject matter relates to a computer-implemented method for generating graphs using a stored procedure. The method may include generating one or more graph data tables, and generating a procedure having a predetermined name. One or more inputs to the generated procedure may include the generated one or more graph data tables. The generated procedure may include one or more graph objects. The graph data tables may be configured to be input to the graph objects. The method may further include storing the generated procedure, and executing, using one or more graph data stored in a graph database, the stored generated procedure.

In some implementations, the current subject matter may include one or more of the following optional features. Execution of the stored generated procedure may be configured to include inserting the graph data stored in the graph database108into the generated graph tables (e.g., vertex tables, edge tables, etc.), and executing the stored generated procedure using the inserted graph data. In some implementations, the graph data tables may include at least one of the following: one or more vertex tables, one or more edge tables, and any combination thereof.

In some implementations, execution of the stored generated procedure may be further configured to include calling the stored generated procedure using predetermined name (e.g., adhocGraphExample).

In some implementations, the method may include executing, using one or more another graph data stored in the graph database, the stored generated procedure. The other graph data may be different from the graph data that may have been used during previous call of the procedure.

In some implementations, the generated procedure may be generated using one or more graph workspace objects. Further, the graph data may include at least one of the following: one or more vertices, one or more edges, and any combination thereof.

In some implementations, the method may further include executing one or more graph algorithms using the one or more graph data objects. The graph algorithms may include at least one of the following: a user-defined graph algorithm, a built-in graph algorithm, and any combination thereof.

Non-transitory computer program products (i.e., physically embodied computer program products) are also described that store instructions, which when executed by one or more data processors of one or more computing systems, causes at least one data processor to perform operations herein. Similarly, computer systems are also described that may include one or more data processors and memory coupled to the one or more data processors. The memory may temporarily or permanently store instructions that cause at least one processor to perform one or more of the operations described herein. In addition, methods can be implemented by one or more data processors either within a single computing system or distributed among two or more computing systems. Such computing systems can be connected and can exchange data and/or commands or other instructions or the like via one or more connections, including but not limited to a connection over a network (e.g., the Internet, a wireless wide area network, a local area network, a wide area network, a wired network, or the like), via a direct connection between one or more of the multiple computing systems, etc.

The details of one or more variations of the subject matter described herein are set forth in the accompanying drawings and the description below. Other features and advantages of the subject matter described herein will be apparent from the description and drawings, and from the claims.

