CN112052343A - Knowledge graph display method and device, electronic equipment and storage medium - Google Patents
Knowledge graph display method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN112052343A CN112052343A CN202010953617.0A CN202010953617A CN112052343A CN 112052343 A CN112052343 A CN 112052343A CN 202010953617 A CN202010953617 A CN 202010953617A CN 112052343 A CN112052343 A CN 112052343A
- Authority
- CN
- China
- Prior art keywords
- knowledge graph
- graph
- knowledge
- node
- displaying
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 230000006399 behavior Effects 0.000 claims abstract description 130
- 238000005065 mining Methods 0.000 claims abstract description 22
- 238000012545 processing Methods 0.000 claims abstract description 7
- 238000004364 calculation method Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 10
- 230000003993 interaction Effects 0.000 claims description 10
- 238000006243 chemical reaction Methods 0.000 claims description 9
- 238000001514 detection method Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 8
- 230000005484 gravity Effects 0.000 claims description 7
- 238000012217 deletion Methods 0.000 claims description 6
- 230000037430 deletion Effects 0.000 claims description 6
- 238000012544 monitoring process Methods 0.000 claims description 5
- 230000007246 mechanism Effects 0.000 claims description 4
- 238000012986 modification Methods 0.000 claims description 4
- 230000004048 modification Effects 0.000 claims description 4
- 238000007792 addition Methods 0.000 claims description 3
- 230000000694 effects Effects 0.000 abstract description 12
- 230000006870 function Effects 0.000 description 10
- 239000000243 solution Substances 0.000 description 9
- 230000000007 visual effect Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000002347 injection Methods 0.000 description 4
- 239000007924 injection Substances 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000007418 data mining Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000002265 prevention Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- VYZAMTAEIAYCRO-UHFFFAOYSA-N Chromium Chemical compound [Cr] VYZAMTAEIAYCRO-UHFFFAOYSA-N 0.000 description 1
- 239000008186 active pharmaceutical agent Substances 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013079 data visualisation Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000013515 script Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012800 visualization Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/34—Browsing; Visualisation therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Animal Behavior & Ethology (AREA)
- Computational Linguistics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The embodiment of the invention provides a knowledge graph display method, a knowledge graph display device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring the operation behavior of a user aiming at the knowledge graph; displaying a knowledge graph view page corresponding to the operation behavior based on Echarts based on the operation behavior; the operation behaviors comprise knowledge graph mining, and/or knowledge graph node relation adjustment, and/or knowledge graph layout, and/or CQL searching. The embodiment of the invention realizes convenient operation of the knowledge graph, can realize the function of a knowledge graph editor based on Echarts and realize the optimized display and the relevant logic processing of the knowledge graph, thereby providing rich display effect.
Description
Technical Field
The invention relates to the technical field of knowledge graphs, in particular to a knowledge graph display method and device, electronic equipment and a storage medium.
Background
The common knowledge graph is generally realized in two ways, namely one way is realized by adding a service end to a JavaScript open-source visual library; the other is an integrated implementation scheme.
However, the knowledge graph realized by the JavaScript open source visual library and the service end needs to be developed in a large amount by the development of the service end to realize business logics such as data storage, relation query, data mining and the like, so that the realization of the rear end of the knowledge graph is not perfect, and the operation efficiency of the service end is generally low; meanwhile, most of the source library functions are not perfect enough, only the basic display function is realized, and the actual requirement for forming the rich display effect cannot be met. And the other integrally realized knowledge graph has the defects of poor display effect and poor expandability because the front-end performance needs to be improved.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a knowledge graph display method and device, electronic equipment and a storage medium.
In a first aspect, an embodiment of the present invention provides a knowledge graph display method, including:
acquiring the operation behavior of a user aiming at the knowledge graph;
displaying a knowledge graph view page corresponding to the operation behavior based on Echarts based on the operation behavior;
the operation behaviors comprise knowledge graph mining, and/or knowledge graph node relation adjustment, and/or knowledge graph layout, and/or CQL searching.
Further, the displaying a knowledge graph view page corresponding to the operation behavior based on the operation behavior and based on Echarts specifically includes:
judging whether the operation behavior needs to carry out data interaction or not based on the operation behavior;
if the operation behavior needs data interaction, sending a data request to the server, so that the server acquires data corresponding to the data request from a Neo4j database; the data comprises nodes, node relationships and node attributes;
performing layout calculation based on data corresponding to the data request;
and updating the view through a relational graph of Echarts based on the layout calculation result, and displaying a knowledge graph view page corresponding to the operation behavior.
Further, the operation behavior is knowledge graph mining;
correspondingly, based on the operation behaviors, displaying a knowledge graph view page corresponding to the operation behaviors based on Echarts, and comprising the following steps:
sending node information to a server to request node mining;
the server side acquires associated node set information and associated node connection set information which are associated with the node information from a Neo4j database;
performing layout calculation based on the associated node set information and the associated node connection set information;
and updating the view through a relational graph of Echarts based on the layout calculation result, and displaying a knowledge graph view page corresponding to the knowledge graph mining.
Further, the operation behavior is knowledge graph node relation adjustment; the adjustment of the node relation of the knowledge graph comprises dragging of nodes of the knowledge graph, and/or connecting of node relation of the knowledge graph, and/or adding of nodes of the knowledge graph;
correspondingly, based on the operation behaviors, displaying a knowledge graph view page corresponding to the operation behaviors based on Echarts, and comprising the following steps:
when the operation behavior is the dragging of the nodes of the knowledge graph and/or the connection of the node relations of the knowledge graph, the dragging of the nodes of the knowledge graph is realized based on an original Graphic element component Graphic and Javascript event processing mechanism in the Echarts graph, and/or the connection of the node relations of the knowledge graph is displayed, and the dragging of the nodes of the knowledge graph and/or the connection of the node relations of the knowledge graph are displayed;
and when the operation behavior is that the nodes of the knowledge graph are increased, expanding the operation behavior through the drag and drop event of the jQuery UI, and displaying the pages of the knowledge graph view corresponding to the increase of the nodes of the knowledge graph.
Further, the operation behavior is knowledge graph layout; wherein the knowledge-graph layout comprises a tree layout, and/or a ring layout, and/or a gravity layout;
correspondingly, based on the operation behaviors, displaying a knowledge graph view page corresponding to the operation behaviors based on Echarts, and comprising the following steps:
sending a data request to a server so that the server acquires the association relation of the nodes from a Neo4j database;
calculating the position information of the corresponding node based on the incidence relation of the nodes;
and updating the view through a relational graph of Echarts based on the corresponding node position information, and displaying a knowledge graph view page corresponding to the knowledge graph layout.
Further, the operation behavior is CQL search;
correspondingly, based on the operation behaviors, displaying a knowledge graph view page corresponding to the operation behaviors based on Echarts, and comprising the following steps:
sending a CQL search request to a server, and acquiring data corresponding to the CQL search request from a Neo4j database by the server; the data comprises nodes, node relationships and node attributes;
performing injection-prevention detection on the data, wherein the injection-prevention detection is used for preventing addition, deletion and modification operations in the query process;
performing format conversion on the data based on a Neo4j engine;
and performing layout calculation based on the data after format conversion, and displaying the query result of the CQL search.
Further, the acquiring the operation behavior of the user on the knowledge graph comprises:
and monitoring the operation behavior based on the Javascript to acquire the operation behavior of the user aiming at the knowledge graph.
In a second aspect, an embodiment of the present invention provides a knowledge graph displaying apparatus, including:
the acquisition module is used for acquiring the operation behavior of a user aiming at the knowledge graph;
the display module is used for displaying a knowledge graph view page corresponding to the operation behavior based on the Echarts based on the operation behavior;
the operation behaviors comprise knowledge graph mining, and/or knowledge graph node relation adjustment, and/or knowledge graph layout, and/or CQL searching.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the method for displaying a knowledge graph according to the first aspect when executing the program.
In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method for displaying a knowledge graph according to the first aspect.
According to the technical scheme, the knowledge graph display method, the knowledge graph display device, the electronic equipment and the storage medium provided by the embodiment of the invention have the advantages that the operation behavior of the user for the knowledge graph is obtained; based on the operation behaviors, displaying the knowledge graph view page corresponding to the operation behaviors based on Echarts, realizing convenient operation of the knowledge graph, being suitable for online visual editing of the knowledge graph, facilitating user-defined knowledge graph and providing rich display effect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic flow chart of a knowledge graph displaying method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a knowledge-graph displaying method according to another embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a knowledge-graph displaying apparatus according to an embodiment of the present invention;
fig. 4 is a schematic physical structure diagram of an electronic device according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments, but not all embodiments, of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. The method for detecting train collision according to the present invention will be explained and illustrated in detail by specific embodiments.
FIG. 1 is a schematic flow chart of a knowledge graph displaying method according to an embodiment of the present invention; as shown in fig. 1, the method includes:
step 101: acquiring the operation behavior of a user aiming at the knowledge graph; the operation behaviors comprise knowledge graph mining, and/or knowledge graph node relation adjustment, and/or knowledge graph layout, and/or CQL searching.
Step 102: and displaying a knowledge graph view page corresponding to the operation behavior based on Echarts based on the operation behavior.
In this embodiment, it should be noted that Echarts is an open source visualization library implemented by using JavaScript, covers charts of various industries, and meets various requirements. Echart is compatible with most current browsers (IE8/9/10/11, Chrome, Firefox, Safari, etc.) and various devices, and can be displayed at any time and any place.
In this embodiment, it can be understood that the operability of the knowledge graph view page is realized based on the open source visualization software Echarts, and the ExtGraph class is extended and encapsulated by taking a relational graph (series-graph) of the Echarts as a base class, so as to realize the editor function of the knowledge graph, thereby extending the editability of the knowledge graph, and specifically, completing the realization of the knowledge graph extension class based on the relational graph (series-graph) of the Echarts, which can be subdivided into the following parts:
A. the instantiation configuration information is used for differential configuration of the knowledge graph during generation of the instance, meets different scene requirements, and can be expanded in the next step; the method can include configuration information such as instance key (skey), instance name (sName), Echarts instantiation configuration information (Echarts0pt), tool configuration information (tool Bars), knowledge node preview, relationship connection preview and the like.
B. The native Graphic element component (Graphic) and Javascript time processing mechanism based on Echarts realizes the functions of node dragging and relationship connection between nodes; and realizing node mouse frame selection of the knowledge node, scaling and centering of the knowledge graph and the like based on the Echarts bottom-layer vector library Zrender.
C. The default configuration functions of the toolbar are realized through Javascript scripts, and the default configuration functions comprise storage, saving, export, historical record operation (withdrawing, recovering and resetting), list display, node arrangement combination, layout (tree layout, annular layout and gravity layout) switching and the like. The user only needs to configure the toolbar button array required to be displayed, and the configuration information can be configured in the data form of I a key value of a default toolbar item (for example [ "save", "saveAs" ]); II objects containing key values, presentations, icons, functions, etc. that can override default toolbar items (e.g., [ "save", { "key": saveAs "," name ": save as" }); III also supports user-defined toolbar items (e.g., [ { "key": extToolBarItem "," name ": extended function", "class": custom-item ", icon:"./icon. png ", callback: function () { } }).
D. And previewing the nodes and the relation connecting lines, and similarly realizing the node and the relation connecting line in an easily-extensible and configurable mode. The display is realized through HTML and CSS; the arrangement in D is consistent with the format in C.
E. Customizing the node icons allows a user to customize the node icons, node titles, colors, wiring styles, and the like.
And the ExtGraph based on the extension class is easy to extend and develop for the second time, and meets the requirements of different service scenes.
Realizing the function of a knowledge graph editor on the basis of realizing the extension type ExtGraph; acquiring the operation behavior of a user aiming at the knowledge graph, and adding an event monitor triggered when the user clicks a button if JavaScript event monitoring is combined, wherein the method comprises the steps of adding an event processing program to an element and appointing the element to designate the event processing program; multiple event handlers may also be added to the same element. The method comprises the steps that a user executes operation behaviors aiming at the knowledge graph according to actual requirements, such as knowledge graph node relation adjustment, knowledge graph layout and the like, a button corresponding to a web end is triggered, a server monitors user operation behavior indication, visual, vivid and interactive data visualization graphs are provided based on Echarts, user experience is greatly enhanced due to innovative characteristics of dragging and recalculating, data view, value range roaming and the like, the user is endowed with the capacity of mining and integrating data, and a knowledge graph view page corresponding to the operation behaviors is displayed.
In this embodiment, it should be noted that the operation behavior includes knowledge graph mining, knowledge graph node relationship adjustment (such as knowledge graph node dragging, knowledge graph node adding, and the like), knowledge graph layout (such as tree layout, ring layout, and the like); the operation behavior further comprises CQL search, wherein a CQL full name (subset and variety of a set of SQL-like Query syntax customized by LeanCloud for the Query API) is obtained, for example, when a user inputs a CQL statement, the server performs anti-injection detection on the received CQL statement, performs format conversion on the data retrieved from the graph library, and returns the converted data to the front end.
As can be seen from the above technical solutions, the method for displaying a knowledge graph provided in the embodiments of the present invention extends editable knowledge graphs, and can display a knowledge graph view page corresponding to a plurality of operation behaviors, thereby providing a rich display effect, wherein the realization of operability of the knowledge graph requires deep understanding of Echarts, mastering a zrtender vector library API, and monitoring in combination with Javascript events; meanwhile, in order to facilitate expansion and convenient configuration of a user, the specification of a configuration format and a data format need to be uniformly configured, and the operation behavior of the user for the knowledge graph is acquired; based on the operation behaviors, displaying the knowledge graph view page corresponding to the operation behaviors based on Echarts, realizing convenient operation of the knowledge graph, being suitable for online visual editing of the knowledge graph, facilitating user-defined knowledge graph and providing rich display effect.
On the basis of the foregoing embodiment, in this embodiment, the displaying a knowledge graph view page corresponding to the operation behavior based on the operation behavior and based on Echarts specifically includes:
judging whether the operation behavior needs to carry out data interaction or not based on the operation behavior;
if the operation behavior needs data interaction, sending a data request to the server, so that the server acquires data corresponding to the data request from a Neo4j database; the data comprises nodes, node relationships and node attributes;
performing layout calculation based on data corresponding to the data request;
and updating the view through a relational graph of Echarts based on the layout calculation result, and displaying a knowledge graph view page corresponding to the operation behavior.
In this embodiment, referring to fig. 2, a user behavior is obtained, it is monitored that the user behavior is not an end program, and whether data interaction is required for the operation behavior is continuously determined; and if the operation behavior needs to carry out data interaction, sending a data request (Ajax request) to the server. In this embodiment, it should be noted that the server configures high-performance integrated Neo4j, and implements an interface handler. Neo4j is a high-performance graph engine with all the characteristics of a mature database and visual graph display, and Neo4j provides large-scale scalability, can process billions of nodes/relations/attributes on one machine, and can be extended to the parallel operation of multiple machines.
In this embodiment, for example:
if the user performs knowledge graph gravity layout display according to the operation behavior of the knowledge graph, sending a data request to the server, and the server acquiring data information such as nodes, node relations and association relations of the nodes from the Neo4j database and sending the data information to the web end; based on the returned data information, layout calculation is performed, for example, corresponding node position information is specifically calculated according to the association relation of the nodes, so as to realize the layout of gravity.
If the user searches for the CQL aiming at the operation behavior of the knowledge graph, the server requests data through Ajax, when the server receives the request, the server performs injection prevention detection on the received CQL statement, performs format conversion on the data retrieved from the graph library, and returns the converted data to the front end.
According to the technical scheme, on one hand, the knowledge graph display method provided by the embodiment of the invention realizes quick query and quick display by combining Eharts and Neo4j, supports knowledge graph display of large data volume, and solves the problem of poor performance and display effect; on the other hand, the high-performance graph engine of Neo4j, the high-efficiency map algorithm, the recommendation system and the OLAP style analysis are matched to realize the animation rendering path of the topological graph.
On the basis of the above embodiment, the method further comprises the following steps:
and if the operation behavior does not need data interaction, acquiring data corresponding to the operation behavior based on an Echarts chart library and an Echarts bottom vector library, and displaying a knowledge map view page corresponding to the operation behavior.
On the basis of the embodiment, the operation behavior is knowledge graph mining;
correspondingly, based on the operation behaviors, displaying a knowledge graph view page corresponding to the operation behaviors based on Echarts, and comprising the following steps:
sending node information to a server to request node mining;
the server side acquires associated node set information and associated node connection set information which are associated with the node information from a Neo4j database;
performing layout calculation based on the associated node set information and the node connection set information;
and updating the view through a relational graph of Echarts based on the layout calculation result, and displaying a knowledge graph view page corresponding to the knowledge graph mining.
In this embodiment, for example, node mining is performed by transmitting node information (i.e., node information) to a server in an Ajax request manner, and the server performs data mining on data based on Neo4j, and returns associated node set information and associated node connection set information to a front end to perform data merging processing.
According to the technical scheme, the knowledge graph display method provided by the embodiment of the invention combines Eharts and Neo4j to realize node-mining knowledge graph display, so that the display effect is richer.
On the basis of the above embodiment, the operation behavior is knowledge graph node relation adjustment; the adjustment of the node relation of the knowledge graph comprises dragging of nodes of the knowledge graph, and/or connecting of node relation of the knowledge graph, and/or adding of nodes of the knowledge graph;
correspondingly, based on the operation behaviors, displaying a knowledge graph view page corresponding to the operation behaviors based on Echarts, and comprising the following steps:
when the operation behavior is the dragging of the nodes of the knowledge graph and/or the connection of the node relations of the knowledge graph, the dragging of the nodes of the knowledge graph is realized based on an original Graphic element component Graphic and Javascript event processing mechanism in the Echarts graph, and/or the connection of the node relations of the knowledge graph is displayed, and the dragging of the nodes of the knowledge graph and/or the connection of the node relations of the knowledge graph are displayed;
and when the operation behavior is that the nodes of the knowledge graph are increased, expanding the operation behavior through the drag and drop event of the jQuery UI, and displaying the pages of the knowledge graph view corresponding to the increase of the nodes of the knowledge graph.
In this embodiment, it should be noted that the jQuery UI is a set of user interface interactions, special effects, widgets, and themes built on the jQuery JavaScript library.
According to the technical scheme, the knowledge graph display method provided by the embodiment of the invention combines Eharts and Neo4j to realize node dragging, node relation connection and node adding knowledge graph display, so that the display effect is richer.
On the basis of the embodiment, the deletion processing can be performed on a single node, and the node deletion is performed through a shortcut key 'delete' or a deletion button for node preview; when the node is deleted, the corresponding deleting operation is carried out by searching the connection line associated with the node.
On the basis of the above embodiment, the operation behavior is a knowledge graph layout; wherein the knowledge-graph layout comprises a tree layout, and/or a ring layout, and/or a gravity layout;
correspondingly, based on the operation behaviors, displaying a knowledge graph view page corresponding to the operation behaviors based on Echarts, and comprising the following steps:
sending a data request to a server so that the server acquires the association relation of the nodes from a Neo4j database;
calculating the position information of the corresponding node based on the incidence relation of the nodes;
and updating the view through a relational graph of Echarts based on the corresponding node position information, and displaying a knowledge graph view page corresponding to the knowledge graph layout.
According to the technical scheme, the knowledge graph display method provided by the embodiment of the invention combines Eharts and Neo4j to realize the knowledge graph display of tree layout, annular layout and gravity layout, so that the display effect is richer.
On the basis of the above embodiment, the operation behavior is CQL search;
correspondingly, based on the operation behaviors, displaying a knowledge graph view page corresponding to the operation behaviors based on Echarts, and comprising the following steps:
sending a CQL search request to a server, and acquiring data corresponding to the CQL search request from a Neo4j database by the server; the data comprises nodes, node relationships and node attributes;
performing injection-prevention detection on the data, wherein the injection-prevention detection is used for preventing addition, deletion and modification operations in the query process;
performing format conversion on the data based on a Neo4j engine;
and performing layout calculation based on the data after format conversion, and displaying the query result of the CQL search.
The method comprises the steps that a user searches CQL aiming at the operation behavior of a knowledge graph, requests data from a server through Ajax, when the server receives the request, anti-injection detection is carried out on a received CQL statement, format conversion is carried out on data retrieved from a graph library, and the converted data are returned to the front end.
According to the technical scheme, the knowledge graph display method provided by the embodiment of the invention combines Eharts and Neo4j to realize the query result display of CQL search, so that the display effect is richer; meanwhile, injection prevention is carried out when the service end processes the CQL statement, so that operations of adding, deleting and modifying can be prevented during query.
On the basis of the above embodiment, the acquiring the operation behavior of the user for the knowledge graph includes:
and monitoring the operation behavior based on the Javascript to acquire the operation behavior of the user aiming at the knowledge graph.
Fig. 3 is a schematic structural diagram of a knowledge graph displaying apparatus according to an embodiment of the present invention, as shown in fig. 3, the apparatus includes: an obtaining module 201 and a displaying module 202, wherein:
the acquiring module 201 is configured to acquire an operation behavior of a user for a knowledge graph;
a presentation module 202, configured to present, based on the operation behavior, a knowledge graph view page corresponding to the operation behavior based on Echarts;
the operation behaviors comprise knowledge graph mining, and/or knowledge graph node relation adjustment, and/or knowledge graph layout, and/or CQL searching.
The knowledge graph display apparatus provided in the embodiment of the present invention may be specifically used to execute the knowledge graph display method of the embodiment, and the technical principle and the beneficial effect thereof are similar, and reference may be specifically made to the embodiment described above, and details are not described here.
Based on the same inventive concept, an embodiment of the present invention provides an electronic device, which specifically includes the following components, with reference to fig. 4: a processor 301, a communication interface 303, a memory 302, and a communication bus 304;
the processor 301, the communication interface 303 and the memory 302 complete mutual communication through the bus 304; the communication interface 303 is used for realizing information transmission between related devices such as modeling software, an intelligent manufacturing equipment module library and the like; the processor 301 is used for calling the computer program in the memory 302, and the processor executes the computer program to implement the method provided by the above method embodiments, for example, the processor executes the computer program to implement the following steps: acquiring the operation behavior of a user aiming at the knowledge graph; displaying a knowledge graph view page corresponding to the operation behavior based on Echarts based on the operation behavior; the operation behaviors comprise knowledge graph mining, and/or knowledge graph node relation adjustment, and/or knowledge graph layout, and/or CQL searching.
Based on the same inventive concept, yet another embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, is implemented to perform the method provided by the above method embodiments, for example, based on the operation behavior, displaying a knowledge graph view page corresponding to the operation behavior based on Echarts; the operation behaviors comprise knowledge graph mining, and/or knowledge graph node relation adjustment, and/or knowledge graph layout, and/or CQL searching.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
In addition, in the present invention, terms such as "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Moreover, in the present invention, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Furthermore, in the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A knowledge graph display method is characterized by comprising the following steps:
acquiring the operation behavior of a user aiming at the knowledge graph;
displaying a knowledge graph view page corresponding to the operation behavior based on Echarts based on the operation behavior;
the operation behaviors comprise knowledge graph mining, and/or knowledge graph node relation adjustment, and/or knowledge graph layout, and/or CQL searching.
2. The method of claim 1, wherein displaying, based on the operational behavior and based on Echarts, a knowledge graph view page corresponding to the operational behavior specifically comprises:
judging whether the operation behavior needs to carry out data interaction or not based on the operation behavior;
if the operation behavior needs data interaction, sending a data request to the server, so that the server acquires data corresponding to the data request from a Neo4j database; the data comprises nodes, node relationships and node attributes;
performing layout calculation based on data corresponding to the data request;
and updating the view through a relational graph of Echarts based on the layout calculation result, and displaying a knowledge graph view page corresponding to the operation behavior.
3. The knowledge-graph display method of claim 2 wherein the operational behavior is knowledge-graph mining;
correspondingly, based on the operation behaviors, displaying a knowledge graph view page corresponding to the operation behaviors based on Echarts, and comprising the following steps:
sending node information to a server to request node mining;
the server side acquires associated node set information and associated node connection set information which are associated with the node information from a Neo4j database;
performing layout calculation based on the associated node set information and the associated node connection set information;
and updating the view through a relational graph of Echarts based on the layout calculation result, and displaying a knowledge graph view page corresponding to the knowledge graph mining.
4. The method of knowledge-graph display of claim 2 wherein the operational behavior is knowledge-graph node relationship adjustment; the adjustment of the node relation of the knowledge graph comprises dragging of nodes of the knowledge graph, and/or connecting of node relation of the knowledge graph, and/or adding of nodes of the knowledge graph;
correspondingly, based on the operation behaviors, displaying a knowledge graph view page corresponding to the operation behaviors based on Echarts, and comprising the following steps:
when the operation behavior is the dragging of the nodes of the knowledge graph and/or the connection of the node relations of the knowledge graph, the dragging of the nodes of the knowledge graph is realized based on an original Graphic element component Graphic and Javascript event processing mechanism in the Echarts graph, and/or the connection of the node relations of the knowledge graph is displayed, and the dragging of the nodes of the knowledge graph and/or the connection of the node relations of the knowledge graph are displayed;
and when the operation behavior is that the nodes of the knowledge graph are increased, expanding the operation behavior through the drag and drop event of the jQuery UI, and displaying the pages of the knowledge graph view corresponding to the increase of the nodes of the knowledge graph.
5. The method of knowledge-graph presentation according to claim 2, wherein the operational behavior is knowledge-graph layout; wherein the knowledge-graph layout comprises a tree layout, and/or a ring layout, and/or a gravity layout;
correspondingly, based on the operation behaviors, displaying a knowledge graph view page corresponding to the operation behaviors based on Echarts, and comprising the following steps:
sending a data request to a server so that the server acquires the association relation of the nodes from a Neo4j database;
calculating the position information of the corresponding node based on the incidence relation of the nodes;
and updating the view through a relational graph of Echarts based on the corresponding node position information, and displaying a knowledge graph view page corresponding to the knowledge graph layout.
6. The knowledge-graph display method of claim 2 wherein the operational behavior is a CQL search;
correspondingly, based on the operation behaviors, displaying a knowledge graph view page corresponding to the operation behaviors based on Echarts, and comprising the following steps:
sending a CQL search request to a server, and acquiring data corresponding to the CQL search request from a Neo4j database by the server; the data comprises nodes, node relationships and node attributes;
performing injection-prevention detection on the data, wherein the injection-prevention detection is used for preventing addition, deletion and modification operations in the query process;
performing format conversion on the data based on a Neo4j engine;
and performing layout calculation based on the data after format conversion, and displaying the query result of the CQL search.
7. The method for displaying the knowledge graph according to claim 1, wherein the obtaining of the operation behavior of the user on the knowledge graph comprises:
and monitoring the operation behavior based on the Javascript to acquire the operation behavior of the user aiming at the knowledge graph.
8. A knowledge-graph displaying apparatus, comprising:
the acquisition module is used for acquiring the operation behavior of a user aiming at the knowledge graph;
the display module is used for displaying a knowledge graph view page corresponding to the operation behavior based on the Echarts based on the operation behavior;
the operation behaviors comprise knowledge graph mining, and/or knowledge graph node relation adjustment, and/or knowledge graph layout, and/or CQL searching.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method of knowledge-graph presentation as claimed in any one of claims 1 to 7 are implemented when the program is executed by the processor.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the steps of the knowledge-graph displaying method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010953617.0A CN112052343A (en) | 2020-09-11 | 2020-09-11 | Knowledge graph display method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010953617.0A CN112052343A (en) | 2020-09-11 | 2020-09-11 | Knowledge graph display method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112052343A true CN112052343A (en) | 2020-12-08 |
Family
ID=73610776
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010953617.0A Pending CN112052343A (en) | 2020-09-11 | 2020-09-11 | Knowledge graph display method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112052343A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113536048A (en) * | 2021-06-29 | 2021-10-22 | 北京明略软件系统有限公司 | Map display method, system, storage medium and electronic equipment |
CN113609282A (en) * | 2021-08-09 | 2021-11-05 | 神州数码融信软件有限公司 | Drawing method of automatic drawing engine |
CN114020852A (en) * | 2021-09-29 | 2022-02-08 | 苏州臻璇数据信息技术有限公司 | Knowledge graph display method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109284394A (en) * | 2018-09-12 | 2019-01-29 | 青岛大学 | A method of Company Knowledge map is constructed from multi-source data integration visual angle |
CN109508384A (en) * | 2018-10-31 | 2019-03-22 | 北京国双科技有限公司 | Processing method, device, storage medium and the processor of knowledge mapping |
WO2019057190A1 (en) * | 2017-09-25 | 2019-03-28 | 腾讯科技(深圳)有限公司 | Method and apparatus for displaying knowledge graph, terminal device, and readable storage medium |
CN110222199A (en) * | 2019-06-20 | 2019-09-10 | 青岛大学 | A kind of character relation map construction method based on ontology and a variety of Artificial neural network ensembles |
CN111427901A (en) * | 2020-03-23 | 2020-07-17 | 浪潮通用软件有限公司 | Interactive knowledge graph data editing method, computer device and storage medium |
-
2020
- 2020-09-11 CN CN202010953617.0A patent/CN112052343A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019057190A1 (en) * | 2017-09-25 | 2019-03-28 | 腾讯科技(深圳)有限公司 | Method and apparatus for displaying knowledge graph, terminal device, and readable storage medium |
CN109284394A (en) * | 2018-09-12 | 2019-01-29 | 青岛大学 | A method of Company Knowledge map is constructed from multi-source data integration visual angle |
CN109508384A (en) * | 2018-10-31 | 2019-03-22 | 北京国双科技有限公司 | Processing method, device, storage medium and the processor of knowledge mapping |
CN110222199A (en) * | 2019-06-20 | 2019-09-10 | 青岛大学 | A kind of character relation map construction method based on ontology and a variety of Artificial neural network ensembles |
CN111427901A (en) * | 2020-03-23 | 2020-07-17 | 浪潮通用软件有限公司 | Interactive knowledge graph data editing method, computer device and storage medium |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113536048A (en) * | 2021-06-29 | 2021-10-22 | 北京明略软件系统有限公司 | Map display method, system, storage medium and electronic equipment |
CN113609282A (en) * | 2021-08-09 | 2021-11-05 | 神州数码融信软件有限公司 | Drawing method of automatic drawing engine |
CN114020852A (en) * | 2021-09-29 | 2022-02-08 | 苏州臻璇数据信息技术有限公司 | Knowledge graph display method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11741089B1 (en) | Interactive location queries for raw machine data | |
US11429600B2 (en) | Loading queries using search points | |
US11611493B2 (en) | Displaying interactive topology maps of cloud computing resources | |
US20220121410A1 (en) | Technology add-on interface | |
US11698900B2 (en) | Leveraging search query history in a search interface | |
US10693743B2 (en) | Displaying interactive topology maps of cloud computing resources | |
US11651012B1 (en) | Coding commands using syntax templates | |
CN109033260B (en) | Knowledge graph interactive visual query method based on RDF | |
CN112052343A (en) | Knowledge graph display method and device, electronic equipment and storage medium | |
US20170220633A1 (en) | Context-Adaptive Selection Options in a Modular Visualization Framework | |
US11003682B2 (en) | Metrics analysis workflow | |
US11790623B1 (en) | Manipulation of virtual object position within a plane of an extended reality environment | |
US11921799B1 (en) | Generating and using alert definitions | |
CN101488151A (en) | System and method for gathering website contents | |
US10216862B1 (en) | Predictive estimation for ingestion, performance and utilization in a data indexing and query system | |
JP2006285513A (en) | Information processing support system, and information processing support program | |
US11625254B1 (en) | Interface for customizing dashboards based on parallel edges | |
US20180314393A1 (en) | Linking data set summarizations using affinities | |
CN112527918A (en) | Data processing method and device | |
US11574429B1 (en) | Automated generation of display layouts | |
CN111949915A (en) | Visual customization method and system for production process of remote sensing product | |
CN114297443B (en) | Processing method, device, equipment and storage medium of graph data query statement | |
CN113220903A (en) | Power accident visual analysis system and method based on knowledge graph | |
KR20210121574A (en) | Data set management device and method for displaying relationship between machine learning model and data set using the same | |
CN111431729A (en) | Resource management interaction method based on topological graph |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |