CN113282741A - Knowledge graph visualization method, device, equipment and computer readable medium - Google Patents

Knowledge graph visualization method, device, equipment and computer readable medium Download PDF

Info

Publication number
CN113282741A
CN113282741A CN202110315034.XA CN202110315034A CN113282741A CN 113282741 A CN113282741 A CN 113282741A CN 202110315034 A CN202110315034 A CN 202110315034A CN 113282741 A CN113282741 A CN 113282741A
Authority
CN
China
Prior art keywords
scene
function
polyhedron
target
dimensional
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
Application number
CN202110315034.XA
Other languages
Chinese (zh)
Inventor
雍晓康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Mininglamp Software System Co ltd
Original Assignee
Beijing Mininglamp Software System Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Mininglamp Software System Co ltd filed Critical Beijing Mininglamp Software System Co ltd
Priority to CN202110315034.XA priority Critical patent/CN113282741A/en
Publication of CN113282741A publication Critical patent/CN113282741A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/34Browsing; Visualisation therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (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)
  • Processing Or Creating Images (AREA)

Abstract

The application relates to a knowledge graph visualization method, a knowledge graph visualization device, knowledge graph visualization equipment and a computer readable medium. The method comprises the following steps: creating a target scene container through a three-dimensional engine, wherein the three-dimensional engine is used for visualizing three-dimensional data, the target scene container has three-dimensional coordinates, and the target scene container is used for accommodating a three-dimensional space; creating a first polyhedron background ball in the three-dimensional space of the target scene container, wherein the first polyhedron background ball consists of a plurality of identical planes, the intersecting positions of adjacent planes form the vertex of the first polyhedron background ball, and the number of the planes forming the first polyhedron background ball is the preset number of faces; and generating nodes on the first polyhedron background ball by utilizing the relation data in the target knowledge graph, and generating a relation line between the nodes according to the incidence relation between the relation data. The technical problem that the plane effect graph cannot clearly and effectively display the node information is solved.

Description

