CN111966821A - Knowledge graph visualization method based on mechanics principle - Google Patents

Knowledge graph visualization method based on mechanics principle Download PDF

Info

Publication number
CN111966821A
CN111966821A CN202010868187.2A CN202010868187A CN111966821A CN 111966821 A CN111966821 A CN 111966821A CN 202010868187 A CN202010868187 A CN 202010868187A CN 111966821 A CN111966821 A CN 111966821A
Authority
CN
China
Prior art keywords
link
node
edge
data
target
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.)
Granted
Application number
CN202010868187.2A
Other languages
Chinese (zh)
Other versions
CN111966821B (en
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.)
Nanjing Keji Data Technology Co ltd
Original Assignee
Nanjing Keji Data Technology 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 Nanjing Keji Data Technology Co ltd filed Critical Nanjing Keji Data Technology Co ltd
Priority to CN202010868187.2A priority Critical patent/CN111966821B/en
Publication of CN111966821A publication Critical patent/CN111966821A/en
Application granted granted Critical
Publication of CN111966821B publication Critical patent/CN111966821B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/288Entity relationship models
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a knowledge graph visualization method based on a mechanical principle, and belongs to the field of knowledge graph visualization. The method comprises the steps of converting triple data of a knowledge graph into a relation set and an entity set; the relationship set comprises edge data, and the entity set comprises node data; marking the node data of the side data sum; respectively carrying out duplicate removal on the marked edge data and node data; calculating the length of the edge, the intersection point coordinate of the node and the edge and the name coordinate of the edge according to the node data and the edge data; and finally, rendering the nodes and the edges by using the d3.js to obtain a visual knowledge graph. The invention overcomes the defect that the knowledge graph triples cannot be converted into the visual relation graph in the prior art, can convert the knowledge graph triples into the relation graph, can realize the capability of analyzing the problem intuitively through the relation graph, and more intuitively and completely expresses the information contained in the knowledge graph.

Description

