A knowledge graph visualization editing and persistence implementation method and system

By constructing a spatial information ontology description model and a generalized graphical form, the problem of spatial information fusion in the visualization of knowledge graphs in the water conservancy field is solved, and the overall understanding of knowledge graphs in the water conservancy field and complex decision-making support are achieved.

CN114491073BActive Publication Date: 2025-09-09HOHAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210105337.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-28
Publication Date
2025-09-09
Estimated Expiration
2042-01-28

AI Technical Summary

Technical Problem

Existing knowledge graph visualization methods cannot effectively integrate spatial background information, resulting in the visualization results of knowledge graphs in the water conservancy field being disconnected from the actual situation and unable to assist event decision-making and application analysis in specific scenarios.

Method used

By constructing a spatial information ontology description model, integrating the spatial shape information, relative position relationship and primary and secondary status relationship of water conservancy field instances, visualizing the knowledge graph in the form of generalized graphs, and introducing event data to enrich spatial information, multi-resolution visualization results are provided.

Benefits of technology

It realizes the spatial information fusion of the knowledge graph in the field of water conservancy, helps users quickly form a holistic understanding, supports complex water affairs decision-making analysis, and alleviates the contradiction between canvas space and information volume.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114491073B_ABST
    Figure CN114491073B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for realizing visual editing and persistence of knowledge graphs. The method steps are as follows: designing an ontology model that integrates spatial information; visualizing the knowledge graph in the field of water conservancy in the form of a generalized graph, reflecting the spatial background of the instance in the graphic elements and the relative position relationship between the graphic elements, and realizing spatial information fusion at the global level of the visualization result; providing generalized graph visualization results of different resolutions for the same statement set; based on the generalized graph visualization results, further introducing event data and mapping it to related instances, enriching spatial information to support more complex water affairs decision-making analysis applications; the system includes a statement set query module, an event data upload module, a knowledge card module, a visualization effect display module, and a resolution adjustment module. The present invention realizes the visualization of the knowledge graph in the field of water conservancy that integrates spatial background information, helps users quickly form a holistic understanding of the information, and serves typical knowledge graph applications in the field of water conservancy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to knowledge graph visualization, and in particular to a method and system for implementing knowledge graph visualization editing and persistence. Background Art

[0002] Knowledge graph visualization maps semantic information into a graphical space, helping users quickly form a holistic understanding. Formally, a knowledge graph is a heterogeneous network consisting of a large number of interconnected instances and attributes of varying types, making it suitable for representation as a node-link graph. As a mainstream knowledge graph visualization method, it focuses on accurately expressing semantics by combining two nodes through a relationship edge. However, this visualization is still limited to the classic triple form and does not significantly improve users' ability to obtain information. Meanwhile, visualization solutions proposed for general knowledge graphs focus on the logical relationships between knowledge and lack design considerations specific to domain knowledge and typical application scenarios. This results in visualizations that are limited to simple information presentation and are unable to assist in event decision-making and application analysis in specific scenarios. Therefore, designing appropriate vertical domain knowledge graph visualization solutions tailored to domain characteristics is an important direction for domain knowledge graph visualization research.

[0003] The knowledge graph in the water conservancy field is the result of semantic modeling of water conservancy management objects in physical space, and contains a large amount of spatial information with practical value. However, in mainstream knowledge graph visualization solutions, the expression of spatial information is often floating in text rather than integrated into the overall visualization results, and cannot provide guidance for the visualization results. This makes the visualization results separated from spatial relationships, fails to effectively reflect the actual situation, and restricts the practical application of knowledge graphs in the water conservancy field. Specifically, in mainstream visualization solutions designed for general knowledge graphs, spatial information is often expressed as general semantic information and cannot be effectively reflected through instance primitives and the relative positional relationships between primitives, which weakens the practical application value of the visualization results. Summary of the Invention

[0004] Purpose of the invention: The purpose of the present invention is to provide a method and system for visual editing and persistence of knowledge graphs, to realize the visualization of knowledge graphs in the field of water conservancy that integrates spatial background information, to help users quickly form a holistic understanding of the information and to serve typical knowledge graph applications in the field of water conservancy.

[0005] Technical solution: The method for visually editing and persisting a knowledge graph described in the present invention includes the following steps:

[0006] (1) Continuing the design ideas of water conservancy ontology, the spatial information ontology description model is constructed by integrating spatial information. Through the design of related classes, attributes and relationships, the spatial shape information, relative position relationship, primary and secondary status relationship and description rules of instance status under specific events of water conservancy instances are defined. The spatial description information of existing water conservancy instances is supplemented in the form of knowledge cards.

