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

Knowledge graph visualization method based on mechanics principle Download PDF

Info

Publication number
CN111966821B
CN111966821B CN202010868187.2A CN202010868187A CN111966821B CN 111966821 B CN111966821 B CN 111966821B CN 202010868187 A CN202010868187 A CN 202010868187A CN 111966821 B CN111966821 B CN 111966821B
Authority
CN
China
Prior art keywords
link
node
edge
target
source
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.)
Active
Application number
CN202010868187.2A
Other languages
Chinese (zh)
Other versions
CN111966821A (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

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 mechanics principle, and belongs to the field of knowledge graph visualization. The invention converts the triplet data of the knowledge graph into a relation set and an entity set; wherein the set of relationships includes edge data and the set of entities includes node data; marking the edge data and the node data; respectively de-duplicating the marked edge data and node data; calculating the length of the edge, the intersection point coordinates of the node and the edge name coordinates according to the node data and the edge data; and finally, rendering the nodes and the edges by using d3.Js to obtain a visual knowledge graph. The invention overcomes the defect that the knowledge-graph triples cannot be converted into the visualized relationship graph in the prior art, can convert the knowledge-graph triples into the relationship graph, can realize the capability of intuitively analyzing the problem through the relationship 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
The Google company of 11 2012 first proposed the concept of a Knowledge Graph (KG), which represents the function of adding a Knowledge Graph to its search result. The original purpose of the method is to improve the capability of a search engine and enhance the search quality and search experience of users. Based on statistics of month 1 in 2015, *** constructed KG has 5 hundred million entities and about 35 hundred million pieces of entity relationship information, and has been widely used to improve the search quality of search engines. Although the concept of the Knowledge Graph is newer, it is not a brand new research field, and as early as 2006, berners Lee has proposed the idea of data link (LINKED DATA), which calls for popularization and perfecting related technical standards such as URI (Uniform resource identifier), RDF (resource discription framework), OWL (Web ontology language), and provides for the arrival of catering to semantic networks. The method is characterized in that a semantic network research is carried out, and the knowledge graph technology is established on the related research results and is one-time abandonment and sublimation of the existing semantic network technology.
Knowledge maps are typically represented using a triplet format, i.e., g= (E, R, S), where e= { E1, E2, E3, …, en } is a collection of entities in the knowledge base, containing |e| different entities altogether; r= { R1, R2, …, rn } is a set of relationships in the knowledge base, containing |r| different relationships altogether; representing a set of triples in a knowledge base. The basic form of the triplet mainly comprises an entity 1, a relation, an entity 2, a concept, an attribute value and the like, wherein the entity is the most basic element in the knowledge graph, and different relations exist among different entities. Concepts mainly refer to collections, categories, object types, categories of things, such as people, geographies, etc.; attributes mainly refer to attributes, features, characteristics, features and parameters that an object may have, such as nationality, birthday, etc.; the attribute value mainly refers to the value of the object-specified attribute, such as China, 1988-09-08, and the like. 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 the intrinsic properties of the entity, and a relationship may be used to connect the two entities, characterizing the association between them.
For visualization of knowledge patterns, some schemes are also proposed in the prior art, for example, the invention is named: the proposal of the big data knowledge graph visualization method and the device (application date: 2020, 27 days; application number: 202010123185.0) improves the method and the device for the big data knowledge graph visualization, wherein the method comprises the following steps: obtaining data to be visualized; aiming at node data and edge data in the data to be visualized, obtaining formatted node data and formatted edge data based on a preset D3.js library; based on a preset rendering mode, generating corresponding nodes to be displayed and edges to be displayed by 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 side 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 each node to be displayed in the page and the positions to be displayed of each edge to be displayed in the page, so as to obtain a visual knowledge graph. However, this solution has the disadvantage that: the operation of the knowledge graph only comprises display and dragging, and cannot operate the nodes of the knowledge graph and cannot display the relationship among the nodes.
In summary, how to convert the knowledge graph into the visualized relationship graph is a problem to be solved 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 a visualized relationship 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 relationship graph, can realize the capability of intuitively analyzing the problem through the relationship graph, and more intuitively and completely express the information contained in the knowledge graph.
2. Technical proposal
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 mechanics principle, which is characterized by comprising the following steps of:
Converting the triplet data of the knowledge graph into a relation set and an entity set; wherein the set of relationships includes edge data and the set of entities includes node data; marking edge data and node data; respectively de-duplicating the marked edge data and node data; calculating the length of the edge, the intersection point coordinates of the node and the edge name coordinates 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 names of the edges, so as to obtain a visual knowledge graph.
Further, the specific process of marking the edge data and the node data is as follows: and carrying out association query on the node data, and marking the queried nodes and associated edges, wherein the queried node set is idlist, and the queried node marked set is labellist.
Further, 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 edge, link.name.length represents the length of the edge name, fontSize represents the word size, and n represents a constant.
Further, the specific process of calculating the intersection point coordinates of the node and the edge is as follows: the edge data comprises a starting node and a terminating node, and the intersection point coordinates of the nodes and the edges are obtained through calculation according to the circle center coordinates of the starting node and the terminating node.
Further, when the edge is the center connecting line between the starting node and the ending node, the intersection point coordinate of the node and the edge is calculated by the following formula:
When link.target.x is equal to link.source.x:
y1=link.target.y-link.source.y>0link.source.y+r:link.source.y–r;
y2=link.target.y-link.source.y>0link.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, (x 1, y 1) is the intersection coordinates of the edge and the start node, and (x 2, y 2) 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>0link.source.x+r:link.source.x-r;
x2=link.target.x-link.source.x>0link.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:
Wherein, Is the value of the central angle tan between the start node and the end node.
Further, when the edge is located at both sides of the center 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:
and calculating an intersection point coordinate (xm, ym) of the intersection point of the passing edge and the starting node, which is perpendicular to the circle center connecting line:
Wherein a=r, link.link num/maxLinkNumber, link.link num is the layer number mark of the side, maxLinkNumber is the maximum number value of the two sides of the circle center;
and calculating an intersection point coordinate (xn, yn) of the perpendicular line of the intersection point of the passing edge and the termination node to the circle center connecting line:
Further, the edge name coordinates are calculated by the following formula; let sy=link.source.y, sx=link.source.x, tx=link.target.x, ty=link.target.y;
dx=(distance-link.name.length*fontSize-2*r)/2
And calculating dx by using d3.js to obtain dy, (dx, dy) which is the coordinate of the edge name.
Further, the specific process of rendering with d3.Js is: and (3) checking the node data and the edge data, and rendering by using d3.Js after checking to obtain a visual knowledge graph.
Further, the specific process of verifying the node data and the edge data is as follows: checking whether the starting node and the ending node of the edge exist or not, and filtering the edge if any node of the starting node and the ending node does not exist.
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 entity of the knowledge graph of the structured data is taken as a node, and the relationship is taken as an edge, so that the visualization expression of the knowledge graph is realized. And further, each relation is independently expressed based on a mechanical principle, so that the complete expression of information in the knowledge graph is realized. In addition, through node scaling, nodes which do not need to be displayed are packed up, so that the capability of analyzing problems through a relationship graph is realized, and information contained in the knowledge graph is more intuitively and completely expressed.
Drawings
FIG. 1 is a schematic flow chart of the method of the present invention;
FIG. 2 is a schematic diagram of the coordinates of the intersection of an edge and a node according to the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention; moreover, the embodiments are not independent, and can be combined with each other as required, so that a better effect is achieved. Thus, the following detailed description of the embodiments of the invention, as 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 made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
For a further understanding of the present invention, the present invention will be described in detail with reference to the drawings and examples.
Example 1
As shown in fig. 1, the knowledge graph visualization method based on the mechanics principle of the invention comprises the following steps:
1. Data conversion
Converting the triplet data of the knowledge graph into a relation set and an entity set; it is worth noting that the relation set includes edge data, and the entity set includes node data; the converted data is a data structure which can be processed by d3.js, and the specific structure is as follows:
The nodes are entity sets, node data are recorded in the nodes, 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 record edge data for a relation set, the edge data represents the relation among nodes with association relation, each edge records source, target and id, the source is a starting node of the edge, the target is a terminating node of the edge, and the id is a unique identification of the edge.
2. Marking data
Marking edge data of the relation set and node data in the entity set; specifically, the node data is subjected to association query, the queried nodes and associated edges are marked, wherein the queried node set is idlist, and the queried node marked set is labellist. The specific process comprises the following steps:
2-1) origin-related data query: the initialization state comprises an origin and other nodes associated with the origin
Marking an origin, namely an origin; marking other nodes, wherein the id marked as a starting point is the origin id;
marking the opposite side, wherein the id marked as a starting point is the origin id; the origin id is added to the global variable idList.
2-2) Other node association data queries: expansion of nodes other than origin
Marking the node, namely adding the id of the expansion node to the label marked as the expansion node; opposite side marking, namely adding the id of the expansion node to the label of the expansion node; the id of the expanded node is added to the global variable idList.
3. Data deduplication
The marked edge data and the node data are respectively de-duplicated, and the two nodes are possibly related to the same node after being unfolded, so that the data before marking and the data after marking need to be compared, and the specific steps are as follows:
3-1) making two passes of the nodes data before and after marking, if the nodes existing in the nodes data after marking, namely the id is the same, removing the repeated nodes.
3-2) Making two traversals of the links data before and after marking, if the links data after marking have the existing edges, that is, the id is the same, removing the repeated edges
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
The link.name.length represents the length of the edge, namely the length of a character string of the edge name, fontSize represents the font size of a text, particularly the font size of the text, which is set at the front end, and is expressed by a positive integer; n represents a constant, and the value range of n is (0, 10) as the white length on both sides of the edge name.
5. Calculating the intersection point coordinates of nodes and edges
As shown in fig. 2, the coordinates of the intersection point 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 coordinates of the intersection point of the node and the edge are calculated according to the center coordinates of the start node and the end node. The calculation steps comprise:
5-1) grouping edges; specifically, the directions of the connecting lines are not distinguished by grouping according to the starting node and the ending node of the edge, and the same group is considered as the same group as long as the edge is connected with the same pair of nodes:
calculating the hash value of the start node (source) and the end node (target) of the edge:
m (source) =link.source string length; m (target) =link.target string length
Comparing the source and target hashes:
key=link.source.hash<link.target.hashlink.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 of each character of the target or source.
Traversing all edges in links, and if the keys of the edges are the same, obtaining the same group.
5-2) Uniformly distributing the edges of the same group on two sides passing through the centers of two node centers
maxLinkNumber=group.length%2==0group.length/2:(group.length-1)/2
Wherein maxLinkNumber is the maximum number of two sides, and group is the number of the current side group.
And (3) carrying out layer number marking on each side, wherein the lowest layer side is marked as-maxLinkNumber, the layer number marking of the lower layer side is sequentially increased by 1 from bottom to top, namely, the layer number marking of a circle center connecting line between the starting node and the ending node is 0, the layer number marking of the upper layer side is sequentially increased by 1, and the layer number marking of the lower layer side is sequentially decreased by 1.
5-3) Determining whether the layer number flag link.linknum of the edge is equal to 0
5-4) If link.linknum=0, the coordinates (x 1, y 1), (x 2, y 2) of the intersection of the node and the edge 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>0link.source.y+r:link.source.y–r;
y2=link.target.y-link.source.y>0link.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, (x 1, y 1) is the intersection coordinates of the edge and the start node, and (x 2, y 2) 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>0link.source.x+r:link.source.x-r;
x2=link.target.x-link.source.x>0link.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:
Wherein, 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 intersection point coordinates of the node and the edge by the following formula:
And (3) making a vertical 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 mark of the edge:
a=r*link.linknum/maxLinkNumber
Wherein link.linknum is the layer number mark of the side, maxLinkNumber is the maximum number value of the two sides of the circle center;
and calculating an intersection point coordinate (xm, ym) of the intersection point of the passing edge and the starting node, which is perpendicular to the circle center connecting line:
When the start node and the end node are on a vertical line:
and calculating an intersection point coordinate (xn, yn) of the perpendicular line of the intersection point of the passing edge and the termination node to the circle center connecting line:
Wherein (xn, yn) is the intersection point coordinate of the perpendicular line of the intersection point of the passing edge and the termination node to the circle center
When the start node and the end node are on a vertical line:
the crossing point of the crossing edge and the node is connected with the line to the center of the circle, and the slope of the perpendicular and the x axis is as follows:
tanω=(x1-x2)/(y2-y1)
X-axis distance relative to the vertical (xm, ym):
Y-axis distance relative to the vertical (xm, ym):
if (y 2-y 1) =0
kx=0
ky=a
If a >0:
xs=a>0xm-kx:xm+kx
ys=ym-ky
xt=a>0xn-dx:xn+dx
yt=yn-ky
Where (xs, ys) is the intersection coordinates of the edge and the start node and (xt, yt) is the intersection coordinates of the edge and the end node. It is worth speaking that, considering the display mode of the multiple relations among the nodes, the multiple relations among the nodes are not combined into one side, so that each relation 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=link.source.y, sx=link.source.x, tx=link.target.x, ty=link.target.y;
dx=(distance-link.name.length*fontSize-2*r)/2
And calculating dx by using d3.js to obtain dy, (dx, dy) which is the coordinate of the edge name.
7. Rendering with d3.Js
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 names of the edges, so as to obtain a visual knowledge graph. The specific process is as follows: verifying node data and edge data, specifically, verifying whether a starting node and a terminating node of an edge exist or not, and filtering the edge if any node of the starting node and the terminating node does not exist; and (5) rendering by using d3.Js after verification to obtain a visual knowledge graph.
It should be noted that, in the process of visualization using d3.Js rendering, the specific steps of node expansion and node contraction are as follows:
7-1) node expansion, which comprises the following steps:
7-1-1) first determines if the node's id already exists in idList, if so, it indicates that no additional query needs to be made and that the node is currently in a contracted state, just removing the node's label from labelList and re-rendering.
7-1-2) If the node's id does not exist in idList, indicating that the node has not been expanded, a query needs to be made for the node's associated nodes and relationships, and the node's id is added to idList and re-rendered.
7-2) Node contraction, specifically, adding the label of the node to labelList, and re-rendering. It is worth to say that, through the scaling of the nodes, the nodes which do not need to be displayed are packed up, so that the capability of analyzing the problem through the relationship 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 entity of the knowledge graph of the structured data is taken as a node, and the relationship is taken as an edge, so that the visualization expression of the knowledge graph is realized. And further, each relation is independently expressed based on a mechanical principle, so that the complete expression of information in the knowledge graph is realized. In addition, through node scaling, nodes which do not need to be displayed are packed up, so that the capability of analyzing problems through a relationship graph is realized, and information contained in the knowledge graph is more intuitively and completely expressed.
The application has been described in detail hereinabove with reference to specific exemplary embodiments thereof. It will be understood that various modifications and changes may be made without departing from the scope of the application as defined by the following claims. The detailed description and drawings are to be regarded in an illustrative rather than a restrictive sense, and if any such modifications and variations are desired to be included within the scope of the application described herein. Furthermore, the background art is intended to illustrate the state of the art and the meaning of the development and is not intended to limit the application or the field of application of the application.