Knowledge graph visualization method based on mechanics principle
Technical Field
The invention belongs to the technical field of knowledge graph visualization, and particularly relates to a knowledge graph visualization method based on a mechanical principle.
Background
Google corporation, 11 months 2012, pioneered the concept of Knowledge Graph (KG), which represents the functionality that will add a Knowledge Graph to its search results. The purpose of the method is to improve the capability of a search engine and enhance the search quality and the search experience of a user. According to the statistical data of 1 month in 2015, the KG constructed by Google already has 5 hundred million entities and about 35 hundred million entity relationship information, and has been widely applied to improving the search quality of a search engine. Although the concept of Knowledge Graph (Knowledge Graph) is newer, it is not a completely new research field, as early as 2006, Berners Lee has proposed the idea of data link (linked data), and has called for popularizing and perfecting related technical standards such as uri (uniform resource identifier), rdf (resource distribution frame), owl (web language), to prepare for the coming of a semantic network. The heat tide of semantic network research is lifted later, and the knowledge graph technology is built on the related research results and is a abandonment and sublimation of the existing semantic network technology.
A knowledge graph is typically represented using a triplet form, i.e., G ═ (E, R, S), where E ═ { E1, E2, E3, …, en } is a set of entities in a knowledge base, containing a total of | E | different entities; r { R1, R2, …, rn } is a set of relationships in the knowledge base, containing | R | different relationships;
Figure BDA0002650377470000011
representing a set of triples in a knowledge base. The basic form of the triple mainly comprises an entity 1, a relation, an entity 2, concepts, attributes, attribute values and the like, wherein the entity is the most basic element in the knowledge graph, and different relations exist among different entities. Concepts refer primarily to collections, categories, object types, categories of things, such as people, geographies, etc.; the attributes mainly refer to attributes, characteristics and parameters which the object may have, such as nationality, birthday, and the like; attribute values refer primarily to values of attributes specified by an object, such as china, 1988-09-08, and so on. Each entity (extension of the concept) may be identified with a globally unique determined ID, each attribute-attribute value pair may be used to characterize an entity's intrinsic properties, and a relationship may be used to connect two entities, characterizing an association between them.
For the visualization of the knowledge graph, the prior art also proposes some solutions, such as the name of the invention creation: a big data knowledge graph visualization method and device (application date: 2020, 2 and 27 days; application number: 202010123185.0) are provided, and the method and the device for visualizing the big data knowledge graph are improved, wherein the method comprises the following steps: acquiring data to be visualized; acquiring formatted node data and formatted edge data based on a preset D3.js library aiming at the node data and the edge data in the data to be visualized; based on a preset rendering mode, generating corresponding nodes to be displayed and edges to be displayed according to the formatted node data and the formatted edge data; calculating the position to be displayed of each node to be displayed in the page and the position to be displayed of each edge to be displayed in the page in real time; and rendering the nodes to be displayed and the edges to be displayed into the page based on the positions to be displayed of the nodes to be displayed in the page and the positions to be displayed of the edges to be displayed in the page to obtain the visual knowledge graph. But the disadvantages of this solution are: the operation of the knowledge graph only comprises showing and dragging, and the nodes of the knowledge graph cannot be operated and the relationship between the nodes cannot be shown.
In summary, how to convert the knowledge graph into the visualized relational graph is a problem that needs to be solved urgently in the prior art.
Disclosure of Invention
1. Problems to be solved
The invention overcomes the defect that the knowledge graph triples cannot be converted into the visual relation graph in the prior art, and provides the knowledge graph visualization method based on the mechanics principle, which can convert the knowledge graph triples into the relation graph, can realize the capability of analyzing the problem through the relation graph intuitively, and expresses the information contained in the knowledge graph more intuitively and completely.
2. Technical scheme
In order to solve the problems, the technical scheme adopted by the invention is as follows:
the invention discloses a knowledge graph visualization method based on a mechanical principle, which is characterized by comprising the following steps of:
converting triple data of the knowledge graph into a relation set and an entity set; the relationship set comprises edge data, and the entity set comprises node data; marking the node data of the side data sum; respectively carrying out duplicate removal on the marked edge data and node data; calculating the length of the edge, the intersection point coordinate of the node and the edge name coordinate according to the node data and the edge data; and rendering the nodes and the edges by using d3.js according to the length of the edges, the coordinates of the intersection points of the nodes and the edges and the coordinates of the edge names to obtain the visual knowledge graph.
Further, the specific process of marking the side data and the node data is as follows: and performing association query on the node data, and marking the queried node and the associated edge, wherein the queried node set is idlist, and the edge and node marking set is labellist.
Further, the length of the edge is calculated by the following formula:
link.length=link.name.length*fontSize+n
where, link.length represents the length of the edge, link.name.length represents the length of the edge name, fontSize represents the font size, and n represents a constant.
Furthermore, the specific process of calculating the coordinates of the intersection point of the node and the edge is as follows: the edge data comprises an initial node and an end node, and intersection point coordinates of the nodes and the edges are obtained through calculation according to circle center coordinates of the initial node and the end node.
Further, when the edge is a circle center connecting line between the start node and the end node, the coordinates of the intersection point of the node and the edge are calculated by the following formula:
when link.target.x is equal to link.source.x:
y1=link.target.y-link.source.y>0?link.source.y+r:link.source.y–r;
y2=link.target.y-link.source.y>0?link.target.y-r:link.target.y+r;
x1=link.source.x;
x2=link.target.x;
wherein (link.source.x, link.source.y) is the center coordinates of the start node, (link.target.x, link.target.y) is the center coordinates of the end node, r is the radius values of the start node and the end node, (x1, y1) is the intersection coordinates of the edge and the start node, and (x2, y2) is the intersection coordinates of the edge and the end node;
when link.target.y is equal to link.source.y:
y1=link.source.y;
y2=link.target.y;
x1=link.target.x-link.source.x>0?link.source.x+r:link.source.x-r;
x2=link.target.x-link.source.x>0?link.target.x-r:link.target.x+r;
when link.target.x is not equal to link.source.x and link.target.y is not equal to link.source.y:
Figure BDA0002650377470000031
Figure BDA0002650377470000032
Figure BDA0002650377470000033
Figure BDA0002650377470000034
Figure BDA0002650377470000035
wherein,
Figure BDA0002650377470000036
is the value of the central angle tan between the start node and the end node.
Further, when the edges are located on both sides of the circle center connecting line between the start node and the end node, the coordinates of the intersection point of the node and the edge are calculated by the following formula:
calculating the intersection point coordinates (xm, ym) of the intersection point of the passing edge and the initial node, which is perpendicular to the circle center connecting line:
Figure BDA0002650377470000037
Figure BDA0002650377470000038
Figure BDA0002650377470000041
link, number is the number of layers of the side, and maxlink number is the maximum number value of two sides of the circle center;
and (3) calculating the intersection point coordinates (xn, yn) of the intersection point of the passing edge and the termination node to the circle center connecting line as the perpendicular line:
Figure BDA0002650377470000042
Figure BDA0002650377470000043
further, the edge name coordinates are calculated by the following formula; let sy be link.source.y, sx be link.source.x, tx be link.target.x, ty be link.target.y;
Figure BDA0002650377470000044
dx=(distance-link.name.length*fontSize-2*r)/2
and then calculating dx by using d3.js to obtain dy (dx, dy) as an edge name coordinate.
Further, the specific process of rendering by using d3.js is as follows: and verifying the node data and the edge data, and rendering by using d3.js after verification to obtain a visual knowledge graph.
Further, the specific process of checking the node data and the edge data is as follows: and checking whether the starting node and the ending node of the edge exist or not, and if any node does not exist, filtering the edge.
3. Advantageous effects
Compared with the prior art, the invention has the beneficial effects that:
according to the knowledge graph visualization method based on the mechanics principle, the entities of the knowledge graph of the structured data are used as nodes, and the relations are used as edges, so that the visualization expression of the knowledge graph is realized. And each relation is independently expressed based on the mechanics principle, so that the complete expression of the information in the knowledge map is realized. In addition, through the zooming of the nodes, the nodes which do not need to be displayed are packed, so that the problem analysis capability through the relational graph is realized, and the information contained in the knowledge graph is more intuitively and completely expressed.
Drawings
FIG. 1 is a schematic flow diagram of the process of the present invention;
FIG. 2 is a schematic diagram of coordinates of an intersection of an edge and a node according to the present 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 and completely 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 of the present invention, but not all embodiments; moreover, the embodiments are not relatively independent, and can be combined with each other according to needs, so that a better effect is achieved. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the 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.
For a further understanding of the invention, reference should be made to the following detailed description taken in conjunction with the accompanying drawings and examples.
Example 1
As shown in fig. 1, the method for visualizing a knowledge graph based on mechanical principles of the present invention includes the following steps:
1. data conversion
Converting triple data of the knowledge graph into a relation set and an entity set; it is worth mentioning that the relationship set includes edge data, and the entity set includes node data; the converted data is a data structure that d3.js can process, and the specific structure is as follows:
Figure BDA0002650377470000051
the nodes are entity sets, the nodes record node data, each node at least has two attributes of a name and an id, the name is a display name of the node, and the id is a unique identifier of the node. links records edge data for the relationship set, the edge data represents the relationship between nodes with incidence relationship, each edge records source, target and id, the source is the starting node of the edge, the target is the ending node of the edge, and the id is the unique identifier of the edge.
2. Marking data
Marking the edge data of the relation set and the node data in the entity set; specifically, node data is subjected to correlation query, queried nodes and correlated edges are marked, wherein a queried node set is idlist, and an edge and node marking set is labellist. The specific process comprises the following steps:
2-1) origin associated data query: the initial state comprises an origin and other nodes associated with the origin
Marking the origin as origin; marking other nodes, and marking the other nodes as the id of the starting point, namely the origin point id;
marking the opposite side, wherein the mark is the id of the starting point, namely the id of the original point; the origin id is added to the global variable idList.
2-2) other node association data query: expansion of nodes other than origin
Marking the nodes as label of the expansion nodes and id of the expansion nodes; marking the opposite side, namely marking the label of the expansion node as label plus the id of the expansion node; and adding the id of the expansion node into a global variable idList.
3. Data deduplication
The marked edge data and node data are respectively deduplicated, and since the two nodes may be associated with the same node after being unfolded, the data before marking needs to be compared with the marked data, and the specific steps are as follows:
3-1) performing double traversal on the nodes data before and after marking, and if existing nodes exist in the marked nodes data, namely, removing repeated nodes with the same id.
3-2) performing double traversal on the links data before and after marking, and if existing edges exist in the links data after marking, namely the same id and repeated edges are removed
4. Calculating the length of an edge
Calculating the length of the edge according to the node data and the edge data; specifically, the length of the edge is calculated by the following formula:
link.length=link.name.length*fontSize+n
wherein, link.length represents the length of the side, link.name.length represents the length of the side name, namely the length of the character string of the side name, fontSize represents the font size, specifically the font size of the text set at the front end, and is represented by a positive integer; n represents a constant, the n is used as the length of the margin at two sides of the edge name, and the value range of the n is (0, 10).
5. Calculating coordinates of intersection points of nodes and edges
Referring to fig. 2, intersection coordinates of the node and the edge are calculated according to the node data and the edge data, specifically, the edge data includes a start node and an end node, and the intersection coordinates of the node and the edge are calculated according to circle center coordinates of the start node and the end node. The calculating step comprises:
5-1) grouping the edges; specifically, grouping is performed according to the starting node and the terminating node of the edge, the direction of the connecting line is not distinguished, as long as the edge is connected with the same pair of nodes, namely, the edge is regarded as the same group:
calculating the hash value of the starting node (source) and the terminating node (target) of the edge:
source string length; target string length
Figure BDA0002650377470000071
Comparing hash of source and target:
key=link.source.hash<link.target.hash?link.source+':'+link.target:link.target+':'+
link.source;
where m is the source or target string length, and ASCII (target [ i ]/source [ i ]) is the ASCII code for each character of the target or source.
All edges in links are traversed, and if the keys of the edges are the same, the same group is formed.
5-2) the edges of the same group are uniformly distributed on two sides passing through the circle centers of the two nodes
maxLinkNumber=group.length%2==0?group.length/2:(group.length-1)/2
Wherein, maxlink number is the maximum number value of two side edges, and group.
And marking the layer number of each edge, wherein the edge at the lowest layer is marked as-maxLinkNumber, the layer number marks from bottom to top are sequentially added with 1, namely the layer number mark of a circle center connecting line between the starting node and the ending node is 0, the layer number mark of the edge at the upper layer is sequentially added with 1, and the layer number mark of the edge at the lower layer is sequentially subtracted with 1.
5-3) judging whether the number of layers of the edge is marked by link
5-4) if link, linknum ═ 0, the coordinates of the intersection of the node and the edge (x1, y1), (x2, y2) are calculated by the following formula:
when link.target.x is equal to link.source.x, i.e. when the start node and the end node are on a vertical line:
y1=link.target.y-link.source.y>0?link.source.y+r:link.source.y–r;
y2=link.target.y-link.source.y>0?link.target.y-r:link.target.y+r;
x1=link.source.x;
x2=link.target.x;
wherein (link.source.x, link.source.y) is the center coordinates of the start node, (link.target.x, link.target.y) is the center coordinates of the end node, r is the radius values of the start node and the end node, (x1, y1) is the intersection coordinates of the edge and the start node, and (x2, y2) is the intersection coordinates of the edge and the end node;
when link.target.y is equal to link.source.y, i.e. when the start node and the end node are on a horizontal line:
y1=link.source.y;
y2=link.target.y;
x1=link.target.x-link.source.x>0?link.source.x+r:link.source.x-r;
x2=link.target.x-link.source.x>0?link.target.x-r:link.target.x+r;
when link.target.x is not equal to link.source.x and link.target.y is not equal to link.source.y, i.e. when the start node and the end node are neither on the same horizontal line nor on the same vertical line:
Figure BDA0002650377470000081
Figure BDA0002650377470000082
Figure BDA0002650377470000083
Figure BDA0002650377470000084
Figure BDA0002650377470000085
wherein,
Figure BDA0002650377470000086
is the value of the central angle tan between the start node and the end node.
5-5) if link. linknum is not equal to 0, calculating the coordinates of the intersection of the node and the edge by the following formula:
making a perpendicular line for the circle center connecting line, and calculating the distance a between the intersection point and the circle center connecting line according to the layer number marks of the sides:
a=r*link.linknum/maxLinkNumber
linknum is a layer number mark of a side, and maxlink number is the maximum number value of two side edges of the circle center;
calculating the intersection point coordinates (xm, ym) of the intersection point of the passing edge and the initial node, which is perpendicular to the circle center connecting line:
Figure BDA0002650377470000087
Figure BDA0002650377470000088
when the start node and the end node are on a vertical line:
Figure BDA0002650377470000089
and (3) calculating the intersection point coordinates (xn, yn) of the intersection point of the passing edge and the termination node to the circle center connecting line as the perpendicular line:
Figure BDA00026503774700000810
Figure BDA0002650377470000091
Figure BDA0002650377470000092
wherein (xn, yn) is the intersection point coordinate of the intersection point of the passing edge and the termination node and the connecting line of the circle center as a perpendicular line
When the start node and the end node are on a vertical line:
Figure BDA0002650377470000093
making a perpendicular line between the intersection of the passing edge and the node and a line connecting the circle centers, wherein the slope of the perpendicular line and the x axis is as follows:
tanω=(x1-x2)/(y2-y1)
x-axis distance from the vertical point (xm, ym):
Figure BDA0002650377470000094
y-axis distance from the vertical point (xm, ym):
Figure BDA0002650377470000095
if (y2-y1) is 0
kx=0
ky=a
If a >0:
xs=a>0?xm-kx:xm+kx
ys=ym-ky
xt=a>0?xn-dx:xn+dx
yt=yn-ky
where (xs, ys) is the intersection coordinate of the edge and the start node, and (xt, yt) is the intersection coordinate of the edge and the end node. It is worth mentioning that, in consideration of the display mode of multiple relationships among nodes, multiple relationships among the nodes are not combined into one edge, so that each relationship can be independently expressed, and the complete expression of information in the knowledge graph is realized.
6. Calculating edge name coordinates
Calculating edge name coordinates according to the node data and the edge data; calculating edge name coordinates by the following formula; let sy be link.source.y, sx be link.source.x, tx be link.target.x, ty be link.target.y;
Figure BDA0002650377470000096
dx=(distance-link.name.length*fontSize-2*r)/2
and then calculating dx by using d3.js to obtain dy (dx, dy) as an edge name coordinate.
7. Rendering with d3.js
And rendering the nodes and the edges by using d3.js according to the length of the edges, the intersection point coordinates of the nodes and the edges and the edge name coordinates to obtain a visual knowledge graph. The specific process is as follows: verifying the node data and the edge data, specifically, verifying whether a starting node and an ending node of an edge exist, and if any node of the starting node and the ending node does not exist, filtering the edge; and rendering by using d3.js after verification to obtain a visual knowledge graph.
It should be noted that, in the process of visualization by using d3.js rendering, the specific steps of node expansion and node contraction are as follows:
7-1) node expansion, comprising the following steps:
7-1-1) firstly judging whether the id of the node is already in the idList, if so, indicating that the node is expanded, no extra query is needed, and the node is currently in a contracted state, and only removing the label of the node from the labelList and re-rendering.
7-1-2) if the id of the node does not exist in the idList, the node is not expanded, the associated node and the relationship of the node need to be queried, and the id of the node is added into the idList and is re-rendered.
7-2) node contraction, specifically, adding the label of the node into the label List, and re-rendering. It is worth explaining that through the scaling of the nodes, the nodes which do not need to be displayed are collected, so that the problem analysis capability through the relational graph is realized, and the information contained in the knowledge graph is more intuitively and completely expressed.
According to the knowledge graph visualization method based on the mechanics principle, the entities of the knowledge graph of the structured data are used as nodes, and the relations are used as edges, so that the visualization expression of the knowledge graph is realized. And each relation is independently expressed based on the mechanics principle, so that the complete expression of the information in the knowledge map is realized. In addition, through the zooming of the nodes, the nodes which do not need to be displayed are packed, so that the problem analysis capability through the relational graph is realized, and the information contained in the knowledge graph is more intuitively and completely expressed.
The invention has been described in detail hereinabove with reference to specific exemplary embodiments thereof. It will, however, be understood that various modifications and changes may be made without departing from the scope of the invention as defined in the appended claims. The detailed description and drawings are to be regarded as illustrative rather than restrictive, and any such modifications and variations are intended to be included within the scope of the present invention as described herein. Furthermore, the background is intended to be illustrative of the state of the art as developed and the meaning of the present technology and is not intended to limit the scope of the invention or the application and field of application of the invention.