[0007] (2) Construct a knowledge graph in the field of water conservancy in the form of a generalized map. The graph visualization reflects the spatial distribution of the instance as a whole, uses the relative position relationship between the elements and the elements to reflect the spatial background of the instance, and realizes spatial information fusion at the global level of the visualization results.

[0008] (3) Under the further guidance of spatial information, for the same statement set, according to the partial order law of topological relations, generalized graph visualization results of different resolutions are provided to alleviate the contradiction between the limited canvas space and the amount of information in the statement set.

[0009] (4) Based on the visualization results of the generalized map, event data is introduced and mapped to relevant instances, and the specific attributes of the instances are mapped from quantitative results to qualitative states, and further expressed as state graph elements to enrich spatial information and support more complex water affairs decision-making analysis applications.

[0010] Furthermore, step (1) continues the design ideas of the water conservancy domain ontology and integrates spatial information to construct a spatial information ontology description model. The design of the water conservancy domain ontology defines the conceptual hierarchy of water conservancy domain instances through the design of related classes, attributes, and relationships, the attribute information of the three dimensions of time, space, and self-characteristics required by the ontology, and the connection between two equivalent concepts. On this basis, the domain ontology constructed adds spatial shape information, relative position relationship, primary and secondary status relationship, and description rules of instance status under specific events to construct a spatial information ontology description model that integrates spatial information.

[0011] Furthermore, adding spatial shape information in step (1) means adding the descPoint class and related interactive relationships to the relevant ontology design. A descPoint is not a concept in the water conservancy field; it is a marker for a key position in the instance shape description. A descPoint instance is uniquely identified by determining its spatial and temporal attributes.

[0012] The purpose of adding relative position relationships is to ensure that the generalized graph visualization results accurately reflect the relative position relationships between instances. The nine-intersection model is introduced to further characterize the interactive relationships between instances from the perspective of spatial topology and provide a basis for the visual expression of topological relationships. Therefore, the interactive relationships between objects can be further subdivided into topological relationships (topoRel) and non-topological relationships (nonTopRel). TopoRel is a collection of subdivided topological relationships defined by the nine-intersection model, which can be further divided into the following four categories:

[0013] (a) Inclusion: It is unidirectional, implying that there is an affiliation relationship between water conservancy field instances, such as basin and sub-basin, basin and river, river and section, etc.

[0014] (b) Connection: It is not directional, implying that there is end-to-end connection between water conservancy examples, such as the confluence of rivers.

[0015] (c) Gland: It is unidirectional, implying that there is a certain degree of overlap between instances in the water conservancy field, such as hydropower stations and rivers, dams and rivers, etc.

[0016] (d) Non-intersection: It has no directionality and is a constraint on the map representation of water conservancy field instances, such as an instance being upstream (downstream) of another instance.

[0017] To maximize the clarity and presentation of graph information within the limited canvas space, we added a hierarchy between instances. We used the level attribute of the designed instances as the primary basis for differentiation. Furthermore, we further characterized the existing topological relationships by adding the partial order relation parRel and the peer relation peerRel. A partial order relation defines the primary and secondary status of two associated instances, while a peer relation defines the peer status of two associated instances. The same instance can have both a partial order relation and a peer relation.

[0018] On the basis of the knowledge ontology design in the water conservancy field, the event-related ontology design is supplemented, the event subject class entSub and the key object class keyObj are defined, and the relevant relationship design is given.

[0019] Furthermore, step (2) constructs a knowledge graph that visualizes the water conservancy field in the form of a generalized graph, using graph elements and the relative position relationship between graph elements to reflect the spatial background of the instance. Specifically, there are three steps:

[0020] (2.1) Concept visualization: refers to expressing the concepts in the knowledge graph in a specific form of expression. The form of expression here includes two parts of information: type and shape parameters. The present invention determines the primitive type of an instance through topological relationships. For the same instance in the set of statements to be processed, it may be combined with a variety of different topological relationships, resulting in a change in primitive type. In order to standardize the behavior of changing primitive types, it is stipulated that there is a priority order from low to high among point, line, and surface primitives: low-priority primitives can be changed to high-priority primitives, and vice versa.

[0021] (2.2) Information revision: The same instance in the statement set is associated with multiple different topological relationships. Changes to the instance graphics will cause the original topological characterization of the relationship between instances to no longer be appropriate. Based on the graphics type and the qualitative results of the topological relationship, combined with semantic revision of the new topological qualitative results of the relationship between instances, from the perspective of the relative positions of the graphics, the positional connotations expressed in the topological relationship of actual applications include three categories: graphics separation, graphics boundary tangency, and graphics mutual inclusion. Among them, the type revision in the first and third cases is relatively simple. Since the relevant graphics do not have the characteristic of infinite extension, the revision only considers the relative position connotation of maintaining the external (internal) separation of the two graphics. The revision of the second type of relationship is relatively complex. There may be multiple nine-intersection classifications for the same graphics combination, which requires a comprehensive judgment combined with semantics.