Claims (8)

1. The knowledge graph visualization method based on the mechanics principle is characterized by comprising the following steps of:
Converting the triplet data of the knowledge graph into a relation set and an entity set; wherein the set of relationships includes edge data and the set of entities includes node data;
marking edge data and node data;
respectively de-duplicating the marked edge data and node data;
calculating the length of the edge, the intersection point coordinates of the node and the edge name coordinates according to the node data and the edge data;
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 names of the edges, so as to obtain a visual knowledge graph;
the process of calculating the intersection point coordinates of the nodes and the edges is as follows: the edge data comprises a starting node and a terminating node, and the intersection point coordinates of the node and the edge are obtained by calculating according to the circle center coordinates of the starting node and the terminating node, and the method comprises the following steps:
Grouping according to the initial node and the end node of the edge, wherein the edge is connected with the same pair of nodes, namely the same group;
calculating the hash values of source and target of the edge, wherein the source is a starting node, and the target is a terminating node;
m (source) =link.source string length; m (target) =link.target string length;
Comparing the source and target hashes:
key=link.source.hash<link.target.hashlink.source+':'+link.target:link.target+':'+
link.source;
Wherein m is the length of the source or target character string, and ASCII (target [ i ]/source [ i ]) is the ASCII code of each character of the target or source;
Traversing all edges in links, wherein if the keys of the edges are the same, the edges are the same group;
uniformly distributing edges of the same group on two sides passing through the centers of two node centers:
maxLinkNumber=group.length%2==0group.length/2:(group.length-1)/2;
wherein maxLinkNumber is the maximum number of two sides, and group is the number of the current side group.
2. The knowledge graph visualization method based on the mechanics principle according to claim 1, wherein the specific process of marking the edge data and the node data is as follows: and carrying out association query on the node data, and marking the queried nodes and associated edges, wherein the queried node set is idlist, and the queried node marked set is labellist.
3. The knowledge-graph visualization method based on the mechanics principle according to claim 1, wherein 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 edge, link.name.length represents the length of the edge name, fontSize represents the word size, and n represents a constant.
4. A knowledge graph visualization method based on mechanics principle according to claim 3, wherein when an edge is a center line between a start node and a stop 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>0link.source.y+r:link.source.y-r;
y2=link.target.y-link.source.y>0link.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, (x 1, y 1) is the intersection coordinates of the edge and the start node, and (x 2, y 2) 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>0link.source.x+r:link.source.x-r;
x2=link.target.x-link.source.x>0link.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:
Wherein, Is the value of the central angle tan between the start node and the end node.
5. A knowledge graph visualization method based on mechanics principle according to claim 3, wherein when edges are located at two sides of a center line between a start node and a stop node, the coordinates of the intersection point of the nodes and the edges are calculated by the following formula:
and calculating an intersection point coordinate (xm, ym) of the intersection point of the passing edge and the starting node, which is perpendicular to the circle center connecting line:
Wherein a=r, link.link num/maxLinkNumber, link.link num is the layer number mark of the side, maxLinkNumber is the maximum number value of the two sides of the circle center;
and calculating an intersection point coordinate (xn, yn) of the perpendicular line of the intersection point of the passing edge and the termination node to the circle center connecting line:
Wherein, The value of the central angle tan between the starting node and the ending node; (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, and r is the radius value of the start node and the end node.
6. The knowledge graph visualization method based on the mechanics principle according to any one of claims 1 to 5, characterized in that the edge name coordinates are calculated by the following formula; let sy=link.source.y, sx=link.source.x, tx=link.target.x, ty=link.target.y;
dx=(distance-link.name.length*fontSize-2*r)/2
then dx is calculated by d3.js to obtain dy, (dx, dy) which is the coordinate of the edge name;
Wherein link.name.length represents the length of the edge name, fontSize represents the word size; r is the radius value of the start node and the end node.
7. The knowledge graph visualization method based on the mechanics principle according to claim 6, wherein the specific process of rendering by d3.Js is as follows:
And (3) checking the node data and the edge data, and rendering by using d3.Js after checking to obtain a visual knowledge graph.
8. The knowledge graph visualization method based on the mechanics principle of claim 7, wherein the specific process of verifying the node data and the edge data is as follows:
Checking whether the starting node and the ending node of the edge exist or not, and filtering the edge if any node of the starting node and the ending node does not exist.
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 CN111966821A (en) 2020-11-20
CN111966821B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117112807B (en) * 2023-10-23 2024-01-30 浙江大学 Knowledge graph associated information focus visualization method and system based on mechanical model

Citations (9)

* 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
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
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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10255335B2 (en) * 2015-11-06 2019-04-09 Cloudera, Inc. Database workload analysis and optimization visualizations
CN106685716B (en) * 2016-12-29 2019-04-26 平安科技(深圳)有限公司 Network topology adaptive data visualization method and device
US10740398B2 (en) * 2017-11-27 2020-08-11 International Business Machines Corporation Structuring incoherent nodes by superimposing on a base knowledge graph

Patent Citations (9)

* 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
WO2019057190A1 (en) * 2017-09-25 2019-03-28 腾讯科技(深圳)有限公司 Method and apparatus for displaying knowledge graph, terminal device, and readable storage medium
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

Also Published As

Publication number Publication date
CN111966821A (en) 2020-11-20

Similar Documents

Publication Publication Date Title
US9442905B1 (en) Detecting neighborhoods from geocoded web documents
CN103605706B (en) A kind of resource retrieval method of knowledge based map
CN109739939A (en) The data fusion method and device of knowledge mapping
CN113568995B (en) Dynamic tile map manufacturing method and tile map system based on search conditions
CN108509543B (en) Streaming RDF data multi-keyword parallel search method based on Spark Streaming
CN103955538B (en) HBase data persistence and query methods and HBase system
CN103955549A (en) Web GIS system based on SVG and data input and search method thereof
CN102063478A (en) Three-dimensional file format conversion method and search engine suitable for Internet search
CN111966821B (en) Knowledge graph visualization method based on mechanics principle
JP2014527660A (en) Method and apparatus for acquiring structured information in layout file
WO2020215438A1 (en) Spatial keyword query distributed indexing system and method for electronic map
EP2836928A1 (en) Full text search using r-trees
WO2002017166A2 (en) System and method for automatic preparation and searching of scanned documents
CN105488471B (en) A kind of font recognition methods and device
CN113239111A (en) Network public opinion visual analysis method and system based on knowledge graph
CN116361487A (en) Multi-source heterogeneous policy knowledge graph construction and storage method and system
CN114265957A (en) Multiple data source combined query method and system based on graph database
CN106547765A (en) Data base management method and device based on SQL
CN102831187A (en) Content-based image retrieval system
CN111159221A (en) Method for data processing or query through dynamically constructing cube
CN116341655A (en) Entity alignment method based on multi-mode collaborative representation learning
CN110175197B (en) Ontology construction method and system based on semantic Internet of things
CN109977419A (en) A kind of knowledge mapping building system
CN111241313A (en) Retrieval method and device supporting image input
CN115995087B (en) Document catalog intelligent generation method and system based on fusion visual information

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