Claims (9)

1. A knowledge graph visualization method based on a mechanical principle is characterized by comprising the following steps:
converting triple data of the knowledge graph into a relation set and an entity set; the relationship set comprises edge data, and the entity set comprises node data;
marking the node data of the side data sum;
respectively carrying out duplicate removal on the marked edge data and node data;
calculating the length of the edge, the intersection point coordinate of the node and the edge name coordinate according to the node data and the edge data;
and rendering the nodes and the edges by using d3.js according to the length of the edges, the coordinates of the intersection points of the nodes and the edges and the coordinates of the edge names to obtain the visual knowledge graph.
2. The knowledge graph visualization method based on the mechanical principle as claimed in claim 1, wherein the specific process of marking the edge data and the node data is as follows: and performing association query on the node data, and marking the queried node and the associated edge, wherein the queried node set is idlist, and the edge and node marking set is labellist.
3. A method of knowledge-graph visualization based on mechanics principles according to claim 1 characterized by that, the length of the edge is calculated by the following formula:
link.length=link.name.length*fontSize+n
where, link.length represents the length of the edge, link.name.length represents the length of the edge name, fontSize represents the font size, and n represents a constant.
4. The method for visualizing the knowledge graph based on the mechanics principle of claim 1, wherein the specific process of calculating the coordinates of the intersection points of the nodes and the edges is as follows: the edge data comprises an initial node and an end node, and intersection point coordinates of the nodes and the edges are obtained through calculation according to circle center coordinates of the initial node and the end node.
5. The method of claim 4, wherein when the edge is a circle center connecting line between the start node and the end node, the coordinates of the intersection point of the node and the edge are calculated by the following formula:
when link.target.x is equal to link.source.x:
y1=link.target.y-link.source.y>0?link.source.y+r:link.source.y–r;
y2=link.target.y-link.source.y>0?link.target.y-r:link.target.y+r;
x1=link.source.x;
x2=link.target.x;
wherein (link.source.x, link.source.y) is the center coordinates of the start node, (link.target.x, link.target.y) is the center coordinates of the end node, r is the radius values of the start node and the end node, (x1, y1) is the intersection coordinates of the edge and the start node, and (x2, y2) is the intersection coordinates of the edge and the end node;
when link.target.y is equal to link.source.y:
y1=link.source.y;
y2=link.target.y;
x1=link.target.x-link.source.x>0?link.source.x+r:link.source.x-r;
x2=link.target.x-link.source.x>0?link.target.x-r:link.target.x+r;
when link.target.x is not equal to link.source.x and link.target.y is not equal to link.source.y:
Figure FDA0002650377460000021
Figure FDA0002650377460000022
Figure FDA0002650377460000023
Figure FDA0002650377460000024
Figure FDA0002650377460000025
wherein,
Figure FDA0002650377460000026
is the value of the central angle tan between the start node and the end node.
6. The method of claim 4, wherein when the edges are located on both sides of the circle-center connecting line between the start node and the end node, the coordinates of the intersection point of the node and the edge are calculated by the following formula:
calculating the intersection point coordinates (xm, ym) of the intersection point of the passing edge and the initial node, which is perpendicular to the circle center connecting line:
Figure FDA0002650377460000027
Figure FDA0002650377460000028
link, number is the number of layers of the side, and maxlink number is the maximum number value of two sides of the circle center;
and (3) calculating the intersection point coordinates (xn, yn) of the intersection point of the passing edge and the termination node to the circle center connecting line as the perpendicular line:
Figure FDA0002650377460000029
Figure FDA0002650377460000031
7. the method for visualizing the knowledge graph based on the mechanical principle of any one of claims 1 to 6, wherein the edge name coordinates are calculated by the following formula; let sy be link.source.y, sx be link.source.x, tx be link.target.x, ty be link.target.y;
Figure FDA0002650377460000032
dx=(distance-link.name.length*fontSize-2*r)/2
and then calculating dx by using d3.js to obtain dy (dx, dy) as an edge name coordinate.
8. The knowledge graph visualization method based on mechanical principle as claimed in claim 7, wherein the specific process of rendering by using d3.js is:
and verifying the node data and the edge data, and rendering by using d3.js after verification to obtain a visual knowledge graph.
9. The method for knowledge graph visualization based on mechanics principle of claim 8, wherein the specific process of checking the node data and the edge data is as follows:
and checking whether the starting node and the ending node of the edge exist or not, and if any node does not exist, filtering the edge.
CN202010868187.2A 2020-08-26 2020-08-26 Knowledge graph visualization method based on mechanics principle Active CN111966821B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010868187.2A CN111966821B (en) 2020-08-26 2020-08-26 Knowledge graph visualization method based on mechanics principle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010868187.2A CN111966821B (en) 2020-08-26 2020-08-26 Knowledge graph visualization method based on mechanics principle