Knowledge graph visualization method, device, equipment and computer readable medium
Technical Field
The present application relates to the field of knowledge graph technology, and in particular, to a knowledge graph visualization method, apparatus, device, and computer readable medium.
Background
With the continuous exploration and development of knowledge-graph technology and the realization of more perception and cognition of knowledge-graphs in the future, the knowledge-graph visualization technology also becomes a hotspot of current research.
At present, in the related art, the display form of the knowledge graph mainly displays a force-guided phase diagram and an annular layout diagram represented by echarts and D3 frames, although a relational graph can be well displayed, the force-guided layout diagram and the annular layout diagram are both displayed in a 2D form, and a plane effect diagram has a single visual angle and cannot bring all-around feeling, once the number of nodes of the graph is slightly increased, the graph in the area is difficult to clearly and effectively display the information of the nodes, even cannot effectively display the most basic information such as node names, and a user can only know the types of the nodes to a certain extent through the characteristics such as node colors and node shapes, and can search for the required nodes through the interaction modes such as mouse hovering and clicking one by one, so that the identification of the user is greatly influenced.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The application provides a knowledge graph visualization method, a knowledge graph visualization device, knowledge graph visualization equipment and a computer readable medium, and aims to solve the technical problem that a plane effect graph cannot clearly and effectively display node information.
According to an aspect of an embodiment of the present application, there is provided a method for knowledge-graph visualization, including: creating a target scene container through a three-dimensional engine, wherein the three-dimensional engine is used for visualizing three-dimensional data, the target scene container has three-dimensional coordinates, and the target scene container is used for accommodating a three-dimensional space; creating a first polyhedron background ball in the three-dimensional space of the target scene container, wherein the first polyhedron background ball consists of a plurality of identical planes, the intersecting positions of adjacent planes form the vertex of the first polyhedron background ball, and the number of the planes forming the first polyhedron background ball is the preset number of faces; and generating nodes on the first polyhedron background ball by utilizing the relation data in the target knowledge graph, and generating a relation line between the nodes according to the incidence relation between the relation data.
Optionally, the three-dimensional space includes at least one of a virtual camera, a scene element, and a renderer, and creating the target scene container by the three-dimensional engine includes: calling a first function to create a preset scene, calling a second function to create a virtual camera, and calling a third function to create a renderer, wherein the preset scene is used for representing a three-dimensional space and scene elements in the three-dimensional space, the virtual camera is used for acquiring a picture of the three-dimensional space, and the renderer is used for rendering an object in the picture to a display interface; and adding the preset scene, the virtual camera and the renderer to a preset container to obtain a target scene container.
Optionally, invoking the third function creation renderer comprises: and transferring at least one of the transparency parameter, the anti-aliasing parameter, the device pixel ratio and the color parameter to a third function to create a renderer according to at least one of the transparency parameter, the anti-aliasing parameter, the device pixel ratio and the color parameter by using the third function, wherein the third function comprises a construction function used for creating the renderer in a target three-dimensional library, and the target three-dimensional library is an algorithm library obtained by packaging an interface of a development three-dimensional scene by a target development platform.
Optionally, the calling the second function to create the virtual camera includes: passing at least one of the field of view parameter, the window aspect ratio, the start rendering distance, and the cutoff rendering distance to a second function to create a virtual camera in accordance with at least one of the field of view parameter, the window aspect ratio, the start rendering distance, and the cutoff rendering distance using the second function, the second function including a constructor in the target three-dimensional library for creating the virtual camera.
Optionally, after creating the preset scene representing the three-dimensional space, the method further includes adding a rotation function to the preset scene in at least one of the following manners: enabling the preset scene to rotate around an x axis through a first cycle, wherein the first cycle is obtained by calling a fourth function through a scene object of the preset scene by taking the x axis as a parameter, and the fourth function is a target three-dimensional library-in-library function and is used for providing a rotation function; enabling the preset scene to rotate around the y axis through a second cycle, wherein the second cycle is obtained by calling a fourth function through a scene object of the preset scene by taking the y axis as a parameter; and rotating the preset scene around the z axis through a third cycle, wherein the third cycle is obtained by calling a fourth function through a scene object of the preset scene by taking the z axis as a parameter.
Optionally, creating the first polyhedral background sphere in the three-dimensional space of the object scene container comprises: and transferring the sphere radius and the target multiple to a fifth function as parameters, and creating a first polyhedral background sphere according to the sphere radius and the target multiple by using the fifth function, wherein the number of planes forming the first polyhedral background sphere is the target multiple times of the preset number of planes, and the fifth function comprises a construction function for creating the polyhedral background sphere in a target three-dimensional library.
Optionally, the generating nodes on the first polyhedron background ball by using the relationship data in the target knowledge graph, and the generating the relationship lines between the nodes according to the association relationship between the relationship data includes: randomly storing the relation data into the three-dimensional coordinates of the vertex of the first polyhedron background ball to take the vertex of the first polyhedron background ball as a node of the knowledge graph; creating a node character label and a relation character label for each node storing relation data, wherein the node character label is used for indicating the content of the relation data stored in the corresponding node, and the relation character label is used for indicating the incidence relation between the relation data stored in the corresponding node and the relation data of other nodes; and selecting one of the two nodes for storing the relationship data with the incidence relationship as a starting point and the other node as an end point, and constructing a relationship line connected from the starting point to the end point.
Alternatively, in the case where the number of relationship data is larger than the number of vertices of the first polyhedral background sphere, the target multiple is increased to recreate the second polyhedral background sphere having more vertices.
Optionally, after adding the relationship line, the method further comprises: adding a node click event and a relation click event for a node storing the relation data, wherein the node click event comprises at least one operation of checking the node, adding data, deleting data, modifying the color of the node and modifying the shape of the node; an interaction control is added for each relational click event.
According to another aspect of the embodiments of the present application, there is provided a knowledge-graph visualization apparatus, including: the scene container creating module is used for creating a target scene container through a three-dimensional engine, the three-dimensional engine is used for visualizing three-dimensional data, the target scene container has three-dimensional coordinates, and the target scene container is used for accommodating a three-dimensional space; the polyhedron background ball creating module is used for creating a first polyhedron background ball in the three-dimensional space of the target scene container, wherein the first polyhedron background ball is composed of a plurality of identical planes, the intersecting positions of adjacent planes form the vertex of the first polyhedron background ball, and the number of the planes forming the first polyhedron background ball is the preset number of faces; and the knowledge graph importing module is used for generating nodes on the first polyhedron background ball by using the relation data in the target knowledge graph and generating a relation line between the nodes according to the incidence relation between the relation data.
According to another aspect of the embodiments of the present application, there is provided an electronic device, including a memory, a processor, a communication interface, and a communication bus, where the memory stores a computer program executable on the processor, and the memory and the processor communicate with each other through the communication bus and the communication interface, and the processor implements the steps of the method when executing the computer program.
According to another aspect of embodiments of the present application, there is also provided a computer readable medium having non-volatile program code executable by a processor, the program code causing the processor to perform the above-mentioned method.
Compared with the related art, the technical scheme provided by the embodiment of the application has the following advantages:
the technical scheme includes that a target scene container is created through a three-dimensional engine, the three-dimensional engine is used for visualizing three-dimensional data, the target scene container has three-dimensional coordinates, and the target scene container is used for accommodating a three-dimensional space; creating a first polyhedron background ball in the three-dimensional space of the target scene container, wherein the first polyhedron background ball consists of a plurality of identical planes, the intersecting positions of adjacent planes form the vertex of the first polyhedron background ball, and the number of the planes forming the first polyhedron background ball is the preset number of faces; and generating nodes on the first polyhedron background ball by utilizing the relation data in the target knowledge graph, and generating a relation line between the nodes according to the incidence relation between the relation data. The knowledge graph 3d visualization method based on the WebGL is adopted, the relationship data of the knowledge graph and the incidence relationship between the data are borne through the polyhedron background ball, the three-dimensional relationship graph can be displayed in an all-around mode, more knowledge graph information can be displayed for a user, and the technical problem that a plane effect graph cannot clearly and effectively display node information is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the technical solutions in the embodiments or related technologies of the present application, the drawings needed to be used in the description of the embodiments or related technologies will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without any creative effort.
FIG. 1 is a schematic diagram of a hardware environment of an alternative knowledge-graph visualization method provided in an embodiment of the present application;
FIG. 2 is a flow chart of an alternative knowledge-graph visualization method provided in accordance with an embodiment of the present application;
FIG. 3 is a diagram of an alternative three-dimensional scene development component relationship;
FIG. 4 is a schematic view of a visual formation;
fig. 5 is a schematic diagram of an alternative camera for acquiring a three-dimensional scene according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of an alternative polyhedral background sphere provided in an embodiment of the present application;
FIG. 7 is a schematic diagram of an alternative polyhedral background sphere provided in an embodiment of the present application;
FIG. 8 is a schematic diagram of an alternative knowledge-graph visualization provided by an embodiment of the present application;
FIG. 9 is a block diagram of an alternative knowledge-graph visualization apparatus provided by an embodiment of the present application;
fig. 10 is a schematic structural diagram of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. 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 application.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for the convenience of description of the present application, and have no specific meaning in themselves. Thus, "module" and "component" may be used in a mixture.
First, partial nouns or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
a 3D engine: the 3D engine is a set of algorithm implementations that abstracts real materials into expressions such as polygons or various curves, performs correlation calculations in a computer, and outputs a final image. The 3D engine is like building a "real world" in a computer.
A renderer: the renderer is the core part of the 3D engine, and is an advanced global lighting rendering plug-in. It accomplishes the task of drawing 3D objects onto the screen. The renderer is divided into a hardware renderer and a software renderer.
Scene container: since the 3D engine may be used to manage a huge 3D world, there are usually some relations/dependencies/influences and influenced relations between objects in the world, how to organize the relations and exactly relate the relations to other functions of the 3D engine is the work that the scene management needs to perform, and the work of the scene management is performed in the scene container. Scene management first needs to consider the association relationship of objects in a scene, which is usually realized by a scene graph. The requirement can already be satisfied by a one-to-many tree structure, and certainly, considering the sharing and maintenance of the data layer, allowing the subtree to perform Clone is also one aspect to be considered in the early design. After that, the inheritance relationship of the materials between the objects needs to be considered, and how the dynamic environment is embedded into the scene graph selected by you. In an engine that allows for interaction and triggering mechanisms, it is also necessary to consider how messages are sent between objects. (e.g., a scenario incorporating a physics engine). In fact, the various algorithms and designs you are involved in the whole engine are more or less linked to scene management. For example, in an engine for implementing dynamic light and shadow, how to implement mutual occlusion between objects and how to inherit the influence range of a light source on a scene graph are all issues to be considered in design.
WebGL: WebGL (Web Graphics library) is a 3D drawing protocol, the drawing technical standard allows JavaScript and OpenGL ES 2.0 to be combined together, and by adding one JavaScript binding of OpenGL ES 2.0, WebGL can provide hardware 3D accelerated rendering for HTML5Canvas, so that Web developers can more smoothly display 3D scenes and models in a browser by means of a system display card, and complicated navigation and data visualization can be created. Obviously, the WebGL technical standard eliminates the trouble of developing web page-specific rendering plug-ins, can be used to create web site pages with complex 3D structures, and can even be used to design 3D web games, and the like.
In the related technology, the display form of the knowledge graph mainly displays a force guidance phase diagram and an annular layout diagram represented by echarts and D3 frames, although a relational graph can be well displayed, the force guidance layout diagram and the annular layout diagram are both displayed in a 2D form, the visual angle of a plane effect diagram is single, and the comprehensive feeling cannot be brought, once the number of nodes of the graph is slightly increased, the graph in the area is difficult to clearly and effectively display the information of the nodes, even the most basic information such as node names cannot be effectively displayed, a user can only know the types of the nodes to a certain extent through the characteristics such as node colors and node shapes, and the nodes are operated one by one through interactive modes such as mouse hovering and clicking to search for the required nodes, so that the identification of the user is greatly influenced.
To address the problems noted in the background, according to an aspect of embodiments of the present application, an embodiment of a method for knowledge-graph visualization is provided. The technical scheme provides a knowledge graph 3d visualization method based on WebGL, the three-dimensional relationship graph can be displayed in an all-round mode, a user can click relationship nodes to freely drag and rotate and click to display detailed information, and interaction operation of the knowledge graph can be friendly and thorough.
Alternatively, in the embodiment of the present application, the method described above may be applied to a hardware environment formed by the terminal 101 and the server 103 as shown in fig. 1. As shown in fig. 1, a server 103 is connected to a terminal 101 through a network, which may be used to provide services for the terminal or a client installed on the terminal, and a database 105 may be provided on the server or separately from the server, and is used to provide data storage services for the server 103, and the network includes but is not limited to: wide area network, metropolitan area network, or local area network, and the terminal 101 includes but is not limited to a PC, a cell phone, a tablet computer, and the like.
A method in this embodiment may be executed by the server 103, or may be executed by both the server 103 and the terminal 101, as shown in fig. 2, where the method may include the following steps:
step S202, a target scene container is created through a three-dimensional engine, the three-dimensional engine is used for visualizing three-dimensional data, the target scene container has three-dimensional coordinates, and the target scene container is used for accommodating a three-dimensional space.
Js, and unity3d may also be adopted as the three-dimensional engine in the embodiment of the present application. Js is a 3D engine running in a browser that can be used by users to create various three-dimensional scenes, including various objects such as cameras, shadows, textures, etc. Js is an easy-to-use 3D library formed by encapsulating and simplifying the WebGL interface using JavaScript. The WebGL technical standard eliminates the trouble of developing web page-specific rendering plug-ins, and can be used to create web site pages with complex 3D structures.
Js is shown in fig. 3. The Scene (Scene) includes Light sources (Light) and Objects (Objects), and the Objects include Geometry (Geometry), Material (Material), and Texture (Texture). A Camera (Camera) acquires a scene picture, and a Renderer (Renderer) renders objects in the picture to a View (View) in real time, wherein the View is the picture seen by a user. Elements in a picture may be drawn by a Canvas (Canvas), and the drawing objects may be scalable vector graphics.
The visual formation of the human eye is shown in fig. 4, and the basic component relationship of three. Light and objects in the world form vision through the eye in the optic nerve center.
Optionally, the three-dimensional space includes at least one of a virtual camera, a scene element, and a renderer, and creating the target scene container by the three-dimensional engine includes: calling a first function to create a preset scene, calling a second function to create a virtual camera, and calling a third function to create a renderer, wherein the preset scene is used for representing a three-dimensional space and scene elements in the three-dimensional space, the virtual camera is used for acquiring a picture of the three-dimensional space, and the renderer is used for rendering an object in the picture to a display interface; and adding the preset scene, the virtual camera and the renderer to a preset container to obtain a target scene container.
In the embodiment of the application, the virtual camera in the 3D software hardly has any defects of real shooting, has no weight and size, can penetrate through any wall and floor, and can move without limitation. The virtual camera can simulate lens distortion, aberration, coma, facula, smear, film granularity, motion blur, field depth, focal length, motion sense of the shoulder-carried camera and the like. The virtual camera has an infinite scale of sensitivity, as everything is determined by the renderer. Scene elements include the background, miscellaneous objects, the sky, etc. The renderer is the core part of the 3D engine, and is an advanced global lighting rendering plug-in. It accomplishes the task of drawing 3D objects onto the screen. The renderer is divided into a hardware renderer and a software renderer.
The first function may be the constructor, three.
The second function may be a constructor PerspectiveCamera provided by three. The virtual camera created by the constructor has a perspective effect.
As an optional implementation, the calling the second function to create the virtual camera includes: passing at least one of the field of view parameter, the window aspect ratio, the start rendering distance, and the cutoff rendering distance to a second function to create a virtual camera in accordance with at least one of the field of view parameter, the window aspect ratio, the start rendering distance, and the cutoff rendering distance using the second function, the second function including a constructor in the target three-dimensional library for creating the virtual camera.
In the embodiment of the present application, the setting of the virtual camera may be as shown in fig. 5, and the parameters of the constructor perspectocamera of the virtual camera may be four attribute values of fov, aspect, near, and far. fov, the field of view is the range of angles that can be seen, the human eye can see about 180 degrees of field of view, the size of the field of view is set according to the specific application, the game will be set to 60-90 degrees, and the default value is 45. aspect represents the aspect ratio of the rendered window, and if there is only one full screen canvas on a webpage and only one window on the canvas, the value of aspect is the aspect ratio of the client area of the webpage window: window. lnnerwidth/window. lnnerheight. The near attribute indicates how far from the camera the rendering starts, i.e. the rendering distance starts, and is typically set to a small value, which is 0.1 by default. And cutting the field of view at the starting rendering distance to obtain a near cutting surface. The far attribute represents how far the position from the camera is to cut off rendering, namely, the rendering distance is cut off, if the set value is smaller, a part of the scene cannot be seen, and the default value of the far attribute is 1000. And cutting the view field at the cut rendering distance to obtain a far cutting section. The network model within the field of view is a model of a three-dimensional object.
Js may provide the constructor WebGLRenderer.
As an optional implementation, the calling the third function creation renderer includes: and transferring at least one of the transparency parameter, the anti-aliasing parameter, the device pixel ratio and the color parameter to a third function to create a renderer according to at least one of the transparency parameter, the anti-aliasing parameter, the device pixel ratio and the color parameter by using the third function, wherein the third function comprises a construction function used for creating the renderer in a target three-dimensional library, and the target three-dimensional library is an algorithm library obtained by packaging an interface of a development three-dimensional scene by a target development platform.
In the embodiment of the application, the target three-dimensional library is three. The interface for developing the three-dimensional scene is a WebGL interface.
Optionally, after the preset scene is created, the method further includes rotating the preset scene in at least one of the following manners:
enabling the preset scene to rotate around an x axis through a first cycle, wherein the first cycle is obtained by calling a fourth function through a scene object of the preset scene by taking the x axis as a parameter, and the fourth function is a target three-dimensional library-in-library function and is used for providing a rotation function;
enabling the preset scene to rotate around the y axis through a second cycle, wherein the second cycle is obtained by calling a fourth function through a scene object of the preset scene by taking the y axis as a parameter;
and rotating the preset scene around the z axis through a third cycle, wherein the third cycle is obtained by calling a fourth function through a scene object of the preset scene by taking the z axis as a parameter.
In the embodiment of the application, the loop can be created through an animate function. The fourth function may be the library function rotation provided by three. Rotation of the scene can be set by a rotation function, e.g. scene. Rotating the scene changes the picture captured by the camera, and in order to make the picture smooth, it is necessary to draw the scene at a high frequency by the renderer.
Step S204, a first polyhedron background ball is created in the three-dimensional space of the target scene container, the first polyhedron background ball is composed of a plurality of identical planes, the intersecting positions of adjacent planes form the vertex of the first polyhedron background ball, and the number of the planes forming the first polyhedron background ball is the preset number of faces.
In the embodiment of the application, the first polyhedron background ball is a closed ball body formed by enclosing a plurality of same planes, and the same planes are the same in size and shape. The surface of the polyhedral background sphere obtained by the method has a vertex formed by intersecting a plurality of planes, the number of the planes forming the first polyhedral background sphere is a preset number of faces, and the preset number of faces can be set to 20, so that the 20-face background sphere is obtained.
As an alternative embodiment, creating the first polyhedral background sphere in the three-dimensional space of the object scene container includes: and transferring the sphere radius and the target multiple to a fifth function as parameters, and creating a first polyhedral background sphere according to the sphere radius and the target multiple by using the fifth function, wherein the number of planes forming the first polyhedral background sphere is the target multiple times of the preset number of planes, and the fifth function comprises a construction function for creating the polyhedral background sphere in a target three-dimensional library.
In this embodiment, the fifth function may be a constructor, say. The parameters of the function may include sphere radius and multiple. The multiple defaults to 1, and when n is set, the surface of the geometric body is n times of the preset surface number, and as shown in fig. 6, 20 surfaces of background balls are created according to the preset surface number of 20 and the multiple of 1. Each face in the figure is the same triangle, and the number of the 20-face background ball is 42.
Alternatively, in the case where the number of relationship data is larger than the number of vertices of the first polyhedral background sphere, the target multiple is increased to recreate the second polyhedral background sphere having more vertices.
In the embodiment of the application, when the number of the relation data of the knowledge graph to be displayed is greater than the vertex of the first polyhedron background ball, the target multiple needs to be increased, so that a second polyhedron background ball composed of more planes is created, and the vertex of the second polyhedron background ball is correspondingly increased, so that the relation data can be completely displayed on the vertex of the sphere. The corresponding relation between the target multiple and the number of the vertexes is 1-42, 2-162, 3-642, 4-2562 and the like. Fig. 7 shows a 40-surface background sphere created according to a preset number of surfaces of 20 and a multiple of 2.
And step S206, generating nodes on the first polyhedron background ball by using the relation data in the target knowledge graph, and generating relation lines among the nodes according to the relation among the relation data.
Optionally, the generating nodes on the first polyhedron background ball by using the relationship data in the target knowledge graph, and the generating the relationship lines between the nodes according to the association relationship between the relationship data includes: randomly storing the relation data into the three-dimensional coordinates of the vertex of the first polyhedron background ball to take the vertex of the first polyhedron background ball as a node of the knowledge graph; creating a node character label and a relation character label for each node storing relation data, wherein the node character label is used for indicating the content of the relation data stored in the corresponding node, and the relation character label is used for indicating the incidence relation between the relation data stored in the corresponding node and the relation data of other nodes; and selecting one of the two nodes for storing the relationship data with the incidence relationship as a starting point and the other node as an end point, and constructing a relationship line connected from the starting point to the end point.
In the embodiment of the application, after the first polyhedron background ball is obtained, the basis for displaying the knowledge graph in the three-dimensional space is obtained, and at this time, the relation data in the knowledge graph needs to be added to the vertex of the first polyhedron background ball, so that the vertex of the first polyhedron background ball is used as the node of the knowledge graph. A custom map can be drawn through the canvas, the custom map including node word labels and relationship word labels. The node text label may be the content of the node, such as a person name, an object name, a movie name, a business name, and the like. The relational text labels can be nodes and associations between the nodes, such as personal social relations, enterprise associations, movie box office influence relations and the like. The relationship line between the construction nodes can be realized by the construction function, line, provided by three. The function creates a line of relationship for the starting point to the ending point. Fig. 8 is a schematic diagram showing a knowledge graph constructed by social relationships between persons and a polyhedron background ball. The user can rotate the polyhedron background ball, so that the knowledge graph can be observed in multiple directions and three dimensions.
Optionally, after adding the relationship line, the method further comprises: adding a node click event and a relation click event for a node storing the relation data, wherein the node click event comprises at least one operation of checking the node, adding data, deleting data, modifying the color of the node and modifying the shape of the node; an interaction control is added for each relational click event.
In the embodiment of the application, mouse click events such as viewing, adding data, deleting data, modifying node colors and modifying node shapes can be set for each node. Mouse-over events may also be set, such as showing profile information while the mouse is hovering, and the like.
By adopting the technical scheme of the spirit, the relation map can be presented through the three-dimensional model, the user experience is high, the interactivity is strong, and the intuition is better.
According to still another aspect of an embodiment of the present application, as shown in fig. 9, there is provided a knowledge-graph visualization apparatus including:
a scene container creating module 901, configured to create a target scene container through a three-dimensional engine, where the three-dimensional engine is configured to visualize three-dimensional data, the target scene container has three-dimensional coordinates, and the target scene container is configured to accommodate a three-dimensional space;
a polyhedron background ball creating module 903, configured to create a first polyhedron background ball in a three-dimensional space of the target scene container, where the first polyhedron background ball is composed of multiple identical planes, an intersection position of adjacent planes forms a vertex of the first polyhedron background ball, and the number of planes forming the first polyhedron background ball is a preset number of faces;
the knowledge graph importing module 905 is configured to generate nodes on the first polyhedron background ball by using the relationship data in the target knowledge graph, and generate a relationship line between the nodes according to an association relationship between the relationship data.
It should be noted that the scene container creating module 901 in this embodiment may be configured to execute step S202 in this embodiment, the polyhedron background sphere creating module 903 in this embodiment may be configured to execute step S204 in this embodiment, and the knowledge graph importing module 905 in this embodiment may be configured to execute step S206 in this embodiment.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
Optionally, the scene container creating module is specifically configured to: calling a first function to create a preset scene, calling a second function to create a virtual camera, and calling a third function to create a renderer, wherein the preset scene is used for representing a three-dimensional space and scene elements in the three-dimensional space, the virtual camera is used for acquiring a picture of the three-dimensional space, and the renderer is used for rendering an object in the picture to a display interface; and adding the preset scene, the virtual camera and the renderer to a preset container to obtain a target scene container.
Optionally, the scene container creating module is specifically configured to: and transferring at least one of the transparency parameter, the anti-aliasing parameter, the device pixel ratio and the color parameter to a third function to create a renderer according to at least one of the transparency parameter, the anti-aliasing parameter, the device pixel ratio and the color parameter by using the third function, wherein the third function comprises a construction function used for creating the renderer in a target three-dimensional library, and the target three-dimensional library is an algorithm library obtained by packaging an interface of a development three-dimensional scene by a target development platform.
Optionally, the scene container creating module is specifically configured to: passing at least one of the field of view parameter, the window aspect ratio, the start rendering distance, and the cutoff rendering distance to a second function to create a virtual camera in accordance with at least one of the field of view parameter, the window aspect ratio, the start rendering distance, and the cutoff rendering distance using the second function, the second function including a constructor in the target three-dimensional library for creating the virtual camera.
Optionally, the scene container creating module is further configured to: enabling the preset scene to rotate around an x axis through a first cycle, wherein the first cycle is obtained by calling a fourth function through a scene object of the preset scene by taking the x axis as a parameter, and the fourth function is a target three-dimensional library-in-library function and is used for providing a rotation function; enabling the preset scene to rotate around the y axis through a second cycle, wherein the second cycle is obtained by calling a fourth function through a scene object of the preset scene by taking the y axis as a parameter; and rotating the preset scene around the z axis through a third cycle, wherein the third cycle is obtained by calling a fourth function through a scene object of the preset scene by taking the z axis as a parameter.
Optionally, the polyhedron background ball creating module is specifically configured to: and transferring the sphere radius and the target multiple to a fifth function as parameters, and creating a first polyhedral background sphere according to the sphere radius and the target multiple by using the fifth function, wherein the number of planes forming the first polyhedral background sphere is the target multiple times of the preset number of planes, and the fifth function comprises a construction function for creating the polyhedral background sphere in a target three-dimensional library.
Optionally, the knowledge-graph importing module is specifically configured to: randomly storing the relation data into the three-dimensional coordinates of the vertex of the first polyhedron background ball to take the vertex of the first polyhedron background ball as a node of the knowledge graph; creating a node character label and a relation character label for each node storing relation data, wherein the node character label is used for indicating the content of the relation data stored in the corresponding node, and the relation character label is used for indicating the incidence relation between the relation data stored in the corresponding node and the relation data of other nodes; and selecting one of the two nodes for storing the relationship data with the incidence relationship as a starting point and the other node as an end point, and constructing a relationship line connected from the starting point to the end point.
Optionally, the polyhedron background ball creating module is further configured to: in the case where the number of relationship data is larger than the number of vertices of the first polyhedral background sphere, the target multiple is increased to recreate the second polyhedral background sphere having more vertices.
Optionally, the apparatus for knowledge-graph visualization further includes an event adding module, configured to: adding a node click event and a relation click event for a node storing the relation data, wherein the node click event comprises at least one operation of checking the node, adding data, deleting data, modifying the color of the node and modifying the shape of the node; an interaction control is added for each relational click event.
According to another aspect of the embodiments of the present application, there is provided an electronic device, as shown in fig. 10, including a memory 1001, a processor 1003, a communication interface 1005 and a communication bus 1007, where the memory 1001 stores therein a computer program that is executable on the processor 1003, the memory 1001 and the processor 1003 communicate with each other through the communication interface 1005 and the communication bus 1007, and the processor 1003 implements the steps of the method when executing the computer program.
The memory and the processor in the electronic equipment are communicated with the communication interface through a communication bus. The communication bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
There is also provided, in accordance with yet another aspect of an embodiment of the present application, a computer-readable medium having non-volatile program code executable by a processor.
Optionally, in an embodiment of the present application, a computer readable medium is configured to store program code for the processor to perform the following steps:
creating a target scene container through a three-dimensional engine, wherein the three-dimensional engine is used for visualizing three-dimensional data, the target scene container has three-dimensional coordinates, and the target scene container is used for accommodating a three-dimensional space;
creating a first polyhedron background ball in the three-dimensional space of the target scene container, wherein the first polyhedron background ball consists of a plurality of identical planes, the intersecting positions of adjacent planes form the vertex of the first polyhedron background ball, and the number of the planes forming the first polyhedron background ball is the preset number of faces;
and generating nodes on the first polyhedron background ball by utilizing the relation data in the target knowledge graph, and generating a relation line between the nodes according to the incidence relation between the relation data.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
When the embodiments of the present application are specifically implemented, reference may be made to the above embodiments, and corresponding technical effects are achieved.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the Processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented by means of units performing the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and in actual implementation, there may be other divisions, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and 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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or make a contribution to the prior art, or may be implemented in the form of a software product stored in a storage medium and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk. It is noted that, in this document, 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.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of knowledge-graph visualization, comprising:
creating a target scene container by a three-dimensional engine, wherein the three-dimensional engine is used for visualizing three-dimensional data, the target scene container has three-dimensional coordinates, and the target scene container is used for accommodating a three-dimensional space;
creating a first polyhedron background ball in the three-dimensional space of the target scene container, wherein the first polyhedron background ball consists of a plurality of identical planes, the intersecting positions of adjacent planes form the vertex of the first polyhedron background ball, and the number of the planes forming the first polyhedron background ball is a preset number of faces;
and generating nodes on the first polyhedron background ball by utilizing the relation data in the target knowledge graph, and generating a relation line between the nodes according to the incidence relation between the relation data.
2. The method of claim 1, wherein the three-dimensional space includes at least one of a virtual camera, a scene element, and a renderer, and wherein creating the target scene container by the three-dimensional engine comprises:
calling a first function to create a preset scene, calling a second function to create a virtual camera, and calling a third function to create a renderer, wherein the preset scene is used for representing the three-dimensional space and scene elements in the three-dimensional space, the virtual camera is used for acquiring a picture of the three-dimensional space, and the renderer is used for rendering objects in the picture to a display interface;
and adding the preset scene, the virtual camera and the renderer to a preset container to obtain the target scene container.
3. The method of claim 2, wherein invoking the third function-creating renderer comprises:
and transferring at least one of a transparency parameter, an anti-aliasing parameter, a device pixel ratio and a color parameter to the third function so as to create the renderer according to at least one of the transparency parameter, the anti-aliasing parameter, the device pixel ratio and the color parameter by using the third function, wherein the third function comprises a construction function for creating the renderer in a target three-dimensional library, and the target three-dimensional library is an algorithm library obtained by packaging an interface of a target development platform for developing a three-dimensional scene.
4. The method of claim 3, wherein invoking the second function to create the virtual camera comprises:
passing at least one of a field of view parameter, a window aspect ratio, a starting rendering distance, and a stopping rendering distance to the second function to create the virtual camera in accordance with the at least one of the field of view parameter, the window aspect ratio, the starting rendering distance, and the stopping rendering distance using the second function, wherein the second function comprises a constructor function in the target three-dimensional library used to create the virtual camera.
5. The method of claim 4, wherein after creating the preset scene representing the three-dimensional space, the method further comprises rotating the preset scene in at least one of the following ways:
enabling the preset scene to rotate around an x axis through a first cycle, wherein the first cycle is obtained by calling a fourth function through a scene object of the preset scene by taking the x axis as a parameter, and the fourth function is the target three-dimensional library-in-library function and is used for providing a rotation function;
enabling the preset scene to rotate around a y axis through a second cycle, wherein the second cycle is obtained by calling the fourth function through a scene object of the preset scene by taking the y axis as a parameter;
and rotating the preset scene around a z axis through a third cycle, wherein the third cycle is obtained by calling the fourth function through a scene object of the preset scene by taking the z axis as a parameter.
6. The method of claim 5, wherein creating a first polyhedral background sphere in the three-dimensional space of the target scene container comprises:
and transferring the sphere radius and the target multiple to a fifth function as parameters, so as to create the first polyhedron background ball according to the sphere radius and the target multiple by using the fifth function, wherein the number of planes forming the first polyhedron background ball is the target multiple times of the preset number of faces, and the fifth function comprises a construction function used for creating the polyhedron background ball in the target three-dimensional library.
7. The method of claim 6, wherein generating nodes on the first polyhedron background sphere using relationship data in a target knowledge-graph and generating relationship lines between nodes according to incidence relationships between the relationship data comprises:
randomly storing the relation data into the three-dimensional coordinates of the vertex of the first polyhedron background ball so as to take the vertex of the first polyhedron background ball as the node of the knowledge graph;
creating a node character label and a relation character label for each node stored with the relation data, wherein the node character label is used for indicating the content of the relation data stored in the corresponding node, and the relation character label is used for indicating the incidence relation between the relation data stored in the corresponding node and the relation data of other nodes;
and selecting one of the two nodes for storing the relationship data with the incidence relationship as a starting point and the other node as an end point, and constructing a relationship line connected from the starting point to the end point.
8. A knowledge-graph visualization apparatus, comprising:
a scene container creation module to create a target scene container by a three-dimensional engine, wherein the three-dimensional engine is to visualize three-dimensional data, the target scene container having three-dimensional coordinates, the target scene container to accommodate a three-dimensional space;
a polyhedron background ball creating module, configured to create a first polyhedron background ball in a three-dimensional space of the target scene container, where the first polyhedron background ball is composed of multiple identical planes, an intersection position of adjacent planes constitutes a vertex of the first polyhedron background ball, and the number of planes constituting the first polyhedron background ball is a preset number of planes;
and the knowledge graph importing module is used for generating nodes on the first polyhedron background ball by using the relation data in the target knowledge graph and generating a relation line between the nodes according to the incidence relation between the relation data.
9. An electronic device comprising a memory, a processor, a communication interface and a communication bus, wherein the memory stores a computer program operable on the processor, and the memory and the processor communicate via the communication bus and the communication interface, wherein the processor implements the steps of the method according to any of the claims 1 to 7 when executing the computer program.
10. A computer-readable medium having non-volatile program code executable by a processor, wherein the program code causes the processor to perform the method of any of claims 1 to 7.
CN202110315034.XA 2021-03-24 2021-03-24 Knowledge graph visualization method, device, equipment and computer readable medium Pending CN113282741A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110315034.XA CN113282741A (en) 2021-03-24 2021-03-24 Knowledge graph visualization method, device, equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110315034.XA CN113282741A (en) 2021-03-24 2021-03-24 Knowledge graph visualization method, device, equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN113282741A true CN113282741A (en) 2021-08-20