[0022] (2.3) Position adjustment: In the visualization results of the generalized graph form, the position of the primitives is based on the instance coordinates and is adjusted according to the topological relationship. If necessary, a directed dotted line with semantic description is added to assist in the expression. The present invention believes that the complexity of point, line, and surface primitives gradually increases, and the flexibility when adjusting the position also decreases. Therefore, in principle, the relative position relationship between the more complex primitive combinations should be determined first, and the relatively flexible and easy-to-adjust primitives should be positioned based on the other party. That is, the priority values ​​of the point, line, and surface primitives are set from low to high, and then the statement set is traversed, and the priority value of each triple statement is calculated according to the primitive type. Finally, the statement set is sorted in descending order according to the priority value of the statement to determine the adjustment order. Position adjustment should follow the following principles:

[0023] (a) Only adjust the primitives that contain a single coordinate parameter;

[0024] (b) When adjusting the position, the primitive can only move in a specific direction;

[0025] (c) Only allow low-priority primitives to adapt to the positions of high-priority primitives;

[0026] (d) Each primitive can only be adjusted once. When adjustment is not possible, the topological relationship is expressed by a directed dotted line.

[0027] Furthermore, for the concept visualization in step (2), for point primitives, their size parameters are given by the radius r value, while the position parameters can be determined by only a set of punctuation points; for line primitives, their size parameters are given by the width w, while the position parameters require both the start and end coordinates to be specified. For surface primitives, they are all set to rectangles. The description of their shape information is relatively complex, and it is necessary to consider the case of upgrading from point primitives or line primitives to surface primitives. For the case of upgrading from point primitives, the shape is changed from a circle to a square, and its size parameter is derived from the radius r to the width w. The position parameter is used as the center of the rectangle. For the case of upgrading from line primitives, its width is increased to clearly distinguish between lines and surfaces. Complex instances where shape information is given by describing points are also classified as surface primitives. For non-closed cases, it is necessary to give both the width parameter w and a set of ordered coordinate positions.

[0028] Furthermore, when the position adjustment in step (2) is performed on a statement involving a complex surface primitive, the complex surface primitive is first decomposed into two description points forming a description primitive. Then, the most appropriate representation of the complex surface primitive is determined from the multiple description primitives to participate in the position adjustment process.

[0029] Furthermore, the realization of multi-resolution generalized map visualization in step (3) mainly includes three main steps: level-element mapping, deviation value calculation and statement set adjustment, as follows:

[0030] (a) Level-to-Element Mapping: Use differences in element representation (element type, size) to represent the primary and secondary differences between instances. Align the element representation with the instance level attributes. Determine the element level for domain instances and the range of level parameters for each element type, and establish a level-element mapping between the two. By default, there is an ascending order of levels between point elements, line elements, and surface elements across element types.

[0031] The level of an instance is based on the level attribute of the instance in the knowledge graph. The number of values ​​n of the different level attributes contained in these instances is counted, and then the instance level value is mapped to an integer k in the interval [1, n] as the level of the instance. The difference in information granularity is also achieved by changing the shape parameter. We establish upper and lower limit shape parameters for each type of primitive. max and shape min , forming a parameter range that regulates the size variation range of a certain type of primitive. When a primitive's level is less than the lower limit shape parameter, it is downgraded to a lower-level primitive type until it disappears. However, when a primitive's level is greater than the upper limit shape parameter, the primitive type is not upgraded and only increases in size to ensure the correct expression of the relationship between instances.

[0032] (b) Deviation value calculation: Based on the determination of the primitive level, the instance deviation value attribute is defined to record the deviation of the subject instance in the partial order relation relative to the detail instance at the primitive level. Specifically, for a triple statement containing a partial order relation p<s,p,o> , the default subject s is a detail instance in the partial order relation, and the corresponding graph elements of subject s and object o are recorded as G s , G o , when G s , G o There is a relationship between the levels of the primitives lev Gs >lev Go When the deviation value of the subject instance element is delta=lev Go -lev Gs For instances where there are multiple delta calculation results, take delta max is the final delta value.

[0033] (c) Statement Set Adjustment: As resolution changes, detailed instance information disappears first, but the connections between entities through detailed instances should be preserved at a coarser granularity. The purpose of statement set adjustment is to use reasoning to complete the relationships between instances lost due to resolution change. Each adjustment starts with the instance lost due to the resolution change, identifies the instance pairs that need to be associated, and performs reasoning according to the rules to complete the topological relationships between instances.