Publications (2)

Publication Number Publication Date
CN111966821A true CN111966821A (en) 2020-11-20
CN111966821B CN111966821B (en) 2024-06-04

Family

ID=73390489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010868187.2A Active CN111966821B (en) 2020-08-26 2020-08-26 Knowledge graph visualization method based on mechanics principle

Country Status (1)

Country Link
CN (1) CN111966821B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114036311A (en) * 2021-11-08 2022-02-11 北京邮电大学 Time sequence visual development method and system based on knowledge graph
CN117112807A (en) * 2023-10-23 2023-11-24 浙江大学 Knowledge graph associated information focus visualization method and system based on mechanical model

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9465891B1 (en) * 2015-04-29 2016-10-11 Data Cocoon LLC Tessellated data visualization system
CN106021836A (en) * 2015-10-12 2016-10-12 苏州中科知图信息科技有限公司 Method and system for generating disciplinary knowledge map based on disciplinary logic knowledge relation
US20170132296A1 (en) * 2015-11-06 2017-05-11 Cloudera, Inc. Database workload analysis and optimization visualizations
CN108363797A (en) * 2018-01-04 2018-08-03 北京工商大学 A kind of associated diagram visual analysis method and its system based on transformation
WO2019057190A1 (en) * 2017-09-25 2019-03-28 腾讯科技(深圳)有限公司 Method and apparatus for displaying knowledge graph, terminal device, and readable storage medium
CN109815327A (en) * 2018-12-07 2019-05-28 南京中新赛克科技有限责任公司 A kind of big data knowledge mapping visibility solution based on SVG
US20190163835A1 (en) * 2017-11-27 2019-05-30 International Business Machines Corporation Structuring incoherent nodes by superimposing on a base knowledge graph
US20190273660A1 (en) * 2016-12-29 2019-09-05 Ping An Technology (Shenzhen) Co., Ltd. Network topology self-adapting data visualization method, device, apparatus, and storage medium
CN110489599A (en) * 2019-07-08 2019-11-22 深圳壹账通智能科技有限公司 Business connection map construction method, apparatus, computer equipment and storage medium
CN110889014A (en) * 2019-10-21 2020-03-17 浙江工业大学 D 3-based method for displaying enterprise association relationship map
CN111026895A (en) * 2019-12-02 2020-04-17 上海交通大学 Data visualization processing method and device and storage medium
CN111259297A (en) * 2020-01-14 2020-06-09 清华大学 Interaction visualization method, platform and system for knowledge graph

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9465891B1 (en) * 2015-04-29 2016-10-11 Data Cocoon LLC Tessellated data visualization system
CN106021836A (en) * 2015-10-12 2016-10-12 苏州中科知图信息科技有限公司 Method and system for generating disciplinary knowledge map based on disciplinary logic knowledge relation
US20170132296A1 (en) * 2015-11-06 2017-05-11 Cloudera, Inc. Database workload analysis and optimization visualizations
US20190273660A1 (en) * 2016-12-29 2019-09-05 Ping An Technology (Shenzhen) Co., Ltd. Network topology self-adapting data visualization method, device, apparatus, and storage medium
WO2019057190A1 (en) * 2017-09-25 2019-03-28 腾讯科技(深圳)有限公司 Method and apparatus for displaying knowledge graph, terminal device, and readable storage medium
US20190163835A1 (en) * 2017-11-27 2019-05-30 International Business Machines Corporation Structuring incoherent nodes by superimposing on a base knowledge graph
CN108363797A (en) * 2018-01-04 2018-08-03 北京工商大学 A kind of associated diagram visual analysis method and its system based on transformation
CN109815327A (en) * 2018-12-07 2019-05-28 南京中新赛克科技有限责任公司 A kind of big data knowledge mapping visibility solution based on SVG
CN110489599A (en) * 2019-07-08 2019-11-22 深圳壹账通智能科技有限公司 Business connection map construction method, apparatus, computer equipment and storage medium
CN110889014A (en) * 2019-10-21 2020-03-17 浙江工业大学 D 3-based method for displaying enterprise association relationship map
CN111026895A (en) * 2019-12-02 2020-04-17 上海交通大学 Data visualization processing method and device and storage medium
CN111259297A (en) * 2020-01-14 2020-06-09 清华大学 Interaction visualization method, platform and system for knowledge graph

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
OMER KOREN: "d3.js Force Layout: drawing multiple straight, parallel links between two nodes", pages 1 - 9, Retrieved from the Internet <URL:https://blog.webiks.com/d3-js-force-layout-straight-parallel-links/> *
匿名: "已知2个圆的圆点坐标、半径。如何求圆心连线与圆交点的坐标?", pages 1 - 2, Retrieved from the Internet <URL:https://www.zhihu.com/question/358981311?utm_id=0> *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114036311A (en) * 2021-11-08 2022-02-11 北京邮电大学 Time sequence visual development method and system based on knowledge graph
CN117112807A (en) * 2023-10-23 2023-11-24 浙江大学 Knowledge graph associated information focus visualization method and system based on mechanical model
CN117112807B (en) * 2023-10-23 2024-01-30 浙江大学 Knowledge graph associated information focus visualization method and system based on mechanical model