Family

ID=77276049

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110315034.XA Pending CN113282741A (en) 2021-03-24 2021-03-24 Knowledge graph visualization method, device, equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN113282741A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114742980A (en) * 2022-04-15 2022-07-12 北京航空航天大学云南创新研究院 Three-dimensional exhibition hall browsing method combined with relation map
CN115761082A (en) * 2022-10-21 2023-03-07 圣名科技(广州)有限责任公司 Method and apparatus for rendering three-dimensional graphics, electronic device, and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170032562A1 (en) * 2015-07-28 2017-02-02 Google Inc. System for compositing educational video with interactive, dynamically rendered visual aids
CN109242976A (en) * 2018-08-02 2019-01-18 实野信息科技(上海)有限公司 A method of based on the automatic rotary display of WebGL virtual reality
CN110795557A (en) * 2019-12-11 2020-02-14 北京明略软件系统有限公司 Knowledge graph display method and device
CN111813952A (en) * 2020-06-19 2020-10-23 北京明略软件系统有限公司 Three-dimensional display method and device of knowledge graph
CN112347397A (en) * 2020-11-02 2021-02-09 杭州安恒信息技术股份有限公司 Data visualization method and device based on browser and readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170032562A1 (en) * 2015-07-28 2017-02-02 Google Inc. System for compositing educational video with interactive, dynamically rendered visual aids
CN109242976A (en) * 2018-08-02 2019-01-18 实野信息科技(上海)有限公司 A method of based on the automatic rotary display of WebGL virtual reality
CN110795557A (en) * 2019-12-11 2020-02-14 北京明略软件系统有限公司 Knowledge graph display method and device
CN111813952A (en) * 2020-06-19 2020-10-23 北京明略软件系统有限公司 Three-dimensional display method and device of knowledge graph
CN112347397A (en) * 2020-11-02 2021-02-09 杭州安恒信息技术股份有限公司 Data visualization method and device based on browser and readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114742980A (en) * 2022-04-15 2022-07-12 北京航空航天大学云南创新研究院 Three-dimensional exhibition hall browsing method combined with relation map
CN114742980B (en) * 2022-04-15 2022-12-16 北京航空航天大学云南创新研究院 Three-dimensional exhibition hall browsing method combined with relation map
CN115761082A (en) * 2022-10-21 2023-03-07 圣名科技(广州)有限责任公司 Method and apparatus for rendering three-dimensional graphics, electronic device, and storage medium