[0034] When determining the instance pairs that need to be completed, for any instance that is no longer displayed, none , record all the relationship sets related to the instance as Rel none When Rel none When there is a partial order relation in Ins none It must be the subordinate party in the partial order relation, so the other party of the partial order relation Ins other It must be one of the topological relations that need to be supplemented by reasoning, and the other side Ins other Rel none The rest of the peer relationship descriptions in the analysis process. other If the display is no longer displayed even with the resolution adjustment, follow the Ins other Find alternatives to other peer relationships. Finally, we get a set of instance pairs and their paths { <Ins main ,Ins other ,path>}, where path is organized in the form of a triple list, which is from Ins main to Instagram other path.

[0035] Furthermore, in step (4), event data is introduced and mapped to relevant instances, and a mapping from attribute values ​​to qualitative states is established. v2state And the mapping f from state to primitives s2gElem .

[0036] Mapping f from attribute values ​​to qualitative states v2state It is a rule execution function that receives the attribute state mapping rule Rule and the key-value pair attMap of the attribute value, and returns the qualitative result state of a certain state of the instance. According to the concept layer design, the instance ins has a corresponding key object instance inskey under a specific topic. The multiple mapping rules associated with a certain attribute are the mapping f v2state The input parameter of Rule.

[0037] Mapping f from state to primitives s2gElem Receive the instance state value state, the set of all instance state values ​​stateSet, the starting color colorStart and the ending color colorEnd, and output the RGB color code of the state primitive. Specifically, mapping f s2gElem Based on the parameters colorStart and colorEnd, a color band range is formed, all values ​​of the instance state are equidistantly mapped to colors in the color band range, and the RGB color code corresponding to the state value state is returned as the mapping result.

[0038] When there are multiple states that need to be expressed at the same time, the area of ​​the state primitive can be occupied equally or proportionally based on a certain importance coefficient. The state primitive is superimposed on the instance primitive when displayed, but the size should be significantly smaller than the instance primitive to avoid occlusion. A knowledge graph visual editing and persistence implementation system includes the following modules:

[0039] (1) Statement set query module: Statement set query is the most basic and core data operation. It submits the SPARQL input by the user to the server and presents the results in the form of a generalized graph in the system interface;

[0040] (2) Upload event data module: Uploading event data requires users to provide event information in the form of JSON files to the data processing module. After processing, it is displayed in the form of visual elements on the relevant instance elements in the system interface, which is used to add event data to the generalized map visualization results and assist in event evolution analysis;

[0041] (3) Knowledge card module: The visualization effect achieved by this system mainly displays water conservancy field instances and the spatial topological relationship between instances; the domain knowledge information related to other instances is presented in the form of knowledge cards in the upper right corner of the interface, and the relevant areas can be hidden and displayed through the knowledge card button;

[0042] (4) Visualization effect display module: including domain knowledge visualization and event data visualization; using generalized graphs as the expression form of knowledge graph visualization, emphasizing the intuitive expression of spatial position relationships between instances; starting with the SPARQL query statement submitted by the user, the data service module obtains the result set from the graph database and returns it after appropriate processing, and then the visualization rendering module visualizes the returned result set to the user; on this basis, event information is introduced in combination with the graph application scenario to realize event data visualization;

[0043] (5) Resolution adjustment module: used to set the resolution level of the current visualization result. The default setting is level 1, which means the current resolution is the highest. Resolution adjustment can be achieved by scrolling the mouse wheel.

[0044] A computer storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned method for visual editing and persistence of a knowledge graph.

[0045] A computer device includes a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, it implements the above-mentioned method for visual editing and persistence of a knowledge graph.

[0046] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0047] 1. To address the problem that existing commonly used visualization methods can only convey semantics, this invention proposes to visualize the water conservancy knowledge graph in the form of a generalized map that integrates spatial background information, helping users quickly form a holistic understanding of the information;

[0048] 2. The present invention determines the key attributes of domain instances of different event themes and provides qualitative rules for instance states, further realizing the visualization of event information;

[0049] 3. In response to the contradiction between the limited canvas space and the amount of information in the statement set, the present invention proposes to display the concepts in the statement set in a hierarchical manner to form multiple visualization results with different resolutions to alleviate this contradiction. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 Flow chart for implementing the method of the present invention;

[0051] Figure 2 Visualization of domain knowledge;

[0052] Figure 3 Comparison of multi-resolution visualization results;

[0053] Figure 4 Event data visualization;

[0054] Figure 5 Schematic diagram of the state changes of a rainwater pumping station example. DETAILED DESCRIPTION