Also Published As

Publication number Publication date
CN111966821B (en) 2024-06-04

Similar Documents

Publication Publication Date Title
CN112434169B (en) Knowledge graph construction method and system and computer equipment thereof
CN102156737B (en) Method for extracting subject content of Chinese webpage
CN104866593A (en) Database searching method based on knowledge graph
US20080104020A1 (en) Handwritten Query Builder
Zeleny et al. Box clustering segmentation: A new method for vision-based web page preprocessing
CN113568995B (en) Dynamic tile map manufacturing method and tile map system based on search conditions
JP2002532788A (en) System and method for organizing data
CN105404686A (en) Method for matching place name and address in news event based on geographical feature hierarchical segmented words
CN111966821A (en) Knowledge graph visualization method based on mechanics principle
JP2005122295A (en) Relationship figure creation program, relationship figure creation method, and relationship figure generation device
CN103955549A (en) Web GIS system based on SVG and data input and search method thereof
WO2008008213A2 (en) Interactively crawling data records on web pages
CN110321446B (en) Related data recommendation method and device, computer equipment and storage medium
CN109933702B (en) Retrieval display method, device, equipment and storage medium
CN104317867B (en) The system that entity cluster is carried out to the Web page picture that search engine returns
CN103425789B (en) The querying method of a kind of space-time data and device
CN114547077A (en) Intelligent processing system and method for basic government affair form data
CN115203337A (en) Database metadata relation knowledge graph generation method
CN107016732A (en) Positioned using the 3D objects of descriptor
KR20090037704A (en) Meta data generation method for intutive image search
CN115995087B (en) Document catalog intelligent generation method and system based on fusion visual information
JP6727097B2 (en) Information processing apparatus, information processing method, and program
CN113343140B (en) Method for automatically extracting webpage text content based on neo4j graphic database
CN114238772A (en) Intelligent network map recommendation system with content self-adaptive perception
Lieberman et al. Spatio-textual spreadsheets: Geotagging via spatial coherence

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
GR01 Patent grant
GR01 Patent grant