Similar Documents

Publication Publication Date Title
Parisi Programming 3D Applications with HTML5 and WebGL: 3D Animation and Visualization for Web Pages
Kent Visualizing astronomical data with Blender
TWI603286B (en) Method for displaying a 3d scene graph on a sreen
KR20070011062A (en) Model 3d construction application program interface
MXPA06012368A (en) Integration of three dimensional scene hierarchy into two dimensional compositing system.
CN103502974A (en) Employing mesh files to animate transitions in client applications
US9754398B1 (en) Animation curve reduction for mobile application user interface objects
CN113282741A (en) Knowledge graph visualization method, device, equipment and computer readable medium
CN111429561A (en) Virtual simulation rendering engine
Lee et al. Sharing ambient objects using real-time point cloud streaming in web-based XR remote collaboration
Schmohl et al. Stuttgart city walk: A case study on visualizing textured dsm meshes for the general public using virtual reality
Sagristà et al. Gaia sky: Navigating the gaia catalog
CN116051713B (en) Rendering method, electronic device, and computer-readable storage medium
CN114119853A (en) Image rendering method, device, equipment and medium
US11625900B2 (en) Broker for instancing
Trapp et al. Colonia 3D communication of virtual 3D reconstructions in public spaces
Limberger et al. Interactive software maps for web-based source code analysis
Malizia Java™ Mobile 3D Graphics
Nagashree et al. Markerless Augmented Reality Application for Interior Designing
Mezhenin et al. Reconstruction of spatial environment in three-dimensional scenes
Gutbell et al. Web-based visualization component for geo-information
Lu Unreal engine nanite foliage shadow imposter
Mendes et al. IMAGO visualization System: an interactive web-based 3D visualization system for cultural heritage applications
Panchal et al. College 3D Model Rendering Using Three JS
Trapp et al. Communication of digital cultural heritage in public spaces by the example of roman cologne

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