[0055] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0056] like Figure 1 As shown, the specific implementation steps of the knowledge graph visualization editing and persistence implementation method provided by the present invention are as follows:

[0057] S1. Continuing the design ideas of the water conservancy field ontology, the spatial information ontology description model is constructed by integrating spatial information. Through the design of relevant classes, attributes and relationships, the spatial shape information, relative position relationship, primary and secondary status relationship and description rules of the instance status under specific events of the water conservancy field instances are defined, and the spatial description information of the existing water conservancy field instances is supplemented in the form of knowledge cards.

[0058] S1.1. Pre-query and caching is a service developed based on application query performance considerations. It aims to cache commonly used graph data and speed up queries. Pre-query result caching is implemented through Redis, using the cache project name and the instance's iri concatenation result as the key to store the corresponding result value. The data that needs to be pre-queried and cached in this system includes:

[0059] (1) Tag value: A tag value is a string value used to mark the name of an instance, concept, or relationship. It is aimed at human users and helps them understand the real resources corresponding to the instance.

[0060] (2) Type information: Instances and relationships in the knowledge graph all have category information, which is necessary for drawing legends in visualization results. At the same time, categories have a hierarchical relationship. Caching the categories corresponding to instances and concepts makes it easier to directly obtain the complete category hierarchy path of a certain instance.

[0061] (3) Level information: Instances in the knowledge graph are all assigned level values, which are used to determine the visible and invisible sizes of graphics elements during resolution switching in combination with partial order relationships.

[0062] (4) Coordinate information: The visualization results use instance coordinate information as the basic data for primitive positioning.

[0063] (5) Topological relationship: The visualization work takes triple statements with topological relationships as the working object, and caches the topological relationships in the graph in advance to facilitate filtering query results.

[0064] (6) Description points: Description points are used to provide shape information of complex instances.

[0065] S1.2. The visualization-oriented data query service receives SPARQL query statements and returns a result set with a specific data structure for processing and use by the visualization rendering module.

[0066] In order to return query results that meet the requirements, the data query service needs to go through four steps: statement completion, result set filtering, type confirmation, and information binding.

[0067] S1.3. Declarative reasoning serves the goal of completing the topological relationships between instances to ensure the consistency and integrity of the visualization results when switching between multiple resolutions.

[0068] The statements obtained by reasoning may not exist in the knowledge graph. The final return result of this service includes a set of triple statements completed by reasoning and a mapping of the nine-intersection classification results of the predicates in the statement set.

[0069] S1.4, Event Data Processing serves the needs of event cause visualization. This service is responsible for receiving event-related data and returning qualitative mapping rules for the attributes involved in the event.

[0070] For the attributes that express mapping rules contained in instances of the key object class, their naming convention is "attribute name_attribute quality", and their attribute values ​​represent the attribute value range corresponding to the quality result. Therefore, a variable containing a multi-layer key-value mapping is established on the server side as the return result of the event data processing service.

[0071] S2, such as Figure 2-4 As shown in the figure, a knowledge graph in the field of water conservancy is constructed in the form of a generalized graph. The graph visualization reflects the spatial distribution of the instance as a whole, uses the relative position relationship between the graph elements and the graph elements to reflect the spatial background of the instance, and realizes spatial information fusion at the global level of the visualization results.

[0072] S2.1. The domain knowledge visualization function is completely completed on the client side, with the return results of the data query service as input and the generalized diagram rendering results of the statement set as output; at the same time, since the rest of the functions of the visualization rendering module are based on this output, its data is stored as global variables in Data.gElems and Data.relElems.

[0073] S2.2: In order to achieve the mapping of query results to visualization results, it is necessary to execute four modules: topological relationship revision, relative position adjustment, primitive rendering, and event binding according to the topological relationship mapping rules, topological relationship expression rules, and basic primitive parameter rules.

[0074] S2.3. The topological relationship mapping rule receives the subject, object, and topological qualitative results of the predicate, and returns the revised results. During the adjustment process, the position of each instance of the element can be adjusted only once, and the statement set is sorted according to the level of the element before adjustment. During the specific execution of the adjustment rule, first check whether the position of the element has been adjusted, then calculate the relative position that meets the specifications based on the original relative position of the two elements, overwrite the original result, and add a modification mark variable to the properties attribute mapping in the adjusted element data structure and set it to true to avoid the element being adjusted twice. For situations where adjustment is not possible, add a directed dotted line auxiliary expression between the elements and add an auxiliary line mark variable with a value of true and the starting and ending point coordinate data of the auxiliary line to the properties attribute mapping in the data structure of the relationship edge.

[0075] S2.4. The topological relationship representation rules include receiving triplet data, setting a series of adjustment functions for the position of the primitives with the help of analytical geometry calculation functions. According to the primitive parameter rules, first count the categories to which the instances belong, establish the mapping relationship colorTypeMap between color and type, and assign colors to each concept class. Then, it is necessary to determine the rendering order of the primitives. Since primitives drawn in the same position one after another will overlap each other, the instances should be divided into three groups according to the primitive type: points, lines, and surfaces, and drawn in the order of surface primitives, line primitives, and point primitives, and rendered group by group. Finally, supplement the information, check the relationship edge data, and add auxiliary lines.

[0076] S2.5. Basic element parameter rules are objects that include a series of parameter settings for element size and spacing between elements.

[0077] S2.6. Event binding configures event interactions for primitives, including mouse-in, mouse-out, click events, and wheel events. Among them, the move-in and move-out events are designed for primitives and auxiliary line primitives, aiming to provide users with more detailed information about the primitives - when the user moves the mouse into the primitive or auxiliary line, a text box is drawn according to the mouse position, providing the label value and type information of the instance or relationship, and is hidden when it moves out; the click event is designed for the primitive, and a query is triggered by clicking the primitive to obtain the relevant attribute information of the instance and load it into the knowledge card. The wheel event is set for the entire visualization area to trigger switching between visualization results of different resolutions. In order to make the resolution switching process smoother, the wheel event first scales the visualization result. When the scaling ratio reaches the threshold, the resolution switching is triggered and the visualization result is redrawn.

[0078] S3. Under the further guidance of spatial information, for the same statement set, according to the partial order law of topological relations, generalized graph visualization results of different resolutions are provided to alleviate the contradiction between the limited canvas space and the amount of information in the statement set.

[0079] S3.1 Multi-resolution Switching is a hierarchical, multi-granular display solution for the same set of query results, an extension of domain knowledge visualization. Based on the domain knowledge visualization results, it combines the domain instance level and the topological relationship partial order type to determine the primitive level. Furthermore, the primitive level is used to determine the primitive shape parameters and visibility, thus achieving visualization results at different resolutions for the same result set.

[0080] S3.2. Multi-resolution visualization uses the visualization results of domain knowledge as input, calculates the level attributes and deviation values ​​for the original primitives, dynamically forms a set of mapping rules between primitive levels and primitive parameters, and determines the visibility and size of each primitive based on the mapping rules.

[0081] S3.3. Determine the instance pairs and paths between instance pairs that need to complete the topological relationship based on the partial order relationship between instances, and request the server to infer and complete the relationship between instances to adjust the statement set; then re-execute the visualization rendering process based on the adjusted statement set.

[0082] S3.4, resolution switching is triggered by the mouse wheel event when the canvas is zoomed to the threshold to execute the granularity level switching function. This function operates on the Datas.nowLevel variable that records the granularity level, and determines the subsequent operation based on the value of the variable (default). The function first checks the value of Datas.nowLevel. When the variable value is default, it is determined to be the first trigger for multi-resolution visualization, otherwise it increases or decreases according to the zoom direction. Then, based on the storage status in window.localStorage, it decides to directly read the available visualization results or perform a complete visualization calculation. window.localStorage is a key-value pair storage that persists to the local area. It stores visualization results of different granularities for the same statement set and is cleared when the statement set is updated.

[0083] S3.5. For instances with level mapping rules, execute the level change function based on the scaling to change the level and type of all instances, determine instance visibility, and change the type of instances whose levels exceed the threshold according to the level transition rule gElemRule.type.transit. Specifically, during scaling, for instances with a deviation value, if the deviation value delta > 0, prioritize reducing the deviation value over changing the level of the instance.

[0084] S3.6. Adjust the statement set by generating new inter-instance relationship statements through reasoning and deleting statements that are no longer rendered. Starting with all the elements that disappeared during the current resolution switch, traverse using the partial order relationship as a clue, searching for partial order subjects and partial order predicates to form instance pairs. All instance pairs are formed into a set and submitted to the data service module at once. Reasoning is performed, and a new relElem is generated based on the returned statements and added to the RelElemMap. Based on this, the domain knowledge visualization work is re-executed, and the results are cached in window.localStorage using the current value of Datas.nowLevel as the key for future use.

[0085] S4, such as Figure 5 As shown in the figure, based on the visualization results of the generalized map, event data is introduced and mapped to relevant instances, and the specific attributes of the instances are mapped from quantitative results to qualitative states, and further expressed as state graph elements to enrich spatial information and support more complex water decision-making analysis applications.

[0086] S4.1. Event cause visualization is based on the results of domain knowledge visualization and goes through three steps: data access, primitive drawing, and event binding.

