A method, device and storage medium for querying graph data
By constructing query maps and parsing query conditions through visual operations, it solves the complexity problem of existing graph query languages, realizes low-threshold graph data query and intuitive result display, and improves user experience.
Patent Information
- Application Number
- CN202010579437.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-23
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-06-23
AI Technical Summary
The syntax of existing graph query languages is complex and the threshold for use is high. Users need to have a clear understanding of the data structure and attributes, making it difficult to query graph data.
Construct a query graph through visual image operation instructions, including node components and edge components, parse query conditions and graphically display query results on the display interface, lowering the threshold for users to learn complex syntax.
It realizes the query task of users describing complex graph structures through simple graphical operations, intuitively displays the query results, has low usage threshold and high user experience.
Smart Images

Figure CN111931001B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method and device for querying graph data and a computer-readable storage medium. Background Art
[0002] At present, knowledge graphs use graph queries to retrieve knowledge from knowledge bases, discover new knowledge, and support various intelligent applications. They have been widely used in finance, commerce, life, manufacturing and other fields. They use graph queries to retrieve knowledge from knowledge bases, discover new knowledge, and support various intelligent applications.
[0003] In the prior art, the query task of graph data is mainly described by graph query language. There are currently three mainstream graph query languages: Cypher, W3C standard SPARQL, and Apache standard Tinkerpop / Gremlin. However, the syntax of these graph query languages is relatively complex and the threshold for use is high. At the same time, when using them, users are required to have a clear understanding of the structure and attributes of the data. Summary of the invention
[0004] In order to solve the above-mentioned problems existing in existing graph data queries, the embodiments of the present invention creatively provide a graph data query method, device and computer-readable storage medium.
[0005] According to a first aspect of the present invention, a method for querying graph data is provided, the method comprising: constructing a query graph based on operation instructions of a visual image, the query graph comprising at least node components for representing data objects and edge components for representing logical relationships between the node components; parsing query conditions of the query graph, and executing a graph query task based on the parsing; and graphically displaying the query results on a display interface.
[0006] According to one embodiment of the present invention, a query graph is constructed based on the operation instructions of a visualization image, including: based on the triggering operation instructions for the node components, displaying the node components on the graph query task interface; based on the setting of the logical relationship between the node components, displaying the edge components used to characterize the logical relationship between the nodes on the graph query task interface; based on the setting of the attribute option, configuring the attributes of the node component or the edge component.
[0007] According to an embodiment of the present invention, the node component includes a physical node or a conceptual node; the edge component includes a fixed edge or an indefinite edge.
[0008] According to one embodiment of the present invention, the constructing of the query graph further includes: based on the operation instruction of the constructed first query graph in the graph query task interface, the first query graph is nested and configured as a subgraph.
[0009] According to an embodiment of the present invention, graphically displaying the query results on the display interface includes: graphically displaying the query results on the display interface in real time; or graphically displaying the query results on the display interface based on the triggering of a query instruction.
[0010] According to the second aspect of the present invention, a graph data query device is also provided, which includes: a construction module, which is used to construct a query graph based on the operation instructions of the visual graphics, and the query task graph at least includes node components for representing data objects and edge components for representing the logical relationship between each node component; an execution module, which is used to parse the query conditions of the query graph and execute the graph query task according to the analysis; a display module, which is used to graphically display the query results on the display interface.
[0011] According to one embodiment of the present invention, the construction module is specifically used to display the node component in the graph query task interface based on the trigger operation instruction of the node component; based on the setting of the logical relationship between the node components, display the edge component used to characterize the logical relationship between the node components in the graph query task interface; based on the attribute option setting, configure the attributes of the node component or edge component.
[0012] According to one embodiment of the present invention, the construction module is further used to nest the first query graph as a subgraph based on the operation instructions for the constructed first query graph in the graph query task interface.
[0013] According to an embodiment of the present invention, the display module is specifically used to graphically display the query results on the display interface in real time; or, graphically display the query results on the display interface after the query instruction is submitted.
[0014] According to a third aspect of the present invention, a computer-readable storage medium is provided, wherein the storage medium comprises a set of computer-executable instructions, and when the instructions are executed, the instructions are used to execute any of the above-mentioned graph data query methods.
[0015] The query method, device and computer-readable storage medium for graph data in the embodiments of the present invention first construct a query graph based on the operation instructions of the visual image, wherein the query graph includes at least a node component for representing the data object and an edge component for representing the logical relationship between each node component; then the query conditions of the query graph are parsed, and the graph query task is executed according to the parsed conditions; and then the query results are graphically displayed on the display interface. In this way, the present invention constructs a query graph through the operation instructions of the visual image to perform a visual description of the graph query task, allowing the user to describe the query task of a complex graph structure completely through simple graphical operations; at the same time, the query results can be intuitively visualized, with a low threshold for user use, convenience and high user experience.
[0016] It should be understood that the teachings of the present invention are not required to achieve all of the beneficial effects described above, but specific technical solutions can achieve specific technical effects, and other embodiments of the present invention can also achieve beneficial effects not mentioned above. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:
[0018] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0019] Figure 1 The following is a schematic diagram showing the implementation process of the query method of the graph data in the embodiment of the present invention. Figure 1 ;
[0020] Figure 2 A schematic diagram of a query task interface of an application example of the present invention is shown;
[0021] Figure 3 A schematic diagram showing a specific implementation flow of a method for querying graph data of an application example of the present invention is shown;
[0022] Figure 4 A graphical display effect diagram of a query result of an application example of the present invention is shown;
[0023] Figure 5 The following is a schematic diagram showing the implementation process of the query method of the graph data in the embodiment of the present invention. Figure 2 ;
[0024] Figure 6 The following is a schematic diagram showing the implementation process of the query method of the graph data in the embodiment of the present invention. Figure 3 ;
[0025] Figure 7 The following is a schematic diagram showing the implementation process of the query method of the graph data in the embodiment of the present invention. Figure 4 ;
[0026] Figure 8 A schematic diagram showing the composition structure of a query device for graph data according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0027] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
[0028] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0029] Figure 1 The following is a schematic diagram showing the implementation process of the query method of the graph data in the embodiment of the present invention. Figure 1 ; Figure 2 A schematic diagram of a query task interface of an application example of the present invention is shown; Figure 3 A schematic diagram showing a specific implementation flow of a method for querying graph data of an application example of the present invention is shown; Figure 4 A graphical display effect diagram of a query result of an application example of the present invention is shown.
[0030] refer to Figure 1 An embodiment of the present invention provides a method for querying graph data, the method comprising: operation 101, constructing a query graph based on operation instructions of a visualization image; operation 102, parsing query conditions of the query graph, and executing a graph query task according to the parsing; operation 103, graphically displaying the query results on a display interface.
[0031] The query graph at least includes a node component for representing a data object and an edge component for representing a logical relationship between the node components. In practical applications, there are also query graphs that only include one or more node components for representing data objects.
[0032] Here, node components can usually include two types: entity nodes or concept nodes. Entity nodes are nodes with identification ID numbers that specify data objects; concept nodes require users to specify one or more types in the node configuration panel. When users specify certain types, attributes of these types will appear in the drop-down list of the configuration panel, allowing users to set the conditional range of the attributes. For example, when a user specifies that the type of a concept node is a dish, the drop-down list of the configuration panel will show the attribute 0 taste and the attribute 1 dish of the dish type, so that users can set the conditional range of the corresponding attributes. It should be noted that each node component needs to be specified whether it needs to be returned as a query result, that is, whether it needs to be graphically displayed as a query result is specified by setting the output configuration in the drop-down list of the configuration panel.
[0033] Edge components usually include two types: fixed edges and indefinite edges (i.e., multi-hop edges). Fixed edges represent a relationship and require users to specify one or more types in the edge configuration panel. After the user specifies certain types, the attributes of these types will appear in the drop-down list of the configuration panel, allowing the user to set the conditional range of the attributes. Indefinite edges represent a path with an uncertain step length. In addition to setting the possible types of edges on this path and various attribute restrictions, users also need to set the range of the step length. It should be noted that the types of edge components that can be determined based on direction include directed single edges, undirected single edges, directed multi-hop edges, and undirected multi-hop edges.
[0034] Specifically, in operation 101, the user terminal displays the node component in the graph query task interface based on the trigger operation instruction of the node component; based on the setting of the logical relationship between the node components, the edge component used to characterize the logical relationship between the node components is displayed in the graph query task interface; based on the attribute option setting, the attributes of the node component or edge component are configured.
[0035] In this way, the query and use threshold of the graph data of the present invention is low, and the user does not need to learn and master the syntax of complex graph query language, and can directly complete the construction of graph query tasks by dragging icons.
[0036] In an application example, refer to Figure 2 In the graph query task interface shown, the user creates a query graph through visualization or command line. Specifically, in response to the user's trigger operation instructions for node 1 and node 2, the two node components of node 1 and node 2 are displayed in the graph query task interface; further, in response to the logical relationship 1 between node 1 and node 2, a directed single edge representing the logical relationship 1 between node 1 and node 2 is displayed in the graph query task interface.
[0037] In another application example, the user creates a query graph by visualization or command line. Specifically, in response to the user's trigger operation instruction for two nodes 1 and 2, two node components, Node 1 and Node 2, are displayed in the graph query task interface; further, in response to the logical relationship 1 between Node 1 and Node 2, a directed unilateral edge representing the logical relationship 1 between Node 1 and Node 2 is displayed in the graph query task interface; at the same time, in response to the logical relationship 2 between the two nodes 1, an undirected indefinite edge representing the logical relationship 2 between the two nodes 1 is displayed in the graph query task interface, and the properties of the undirected indefinite edge are configured in the drop-down list of the configuration panel, such as the step length.
[0038] It should be noted that in the process of constructing the query graph, in addition to setting the properties of each node component or edge component, you can also set the properties of the entire graph, mainly including clustering and filtering of query results. Aggregation processing includes two categories: automatic aggregation or rule aggregation of all nodes of a certain category. When set to automatic aggregation, all nodes of the specified type will be divided into a specified number of groups by the clustering algorithm; when set to rule aggregation, you need to manually set which attributes of the type of node, what kind of segmentation method to use, and how many groups to divide into. Filtering processing mainly means that users can set whether each type of node's attribute values need to be excluded or retained when they are within a certain range.
[0039] In operation 102, reference Figure 3 After the user terminal completes the construction of the query graph, it can trigger the submission of the query graph to the server, so that the server can parse the query conditions of the query graph and execute the graph query task according to the analysis.
[0040] Specifically, the server parses the query conditions of the query graph through the parsing rules corresponding to different database languages to obtain parsing results that meet different databases; further, the graph query task is executed according to the parsing results that meet different database languages. In this way, through operations 101 to 102, the user can completely describe the query task of the complex graph structure through simple graphical operations, and realize cross-database graph query processing through the server's parsing execution.
[0041] In operation 103, after the server completes the graph query task, the query result is returned to the user terminal so as to graphically display the query result on the display interface of the user terminal.
[0042] Specifically, refer to Figure 3 , the query results can be displayed in two ways based on the timing:
[0043] Method 1: After the user terminal receives the query result returned by the server, the user terminal can graphically display the query result on the display interface in real time;
[0044] In one example, when the user terminal and the server complete the query process based on the query graph through operations 101 to 103 and obtain the query results, the display interface of the user terminal can graphically display the query results in real time; further, when the user switches the attributes of the query results in the display interface, the display interface will update and display the corresponding switched query results in real time.
[0045] Method 2: After receiving the query result returned by the server, the user terminal first saves it; after the user initiates a query instruction, the query result is graphically displayed on the display interface based on the triggering of the query instruction.
[0046] In one example, when the user terminal and the server complete the query process based on the query graph through operations 101 to 103 and obtain the query results, the user terminal will cache the query results; further, when the user terminal receives the query instruction triggered by the user, the query results are selectively graphically displayed on the display interface based on the attributes of the query results corresponding to the query instruction triggered by the user.
[0047] It should be noted that users can set the properties of the query results in advance or in real time in a visual way, including which node components and edge components the query results should correspond to, what processing to perform on the query results, and the presentation format of the query results.
[0048] In an application example, reference Figure 4 The graphical display effect diagram shown is based on the properties of the query results set, that is, returning 72 entity nodes (instances) for representing restaurants, 36 edge components for representing sales relationships, and displaying the shape of the query results after clustering processing.
[0049] In one possible implementation, operation 101 may also include: based on the operation instruction of the constructed first query graph in the graph query task interface, the first query graph is configured as a subgraph for nesting. That is, a query graph can contain several subgraphs, and can be nested multiple times; the setting process of each subgraph is the same as the operation details of constructing the query graph in the aforementioned operation 101, and the result of one subgraph can be used as the input of another subgraph.
[0050] For example, in the first query graph m1, subgraphs m11 and m12 are nested, wherein subgraph m11 is nested with subgraphs m111, m112, and m113. Here, the query results obtained by subgraphs m111, m112, and m113 through the above operations 101 to 103 are all used as inputs of subgraph m11; correspondingly, the query results obtained by subgraphs m11 and m12 through the above operations 101 to 103 are all used as inputs of the first query graph m1. In this way, the present invention can construct complex query tasks, complete complex subgraph structure matching, thereby obtaining rich query results, and further grouping, filtering, and other processing of the results.
[0051] Figure 5 The following is a schematic diagram showing the implementation process of the query method of the graph data in the embodiment of the present invention. Figure 2 .
[0052] refer to Figure 5The query method of graph data of an embodiment of the present invention includes: operation 501, displaying the node component in the graph query task interface based on the trigger operation instruction of the node component; operation 502, displaying the edge component used to characterize the logical relationship between the nodes in the graph query task interface based on the setting of the logical relationship between the node components; operation 503, configuring the attributes of the node component or the edge component based on the attribute option setting to construct a query graph; operation 504, parsing the query conditions of the query graph, and executing the graph query task according to the parsing; operation 505, graphically displaying the query results in the display interface.
[0053] In operations 501 to 503, the query graph includes at least a node component for representing a data object and an edge component for representing a logical relationship between the node components. In practical applications, there may be a query graph that only includes one or more node components for representing a data object.
[0054] Here, node components can usually include two types: entity nodes or concept nodes. Entity nodes are nodes with identification ID numbers that specify data objects; concept nodes require users to specify one or more types in the node configuration panel. When users specify certain types, attributes of these types will appear in the drop-down list of the configuration panel, allowing users to set the conditional range of the attributes. For example, when a user specifies that the type of a concept node is a dish, the drop-down list of the configuration panel will show the attribute 0 taste and the attribute 1 dish of the dish type, so that users can set the conditional range of the corresponding attributes. It should be noted that each node component needs to be specified whether it needs to be returned as a query result, that is, whether it needs to be graphically displayed as a query result is specified by setting the output configuration in the drop-down list of the configuration panel.
[0055] Edge components usually include two types: fixed edges and indefinite edges (i.e., multi-hop edges). Fixed edges represent a relationship and require users to specify one or more types in the edge configuration panel. After the user specifies certain types, the attributes of these types will appear in the drop-down list of the configuration panel, allowing the user to set the conditional range of the attributes. Indefinite edges represent a path with an uncertain step length. In addition to setting the possible types of edges on this path and various attribute restrictions, users also need to set the range of the step length. It should be noted that the types of edge components that can be determined based on direction include directed single edges, undirected single edges, directed multi-hop edges, and undirected multi-hop edges.
[0056] In this way, the query and use threshold of the graph data of the present invention is low, and the user does not need to learn and master the syntax of complex graph query language, and can directly complete the construction of graph query tasks by dragging icons.
[0057] In an application example, refer to Figure 2In the graph query task interface shown, the user creates a query graph through visualization or command line. Specifically, in response to the user's trigger operation instructions for node 1 and node 2, the two node components of node 1 and node 2 are displayed in the graph query task interface; further, in response to the logical relationship 1 between node 1 and node 2, a directed single edge representing the logical relationship 1 between node 1 and node 2 is displayed in the graph query task interface.
[0058] In another application example, the user creates a query graph by visualization or command line. Specifically, in response to the user's trigger operation instruction for two nodes 1 and 2, two node components, Node 1 and Node 2, are displayed in the graph query task interface; further, in response to the logical relationship 1 between Node 1 and Node 2, a directed unilateral edge representing the logical relationship 1 between Node 1 and Node 2 is displayed in the graph query task interface; at the same time, in response to the logical relationship 2 between the two nodes 1, an undirected indefinite edge representing the logical relationship 2 between the two nodes 1 is displayed in the graph query task interface, and the properties of the undirected indefinite edge are configured in the drop-down list of the configuration panel, such as the step length.
[0059] In one possible implementation, after operations 501 to 503, an embodiment of the present invention may further include: based on the operation instructions for the constructed first query graph in the graph query task interface, the first query graph is nested and configured as a subgraph. That is, a query graph can contain several subgraphs, and can be nested multiple times; the setting process of each subgraph is the same as the operation details of the aforementioned operations 501 to 503 to construct the query graph, and the result of one subgraph can be used as the input of another subgraph. In this way, the present invention can construct complex query tasks, complete complex subgraph structure matching, thereby obtaining rich query results, and further grouping, filtering and other processing of the results.
[0060] In operation 504, reference Figure 3 After the user terminal completes the construction of the query graph, it can trigger the submission of the query graph to the server, so that the server can parse the query conditions of the query graph and execute the graph query task according to the analysis.
[0061] Specifically, the server parses the query conditions of the query graph through the parsing rules corresponding to different database languages to obtain parsing results that meet different databases; further, the graph query task is executed according to the parsing results that meet different database languages. In this way, through operations 501 to 504, the user can completely describe the query task of the complex graph structure through simple graphical operations, and realize cross-database graph query processing through the server's parsing execution.
[0062] In operation 505, reference Figure 3After the server completes the graph query task, it returns the query result to the user terminal, so that the query result is graphically displayed on the display interface of the user terminal. Specifically, the display of the query result can be divided into the following two display modes based on the timing: Mode 1, after the user terminal receives the query result returned by the server, the user terminal can display the query result graphically on the display interface in real time; Mode 2, after the user terminal receives the query result returned by the server, it saves it first; after the user initiates the query command, the query result is graphically displayed on the display interface based on the trigger of the query command.
[0063] It should be noted that users can set the properties of the query results in advance or in real time in a visual way, including which node components and edge components the query results should correspond to, what processing to perform on the query results, and the presentation format of the query results.
[0064] Figure 6 The following is a schematic diagram showing the implementation process of the query method of the graph data in the embodiment of the present invention. Figure 3 .
[0065] refer to Figure 6 An embodiment of the present invention provides a method for querying graph data, the method comprising: operation 601, constructing a query graph based on operation instructions of a visualization image; operation 602, parsing query conditions of the query graph, and executing a graph query task according to the parsing; operation 603, graphically displaying the query results on a display interface in real time.
[0066] The specific implementation process of operations 601 and 602 is the same as Figure 1 The specific implementation processes of operations 101 and 102 in the illustrated embodiment are similar and will not be described in detail here.
[0067] refer to Figure 3 In operation 603, after the user terminal receives the query result returned by the server, the user terminal can graphically display the query result in real time on the display interface. It should be noted that the user can set the properties of the query result in advance or in real time in a visual manner, including which node components and edge components are returned for query result display, what kind of processing is performed on the query result, and the presentation form of the query result.
[0068] Figure 7 The following is a schematic diagram showing the implementation process of the query method of the graph data in the embodiment of the present invention. Figure 4 .
[0069] refer to Figure 7An embodiment of the present invention provides a method for querying graph data, the method comprising: operation 701, constructing a query graph based on operation instructions of a visualization image; operation 702, parsing the query conditions of the query graph, and executing a graph query task according to the parsing; operation 703, graphically displaying the query results on a display interface after submitting the query instructions.
[0070] The specific implementation process of operations 701 and 702 is the same as Figure 1 The specific implementation processes of operations 101 and 102 in the illustrated embodiment are similar and will not be described in detail here.
[0071] refer to Figure 3 In operation 703, after receiving the query result returned by the server, the user terminal first saves it; after the user initiates a query instruction, the query result is graphically displayed on the display interface based on the triggering of the query instruction. It should be noted that the user can set the properties of the query result in advance or in real time in a visual way, including which node components and edge components are returned for query result display, what kind of processing is performed on the query result, and the presentation form of the query result.
[0072] Thus, the query method for graph data of the embodiment of the present invention first constructs a query graph based on the operation instructions of the visual image, wherein the query graph at least includes node components for representing data objects and edge components for representing logical relationships between the node components; then the query conditions of the query graph are parsed, and the graph query task is executed according to the parsed conditions; and then the query results are graphically displayed on the display interface. Thus, the present invention constructs a query graph through the operation instructions of the visual image to perform a visual description of the graph query task, allowing the user to describe the query task of a complex graph structure completely through simple graphical operations; at the same time, the query results can be intuitively visualized, with a low threshold for user use, convenience, and high user experience.
[0073] Similarly, based on the query method of graph data described above, an embodiment of the present invention also provides a computer-readable storage medium, which stores a program. When the program is executed by a processor, the processor at least performs the following operation steps: Operation 101, constructing a query graph based on the operation instructions of the visual image; Operation 102, parsing the query conditions of the query graph, and executing the graph query task based on the analysis; Operation 103, graphically displaying the query results on the display interface.
[0074] Furthermore, based on the above-mentioned graph data query method, the embodiment of the present invention also provides a graph data query device, such as Figure 8As shown, the device 80 includes at least: a construction module 801, which is used to construct a query graph based on the operation instructions of the visual graphics, and the query task graph includes at least node components for representing data objects and edge components for representing the logical relationship between each node component; an execution module 802, which is used to parse the query conditions of the query graph and execute the graph query task according to the parsed conditions; a display module 803, which is used to graphically display the query results on the display interface.
[0075] According to one embodiment of the present invention, construction module 801 is specifically used to display the node component in the graph query task interface based on the trigger operation instruction of the node component; based on the setting of the logical relationship between the node components, display the edge component used to characterize the logical relationship between the node components in the graph query task interface; based on the attribute option setting, configure the attributes of the node component or edge component.
[0076] According to one embodiment of the present invention, the construction module 801 is further used to nest the first query graph as a subgraph based on the operation instructions for the constructed first query graph in the graph query task interface.
[0077] According to an embodiment of the present invention, the display module 803 is specifically used to graphically display the query results on the display interface in real time; or, graphically display the query results on the display interface after the query instruction is submitted.
[0078] It should be noted that the above description of the embodiment of the query device for graph data is different from the above description of the embodiment of the query device for graph data. Figures 1 to 7 The description of the method embodiment shown is similar, with the same Figures 1 to 7 The method embodiment shown in the figure has similar beneficial effects, so it will not be described in detail. For technical details not disclosed in the embodiment of the query device for graph data of the present invention, please refer to the aforementioned Figures 1 to 7 The method embodiment shown in the figure can be understood by referring to the description, and will not be described in detail for the sake of saving space.
[0079] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0080] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0081] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0082] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0083] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0084] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0085] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for querying graph data, characterized in that: The method comprises: Based on the operation instructions of the visualization graphics, a query graph is constructed, wherein the query graph includes at least a node component for representing a data object and an edge component for representing a logical relationship between each node component; Parsing the query conditions of the query graph based on parsing rules of different database languages to obtain parsing results that meet the requirements of different database languages; Execute the graph query task according to the parsing results that meet the requirements of different database languages; Graphically display the query results on the display interface; The operation instructions based on the visualization graphics, constructing the query graph, include: Based on the trigger operation instruction for the node component, display the node component on the graph query task interface; Based on the setting of the logical relationship between the node components, an edge component for representing the logical relationship between the node components is displayed on the graph query task interface; Based on the property option settings, configure the properties of the node component or edge component.
2. The method according to claim 1, characterized in that The node component includes an entity node or a concept node; the edge component includes a fixed edge or an indefinite edge.
3. The method according to claim 1, characterized in that The constructing of the query graph further includes: Based on the operation instructions on the constructed first query graph in the graph query task interface, the first query graph is nested and configured as a subgraph.
4. The method according to any one of claims 1 to 3, characterized in that: The query results are graphically displayed on the display interface, including: Graphically display query results on the display interface in real time; Or, based on the triggering of the query instruction, the query result is graphically displayed on the display interface.
5. A graph data query device, characterized in that: The device comprises: A construction module, used to construct a query graph based on the operation instructions of the visualization graph, wherein the query graph at least includes a node component for representing a data object and an edge component for representing a logical relationship between each node component; An execution module, used to parse the query conditions of the query graph based on parsing rules of different database languages to obtain parsing results that meet the requirements of different database languages; Execute the graph query task according to the parsing results that meet the requirements of different database languages; A display module, used to graphically display the query results on the display interface; The construction module is specifically used to display the node component in the graph query task interface based on the trigger operation instruction of the node component; based on the setting of the logical relationship between the node components, display the edge component used to characterize the logical relationship between the node components in the graph query task interface; based on the attribute option setting, configure the attributes of the node component or edge component.
6. The device according to claim 5, characterized in that The construction module is also used to nest the first query graph as a subgraph based on the operation instructions for the constructed first query graph in the graph query task interface.
7. The device according to any one of claims 5 to 6, characterized in that The display module is specifically used to graphically display the query results on the display interface in real time; or, to graphically display the query results on the display interface after the query instruction is submitted.
8. A computer-readable storage medium, characterized in that: The storage medium includes a set of computer executable instructions, which are used to execute the graph data query method described in any one of claims 1 to 4 when the instructions are executed.