[0087] S4.2. The access of event data is realized in the form of uploading files through the browser and stored in the global variable Datas.eventDatas.file. An event data entDataFile includes a brief description of the event desc, a collection of event-related instances entDatas, and the causal relationship between instances Causality. The collection of event-related instances entDatas describes all instances involved in the event. Each entData gives an instance iri and a list featureValueList describing related attribute features. The global variable Datas.eventDatas will be cleared and reset as new event data files are uploaded. The data structure that meets the interface requirements is sorted out from the uploaded event data and passed to the service interface. The return value stateMapRule is the attribute numerical qualitative rule to complete the data preparation.

[0088] S4.3. Before drawing the primitives, the state primitive metadata must be further calculated, and all event data must be visualized at the same time by default. Event data is visualized with instances as the basic unit, and is presented in the form of an equally divided pie chart. The color and center angle of each part of the equally divided pie chart are determined according to the settings of the rules attrState.value.switch and gElemRule.color.series. The state primitive related data is stored in Datas.eventDatas.gElem. This member is a key-value mapping structure with the instance iri as the key and the list of state data objects as the value. Each state data object consists of two parts: info and shape. Info is the organization of text information, and shape is the parameters required for visualization, including shape, color, and position.

[0089] S4.4. Calculating the state primitive data requires traversing the event dataset. Based on entData, the system calculates the area ratio of each attribute of an instance in the state primitive within a specific time period, and assigns an expression color system to each attribute according to the predefined expression rule gElemRule.color.series. Then, according to the attribute numerical qualitative rule, the state corresponding to the attribute is obtained and the color corresponding to the attribute in the state primitive is determined. Finally, according to relatedInstance, the corresponding instance primitive is associated to determine the position of the state primitive: for primitives positioned by a single coordinate point, the coordinate point is used as the center position of the instance state primitive; for primitives positioned by multiple coordinate points, the middle position of the primitive or the center of gravity of the convex polygon is calculated.

[0090] S4.5. Element interactions include mouse move-in, move-out, click, and right-click menu events. Move-in and click events dynamically draw text boxes at the element to display different information, while move-out events hide the text boxes, and the right-click menu changes the scene time information to adjust the information content of the event visualization. Mouse move-in and click events draw text boxes at the center of the state element, displaying state information and event causal information, respectively. State information includes attributes such as featureName, value, and state; and event causal information, after organizing the causal information set Causality, associates each causal information text with the info.caus member of the relevant state element metadata according to the iris of CasuseInstance and ResultInstance, and displays it through a click event. The right-click menu event allows the user to click to set the time and visualize data at different times. Therefore, the data of the state element needs to be organized according to the time point, and the organization results are stored in the Datas.eventDatas.timeLine member. The timeLine member that stores the sorting results is a key-value pair structure variable, with the time point as the key and the value data structure being the same as Datas.eventDatas.gElem, containing all valid event status data at this time point.

[0091] A knowledge graph visual editing and persistence implementation system, including the following modules:

[0092] (1) Statement set query module: Statement set query is the most basic and core data operation. It submits the SPARQL input by the user to the server and presents the results in the form of a generalized graph in the system interface;

[0093] (2) Upload event data module: Uploading event data requires users to provide event information in the form of JSON files to the data processing module. After processing, it is displayed in the form of visual elements on the relevant instance elements in the system interface, which is used to add event data to the generalized map visualization results and assist in event evolution analysis;

[0094] (3) Knowledge card module: The visualization effect achieved by this system mainly displays water conservancy field instances and the spatial topological relationship between instances; the domain knowledge information related to other instances is presented in the form of knowledge cards in the upper right corner of the interface, and the relevant areas can be hidden and displayed through the knowledge card button;

[0095] (4) Visualization effect display module: including domain knowledge visualization and event data visualization; using generalized graphs as the expression form of knowledge graph visualization, emphasizing the intuitive expression of spatial position relationships between instances; starting with the SPARQL query statement submitted by the user, the data service module obtains the result set from the graph database and returns it after appropriate processing, and then the visualization rendering module visualizes the returned result set to the user; on this basis, event information is introduced in combination with the graph application scenario to realize event data visualization;

[0096] (5) Resolution adjustment module: used to set the resolution level of the current visualization result. The default setting is level 1, which means the current resolution is the highest. Resolution adjustment can be achieved by scrolling the mouse wheel.

[0097] A computer storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned method for visual editing and persistence of a knowledge graph.

[0098] A computer device includes a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, it implements the above-mentioned method for visual editing and persistence of a knowledge graph.

Claims

1. A method for visual editing and persistence of knowledge graphs, characterized in that: The following steps are involved: (1) Continuing the design ideas of the water conservancy domain ontology, the spatial information ontology description model is constructed by integrating spatial information. Through the design of related classes, attributes and relationships, the spatial shape information, relative position relationship, primary and secondary status relationship and description rules of the instance status under specific events of the water conservancy domain instance are defined. The spatial description information of the existing water conservancy domain instance is supplemented in the form of knowledge cards. (2) Construct a knowledge graph for the water conservancy field in the form of a generalized graph. The graph visualization reflects the spatial distribution of the instance as a whole, uses the graph elements and the relative position relationship between the graph elements to reflect the spatial background of the instance, and realizes spatial information fusion at the global level of the visualization results; (3) Under the further guidance of spatial information, for the same statement set, according to the partial order law of topological relations, generalized graph visualization results of different resolutions are provided to alleviate the contradiction between the limited canvas space and the amount of information in the statement set; specifically, (31) Level-element mapping: Determine the level of the element in the domain instance and the parameter variation range of each type of element, and establish a level-element mapping relationship between the two; for elements displayed at the same resolution, the higher the level, the larger the element size and the more complex the type; (32) Deviation value calculation: Based on the determination of the primitive level, the instance deviation value attribute is defined to record the deviation number of the main instance relative to the detail instance in the partial order relationship at the primitive level; (33) Statement set adjustment: Each adjustment starts with the instance that disappears due to the resolution change, determines the instance pairs that need to be associated, and performs reasoning according to the rules to complete the topological relationship between the instances; (4) Based on the visualization results of the generalized map, event data is introduced and mapped to relevant instances, and the specific attributes of the instances are mapped from quantitative results to qualitative states, and further expressed as state graph elements to enrich spatial information and support more complex water affairs decision-making analysis applications.

2. A method for visual editing and persistence of knowledge graph according to claim 1, characterized in that: The step (2) is specifically as follows: (2.1) Concept visualization: This refers to representing concepts in the knowledge graph in a specific form, which includes two parts of information: type and shape parameters; (2.2) Information Revision: When the same instance in a statement set is associated with multiple different topological relationships, the change in the instance primitives will make the original topological characterization of the relationship between instances no longer appropriate. This requires revision of the topological characterization of the relationship between instances based on the actual expression primitives. This revision should be combined with semantic comprehensive judgment to maintain the positional connotation of the original topological relationship characterization. (2.3) Position adjustment: In the visualization results of the generalized graph, the position of the element is based on the instance coordinates and adjusted according to the topological relationship.

3. A method for implementing visual editing and persistence of a knowledge graph according to claim 2, characterized in that: The principles followed in step (2.3) for position adjustment are: (a) Only adjust the primitives that contain a single coordinate parameter; (b) When adjusting the position, the primitive can only move in a specific direction; (c) Only allow low-priority primitives to adapt to the positions of high-priority primitives; (d) Each primitive can only be adjusted once. If adjustment is not possible, the topological relationship is expressed by a directed dotted line.

4. A knowledge graph visual editing and persistence implementation system implemented by the knowledge graph visual editing and persistence implementation method according to any one of claims 1 to 3, characterized in that: Includes the following modules: (1) Statement set query module: Statement set query is the most basic and core data operation. It submits the SPARQL input by the user to the server and presents the results in the form of a generalized graph in the system interface; (2) Upload event data module: Uploading event data requires users to provide event information in the form of JSON files to the data processing module. After processing, it is displayed in the form of visual elements on the relevant instance elements in the system interface, which is used to add event data to the generalized map visualization results and assist in event evolution analysis; (3) Knowledge card module: The visualization effect achieved by this system mainly displays water conservancy field instances and the spatial topological relationship between instances; the domain knowledge information related to other instances is presented in the form of knowledge cards in the upper right corner of the interface, and the relevant areas can be hidden and displayed through the knowledge card button; (4) Visualization effect display module: including domain knowledge visualization and event data visualization; using generalized graphs as the visualization form of knowledge graphs, emphasizing the intuitive expression of the spatial position relationship between instances; It starts with a SPARQL query statement submitted by the user. The data service module obtains the result set from the graph database, processes it appropriately, and then returns it. The visualization rendering module then presents the returned result set to the user visually. On this basis, event information is introduced in combination with graph application scenarios to realize event data visualization; (5) Resolution adjustment module: used to set the resolution level of the current visualization result. The default setting is level 1, which means the current resolution is the highest. Resolution adjustment can be achieved by scrolling the mouse wheel.

5. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements a method for visual editing and persistence of a knowledge graph as described in any one of claims 1 to 3.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements a method for visual editing and persistence of a knowledge graph as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Visualization graph procedure topology sorting method

    CN103207903A

  • Knowledge graph link prediction model, method and device fusing context semantics

    CN113535972A