A knowledge graph-oriented multi-dimensional automatic quality detection method and system

By developing a multi-dimensional automated quality inspection method and system for knowledge graphs, the problems of scattered inspection results and insufficient traceability in existing technologies have been solved. This system achieves unified arrangement and result integration of multi-dimensional inspections, thereby improving the efficiency and credibility of knowledge graph quality governance.

CN122452706APending Publication Date: 2026-07-24HARBIN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HARBIN INST OF TECH
Filing Date
2026-04-30
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing knowledge graph quality inspection technologies are difficult to uniformly organize and store in the same quality inspection task. The inspection results are scattered, lack traceability and timeliness, and are difficult to support the combined scheduling of multiple inspection strategies and result integration.

Method used

This paper presents a multi-dimensional automated quality inspection method and system for knowledge graphs. The system records the relationship between the graph and the schema definition through quality inspection tasks, executes various quality inspection sub-processes, and associates the inspection results with the schema version and the graph data version to achieve multi-dimensional inspection and task orchestration.

Benefits of technology

It improved anomaly coverage, enhanced project maintainability, increased the interpretability and remediability of results, reduced maintenance costs, and improved the timeliness and traceability of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122452706A_ABST
    Figure CN122452706A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of knowledge engineering and data quality management, and discloses a multi-dimensional automatic quality detection method and system for a knowledge graph, which comprises the following steps: creating a quality inspection task bound to a target knowledge graph and a mode definition, executing at least one quality detection sub-process under the task, and the sub-process comprises the following steps: performing consistency checking on the graph instance and the mode based on a shape constraint language; performing reverse consistency checking on a relationship instance based on a mined association rule; constructing a graph structure representation in the memory based on a relationship edge sample and generating a structure class prompt; and performing statistical analysis on entity attributes and relationship distribution and generating a statistical class prompt; saving the quality prompt to a sub-task record in a structured entry, and associating the mode and the graph data update time snapshot to support result timeliness judgment. The application can be used for quality detection and operation and maintenance management in scenes such as knowledge middle platform, industry knowledge base and graph data management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of knowledge engineering and data quality management technology, specifically relating to a multi-dimensional automated quality detection method and system for knowledge graphs. Background Technology

[0002] With the development of artificial intelligence and big data technologies, knowledge graphs, as an important form of knowledge organization and expression, have been widely used in fields such as intelligent question answering, recommendation systems, intelligent manufacturing, and knowledge management. Knowledge graphs consist of structured semantic networks composed of elements such as entities, relationships, and attributes, providing computable knowledge support for upper-level intelligent applications.

[0003] During the construction and continuous operation of knowledge graphs, various quality issues can easily arise due to factors such as multi-source heterogeneous data, information extraction errors, schema evolution, and manual maintenance. These issues include missing entity and relation attributes, abnormal value distribution or inconsistent data types, duplicate and redundant data, and isolated nodes, weak connections, split connected components, and inconsistencies between relation directions and schema definitions at the graph structure level. These problems reduce the reliability and interpretability of knowledge graphs in downstream tasks and may amplify the decision-making risks of intelligent systems. Therefore, conducting systematic quality testing and evaluation during the graph deployment and iteration phases is a crucial aspect of knowledge graph engineering.

[0004] Existing knowledge graph quality inspection technologies typically revolve around a specific strategy: one approach uses constraint rules or rule description languages ​​(such as SHACL) to verify the consistency between data and the schema, attribute values, and cardinality; another approach uses rule mining algorithms to summarize relationship patterns from the data and use them for anomaly detection; and yet another approach identifies anomalous samples or substructures based on statistical distributions or graph structure features. While these approaches are valuable in their respective scenarios, common problems in engineering implementation include significant differences in data input, output, and operational methods between different detection strategies, a lack of unified task organization and result aggregation mechanisms, and difficulty in forming a comparable and reproducible comprehensive quality view on the same knowledge graph object.

[0005] Furthermore, for platform-based applications, it is also necessary to support the combined scheduling of multiple detection capabilities, state management of the execution process, and correlation of detection results with changes in map data versions, schema versions, and other factors to determine whether historical detection conclusions are still valid. Existing solutions mostly focus on single algorithms or single-point tool capabilities, which do not adequately support the above-mentioned engineering requirements, resulting in scattered detection results, difficulty in traceability, and high costs for comprehensive evaluation and closed-loop operation and maintenance.

[0006] Therefore, there is an urgent need for a method and system that can integrate multiple quality detection strategies, support unified arrangement of detection tasks and integration of results, and have the ability to assess quality in relation to changes in the knowledge graph and schema, so as to improve the efficiency and credibility of knowledge graph quality governance. Summary of the Invention

[0007] To address issues such as schema inconsistencies with instances, semantic anomalies in relations, topological anomalies, and attribute distribution anomalies that arise during the construction and iteration of knowledge graphs, existing solutions often rely on constraint validation, rule mining, graph algorithms, or statistical analysis, making it difficult to uniformly orchestrate and store data in a single quality inspection task. Furthermore, the detection results are difficult to link with schema update times and graph data update times, resulting in scattered quality conclusions and insufficient traceability and timeliness. This invention provides a multi-dimensional automated quality inspection method and system for knowledge graphs. Based on schema and graph instance data, it performs multi-dimensional inspection and task orchestration on graph topology, node and edge attribute distribution, and schema-data consistency. The detection results are linked and recorded with schema and graph data versions to ensure the timeliness and traceability of quality conclusions. This method is applicable to scenarios such as knowledge platforms, industry knowledge bases, and graph data governance.

[0008] To achieve the above objectives, the present invention provides the following solution: A multi-dimensional automated quality inspection method for knowledge graphs, the method comprising: Obtain the graph instance data of the target knowledge graph and the pattern definition bound to the target knowledge graph, and create a quality inspection task so that the quality inspection task records the correspondence between the target knowledge graph and the pattern definition; Under the quality inspection task, at least one quality inspection sub-process is executed, and the output of each quality inspection sub-process is saved as the corresponding sub-task record; The quality tips in each of the subtask records are saved in the form of structured entries, which include at least the problem category, the target object, and explanatory information.

[0009] Preferably, the quality inspection sub-process includes: The first sub-process for verifying the consistency between the map instance data and the pattern definition based on the shape constraint language; The second sub-process of performing reverse consistency verification on relation instances based on association rules obtained from the data mining of the graph instances; The third sub-process constructs a graph structure representation in memory and generates structure class quality hints based on the relation edge samples in the graph instance data; The fourth sub-process performs statistical analysis on the entity attributes and relationship type distribution in the graph instance data and generates statistical quality tips.

[0010] Preferably, the first sub-process includes: Map the entity attribute constraints and relation constraints in the pattern definition to shape constraints to generate a shape constraint diagram; Convert the map instance data into a data map; The data graph is validated by applying the shape constraint graph using a validation engine conforming to the W3C SHACL standard, and the structured entries are generated based on the validation report. Specifically: Let the transformed graph instance data be G_D=(V, E), where V is the set of entity nodes and E is the set of relation edges; for any edge e∈E, let s(e), t(e), and r(e) represent the source entity, target entity, and relation type, respectively; for any node v∈V, let P(v) represent its attribute set; Let G_S be the shape constraint graph obtained by mapping defined by the schema, which defines the set of focus nodes for the target. The constraints applied; for any focus f∈F, let C(f) be the set of constraint components acting on f; then the SHACL check statement is: determine whether each c∈C(f) holds true on G_D; A violation record is generated when there exists a focus f ∈ F and a constraint component c ∈ C(f) such that c does not satisfy G_D; let the set of violation records be R, then: ; Here, sh represents the trigger shape identifier, cc represents the trigger constraint component identifier, and the ellipsis represents the message text and severity level extensible field.

[0011] Preferably, the second sub-process includes: Fact triples are extracted from the graph instance data and organized into rule mining inputs; Configure support and confidence thresholds to mine implicit association rules; The association rules are pattern matched on the graph instance data. When the rule body matches but the conclusion relation is missing in the corresponding entity pair or conflicts with the conclusion relation, the structured entry used to indicate the suspicious relation instance is generated. The method for extracting fact triples from the graph instance data and organizing them into rule mining inputs includes: A rule obtained through rule mining adopts the Horn implication form, where the conjunction of several relation atoms in the rule body implies a conclusion relation atom, denoted as: ; in, H represents the i-th relation atom in the rule body, H is a single conclusion relation atom; m is a positive integer representing the number of atoms in the rule body; Methods for mining implicit association rules by configuring support and confidence thresholds include: Statistical measures such as support and confidence can be defined for rule R to filter rule size and reliability; let supp(body) be the support count or normalized support that the rule body can match on the fact set T, and let supp(R) be the support count or normalized support when both the rule body and the conclusion are true. Then the confidence is expressed as: ; When supp(body) = 0, the rule is either not reverse-validated or discarded. The method for generating the structured entry indicating a suspicious relation instance by performing pattern matching on the association rules in the graph instance data, and generating the structured entry to indicate the suspicious relation instance when the rule body matches but the conclusion relation is missing in the corresponding entity pair or conflicts with the conclusion relation, includes: The graph instance data is still denoted as G_D = (V, E), where E is the set of relation edges. When performing reverse validation on rule R, if there exists a binding θ on G_D such that the rule body is true under θ, but the conclusion relation does not exist in E on the corresponding entity pair, or is true under θ along with a relation in the mutually exclusive relation set M, then a suspicious alert is generated. The mutually exclusive relation set M is given by business configuration or schema definition and is expressed as: ; Suspicious alerts should include at least the rule identifier, rule body binding information, the checked triple or relation instance, conflict type, and explanatory text; the field organization method is determined by the platform.

[0012] Preferably, the third sub-process includes at least one: Weakly connected component partitioning based on undirected graphs and outputting substructure hints that are separated from the main connected components; Calculate the in-degree, out-degree, and total degree of each node, and output the degree distribution statistics. Hub node prompts are determined based on degree distribution statistics, preset multiples, and minimum degree thresholds. Detection of chain and star structures; Detect repeating edges and self-looping edges; The ternary information consisting of the relation type, source entity type, and target entity type is compared with the relation constraints allowed by the schema definition, and an output prompt indicating inconsistency or mismatch in direction is given. Among them, the methods for partitioning weakly connected components based on undirected graphs and outputting substructure hints that are separated from the main connected components; and for calculating the in-degree, out-degree, and total degree of nodes and outputting degree distribution statistics include: Let the graph data induced by the sampled or fully acquired set of relation edges be G = (V, E), where V is the set of entity nodes and E is the set of relation edges; for any node v ∈ V, let d_in(v) and d_out(v) represent the in-degree and out-degree of v, respectively, and let d(v) represent the total degree of v, then: ; In memory, directed adjacency relationships are constructed for outgoing and incoming edge traversal, and undirected adjacency relationships are constructed for weak connectivity analysis: for any edge e∈E, if its source endpoint and target endpoint are different, an undirected connection is established between the source endpoint and the target endpoint in an undirected sense; the weakly connected components are partitioned into node sets on this undirected adjacency using a breadth-first search method to obtain the number of components, the maximum component size, and its proportion of |V|; Methods for determining hub node suggestions based on degree distribution statistics, preset multiples, and minimum degree thresholds include: The density definition of a directed simple graph is used to characterize the proportion of edges in all ordered node pairs, and the output is one of the graph structure summaries: ; Where |V|>1; when |V|≤1, density is not calculated or is left blank by convention. For hub node detection, let μ be the mean of the total degree of all nodes, σ be the overall standard deviation of the total degree, d_min be the preset minimum degree threshold, and k be the standard deviation factor. Then, the hub determination threshold τ is taken as: ; When d(v)≥τ, generate a hub node class prompt; Methods for detecting chain and star structures include: The chain structure identifies the path expansion by identifying the set of nodes that satisfy the condition that "both the in-degree and out-degree of the internal nodes are 1" and the directed adjacency connection relationship; when the length of the identified directed path node sequence is not less than the preset threshold L, the chain structure prompt is output. For a candidate center node v, let its undirected neighbor set be Γ(v); if |Γ(v)| is not lower than a preset threshold S, and the proportion of neighbor nodes u that satisfy d(u)=1 is not lower than a preset proportion α, that is: ; Then output a star-shaped structure hint; Methods for detecting repeating edges and self-loop edges include: For the same source endpoint s, target endpoint t, and relation type r, let the parallel edge count be n(s, t, r). If: ; The presence of parallel repeating edges is then indicated. For edge e, if: ; Then a hint indicating the presence of a self-loop edge is given. The method for comparing the ternary information consisting of the relation type, source entity type, and target entity type with the relation constraints allowed by the schema definition, and outputting a prompt indicating inconsistency or mismatch in direction, includes: For edge e, let r(e) be the relation type, l_s(e) and l_t(e) be the source and target entity types respectively, and let A be the set of triplets allowed by the schema; like And (r(e), l_t(e), l_s(e)) ∈ A, the output direction may be reversed (hint); if ,and The output will be displayed as a pattern mismatch or out-of-synchronization warning.

[0013] Preferably, the fourth sub-process includes at least one: The missing rate of attributes is calculated based on entity type, and suggestions are generated accordingly; specifically, the missing rate of attribute p on type L is defined as: ; Where V_L is the set of sample nodes of type L, and n_L = |V_L|. For sample nodes of type L; When miss(L,p) is not lower than the preset missing rate threshold, an attribute integrity risk warning can be output. The system calculates the percentage of repeated values ​​or principal values ​​for statistical attributes and generates prompts accordingly. Specifically, for type L and attribute p, let the non-empty sample set be W_{L,p}, let N_nn = |W_{L,p}|, let U_{L,p} be the number of different values ​​in the non-empty value sequence, and let f_max be the number of times the most frequent value appears. Then, the percentage of repeated values ​​and the percentage of principal values ​​are defined as follows: ; ; When dup(L,p) or top(L,p) are not lower than the preset threshold, output a prompt indicating that the repeated values ​​are too high or the main values ​​are too concentrated. The function analyzes the rarity or skewness of the distribution of entity types or relation types and generates hints. Specifically, let the set of all sample nodes be V, |V|>0. For any entity type L, let n_L be the number of sample nodes of that type, and let n_max = max_L n_L. Then the proportion of the dominant entity type is defined as: ; When s_ent is not lower than the preset dominant proportion threshold, a warning message indicating a severe skew in the distribution of entity types is output, and the same proportion definition is also used for the distribution of relation types. The system counts instances where the same attribute is used interchangeably with numeric and string types and generates a prompt. Specifically, for type L and attribute p, on non-empty samples, the number of numeric samples N_num and the number of string samples N_str are counted separately. When N_num + N_str is not lower than the minimum statistical threshold and both are positive, the minority type percentage is recorded as: ; When mix(L,p) is not lower than the preset mixing ratio threshold, the output type will be a mixed class prompt. For numerical attributes, fences are constructed based on interquartile ranges, and the outlier ratio is statistically analyzed. Specifically, for type L and numerical attribute p, let the sorted non-empty numerical samples be x_(1)≤…≤x_(N), and obtain the first quartile Q1 and the third quartile Q3 using the linear interpolation percentile method. If the preset multiplier is k, then the fence is defined as follows: ; This attribute can be skipped when IQR=0; let N_out be the number of samples falling outside the fence, then the outlier ratio is defined as: ; When N is not lower than the minimum numerical statistical threshold and N_out>0, output a numerical outlier class hint; The entity types declared in the pattern definition are compared with the entity types appearing in the sample, and a type hint is output for any types that do not appear. Specifically: Let the set of entity types declared in the pattern be T_S, and the set of entity types appearing in the sample be T_E. For any e, the following holds: ; The output mode declaration type is not overridden or no class hint appears in the sample.

[0014] Preferably, when saving the subtask record, a snapshot of the pattern update time and a snapshot of the map data update time are saved simultaneously; after the pattern definition is updated or the map instance data is updated, the quality prompts saved in the past are compared with the current update time information to determine whether they are invalid or need to be retested.

[0015] The present invention also provides a multi-dimensional automated quality inspection system for knowledge graphs, the system being used to implement the aforementioned method, the system comprising: a creation module, an execution module, and a saving module; The creation module is used to obtain graph instance data of the target knowledge graph and the pattern definition bound to the target knowledge graph, and to create a quality inspection task, so that the quality inspection task records the correspondence between the target knowledge graph and the pattern definition; The execution module is used to execute at least one quality inspection sub-process under the quality inspection task, and save the output results of each quality inspection sub-process as a corresponding sub-task record; The storage module is used to save the quality prompts in each of the subtask records in the form of structured entries. The structured entries include at least the problem category, the target object, and explanatory information.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) Complementary multiple strategies to improve anomaly coverage capability By combining schema constraint verification (such as SHACL), reverse consistency verification based on mining rules, graph structure analysis and statistical distribution analysis within the same quality inspection task framework, explicit schema constraints, data induction patterns, topological anomalies and attribute / type distribution deviations can be examined simultaneously on the same target graph, reducing the blind spots of single methods and improving the ability to discover different types of quality problems.

[0017] (2) Unify task organization and improve the operability and maintainability of the project. The creation, execution, status recording, and result storage are carried out on a task-by-task basis, enabling multiple testing capabilities to have a unified entry point and lifecycle management, reducing the operation and maintenance and integration costs caused by "tools running independently and results being stored in a scattered manner".

[0018] (3) Structured output enhances the interpretability and handleability of results. Each subtask output includes structured fields such as problem category, target, evidence information, and severity level, which facilitates platform-side filtering, sorting, statistical summarization, and integration with the rectification process. Compared to outputting only logs or scattered reports, this is more conducive to forming a closed-loop governance.

[0019] (4) Graph structure analysis is based on in-memory graph representation, which reduces the dependence on repeated interactions with graph databases. Constructing adjacency relationships in memory and performing calculations such as weak connectivity partitioning, degree distribution statistics, and recognition of various structural morphologies helps reduce the overhead and latency fluctuations caused by multiple graph queries in quality inspection scenarios, and improves the controllability of large-scale sample analysis.

[0020] (5) Statistical testing supports two types of attribute benchmarks: "data-driven" and "pattern-driven". Indicators such as attribute completeness can be based on the statistical analysis of the actual set of attributes in the sample, or they can be compared with the attribute declared in the pattern when pattern constraints are enabled, thus taking into account both exploratory discovery and standardized assessment needs.

[0021] (6) Version association mechanism to improve the timeliness and traceability of detection results. By linking and saving the detection results with the pattern update time information and the map data update time information, it is possible to determine whether the historical conclusions still correspond to the current map state after the pattern or data changes. This supports retest prompts, result invalidation markings, or automatic rerun strategies, thereby improving the reliability in continuous operation scenarios. Attached Figure Description

[0022] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram of the overall architecture of a knowledge graph quality detection method in one embodiment of the present invention, showing the typical calling relationship between the quality detection service, knowledge service, and graph data service, as well as the division of functional modules such as task management, pattern consistency verification, rule reverse verification, graph structure analysis, statistical analysis, result storage, and version association. Figure 2 This is a schematic diagram of the organizational relationship and state transition between the main quality inspection task and subtasks in one embodiment of the present invention. It shows the binding relationship between the main quality inspection task and the target knowledge graph and pattern definition, as well as the status and result write-back path of the subtasks, such as creation, running, success, and failure. Figure 3 This is a schematic diagram of a pattern consistency verification process based on shape constraints in one embodiment of the present invention, illustrating the process of generating a shape constraint graph from a pattern definition, converting graph instance data into a data graph, and outputting structured violation entries through a verification engine. Figure 4This is a schematic diagram of the reverse consistency verification process based on association rule mining in one embodiment of the present invention, showing the process of fact triple sorting, rule mining, rule body matching and conclusion relationship verification, and generating suspicious relationship prompts; Figure 5 This is a schematic diagram of the graph structure analysis and statistical analysis process in one embodiment of the present invention. It shows the process of obtaining relation edge samples and entity samples, constructing a graph structure representation in memory and generating structure class prompts, and performing statistics on entity attributes and relation distributions and generating statistical class prompts. It can also show output truncation and threshold configuration nodes. Detailed Implementation

[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0025] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] The following explains the technical terms used in this invention: 1. Knowledge Graph This refers to structured semantic network data consisting of entities as nodes, semantic relationships as edges, and entity attributes and (optionally) relationship attributes. The knowledge graph in this invention can be stored and queried by a graph database, or instance data can be obtained through a graph data service interface in a sampling or paginated manner.

[0027] 2. Schema This refers to the conceptual layer constraints of a knowledge graph, typically including at least entity types, relation types, and entity attribute definitions; relation types can also constrain the allowed entity types on both the source and target sides. Schemas are used to guide data modeling and consistency checks, and may be updated as business evolves.

[0028] 3. Shape Constraints (SHACL) This refers to the SHACL (Shapes Constraint Language) specification defined by the W3C, used to describe constraints on RDF data graphs. This invention uses shape constraints to formalize entity attribute rules and relation rules in the schema, and a validation engine conforming to the SHACL standard automatically validates the data graph, outputting information and explanations for constraint violations.

[0029] 4. Association rule mining and Horn rules Association rule mining refers to the process of statistically analyzing frequent patterns from a large number of fact triples to obtain rule forms that "imply a relation between the premise pattern and the conclusion." Horn rules can be understood as implications where the rule body consists of several relation atoms and the conclusion is a single relation atom, facilitating pattern matching and consistency checks on graph data.

[0030] 5. Reverse consistency check (based on mining rules) This refers to the practice of using mining rules not only for "prediction and completion" after obtaining them, but as data-driven empirical constraints: when the rule body can be matched in the graph but the conclusion relation is missing or conflicting in the corresponding entity pair, the relevant relation instance is marked as suspicious or to be verified, thereby discovering edge data that is significantly inconsistent with statistical regularity.

[0031] 6. Graph structure analysis (consistency between topology and pattern orientation) This refers to constructing a graph structure representation based on an edge list and entity type information without relying on business semantic reasoning. It then conducts morphological analysis such as connectivity, degree distribution, repeated edges, self-loops, and chain / star topologies. The "relationship - source entity type - target entity type" is compared with the allowed pattern set to identify co-occurrences with abnormal directions or patterns not covered.

[0032] 7. Statistical and Distribution Analysis This refers to grouping and statistically analyzing the distribution of sampled entity attributes and relation types, and triggering quality alerts through indicators such as missing rate, concentrated values, mixed types, skewed distribution, and numerical outliers (e.g., the fence method based on interquartile range); when pattern comparison is enabled, the pattern declaration attributes are used as one of the integrity assessment benchmarks.

[0033] 8. Quality Inspection Tasks and Sub-tasks A quality inspection task refers to a record of a quality governance activity initiated against a specific target knowledge graph; a subtask refers to the smallest detection unit within a task that can be executed independently and can succeed or fail independently. Subtask results should be saved in a structured entry format and can be associated with snapshot information such as pattern update time and graph data update time to determine whether historical conclusions still correspond to the current graph state.

[0034] Example 1 Knowledge graphs use entities as nodes and relations as edges, and are accompanied by a schema describing entity types, relation types, and attribute constraints. This invention provides a multi-dimensional automated quality inspection method for knowledge graphs, including the following steps: Obtain the graph instance data of the target knowledge graph and the pattern definition bound to the target knowledge graph, and create a quality inspection task so that the quality inspection task records the correspondence between the target knowledge graph and the pattern definition; Under the quality inspection task, at least one quality inspection sub-process is executed, and the output of each quality inspection sub-process is saved as a corresponding sub-task record; wherein, the quality inspection sub-process is selected from at least one of the following sub-processes: The first sub-process for verifying the consistency between the map instance data and the pattern definition based on the shape constraint language; The second sub-process of performing reverse consistency verification on relation instances based on association rules obtained from the data mining of the graph instances; The third sub-process constructs a graph structure representation in memory and generates structure class quality hints based on the relation edge samples in the graph instance data; The fourth sub-process performs statistical analysis on the distribution of entity attributes and relationship types in the graph instance data and generates statistical quality tips. The quality tips in each of the subtask records are saved in the form of structured entries, which include at least the problem category, the target object, and explanatory information.

[0035] The first sub-process includes: mapping entity attribute constraints and relation constraints in the pattern definition to shape constraints to generate a shape constraint graph; converting the graph instance data into a data graph; applying the shape constraint graph to the data graph using a verification engine conforming to the W3C SHACL standard for verification, and generating the structured entries based on the verification report.

[0036] The second sub-process includes: extracting fact triples from the graph instance data and organizing them into rule mining inputs; configuring support and confidence thresholds to mine implication association rules; performing pattern matching on the association rules on the graph instance data; and generating the structured entries used to indicate suspicious relationship instances when the rule body match is true but the conclusion relation is missing in the corresponding entity pair or conflicts with the conclusion relation.

[0037] The third sub-process includes at least one of the following: partitioning the undirected graph into weakly connected components and outputting substructure prompts that are separated from the main connected components; calculating the in-degree, out-degree, and total degree of nodes and outputting degree distribution statistics; determining hub node prompts based on the degree distribution statistics, a preset multiple, and a minimum degree threshold; detecting chain structures and star structures; detecting repeated edges and self-loop edges; comparing the ternary information composed of the relation type, source entity type, and target entity type with the relation constraints allowed by the pattern definition, and outputting prompts for inconsistent or mismatched directions.

[0038] The fourth sub-process includes at least one of the following: calculating the missing rate of attributes by entity type and generating a prompt; calculating the repetitive features or principal value ratio of attribute values ​​and generating a prompt; calculating the rarity or skewness of the quantity distribution of entity types or relation types and generating a prompt; calculating the mixed use of the same attribute between numeric and string types and generating a prompt; constructing fences for numeric attributes based on interquartile range and calculating the outlier ratio; comparing the entity types declared in the pattern definition with the entity types appearing in the sample and outputting a prompt for types that do not appear.

[0039] When saving the subtask record, a snapshot of the pattern update time and a snapshot of the map data update time are also saved. After the pattern definition is updated or the map instance data is updated, the quality prompts saved in the past are compared with the current update time information to determine whether they are invalid or need to be retested.

[0040] Multiple subprocesses in the at least one quality inspection subprocess are executed in parallel; each subtask record contains execution status information and saves a summary of the failure reason when execution fails.

[0041] The third sub-process and / or the fourth sub-process obtain the relation edge samples and / or entity samples based on the configured relation sampling upper limit and / or node sampling upper limit; when the number of generated structured entries exceeds the preset upper limit, the output is truncated and a truncation prompt entry is generated.

[0042] In the fourth sub-process, the missing rate statistics of at least some attributes use the set of attributes declared for the corresponding entity type in the pattern definition as the set of attributes to be counted.

[0043] The association rule is an implication rule of the Horn form.

[0044] like Figures 1-5 As shown, the specific implementation process is as follows: The knowledge graph instance is represented by a set of directed edges, each edge containing at least: source_id, target_id, and rel_type, and optionally source_label, target_label, and an edge attribute dictionary; entity nodes contain at least identity, label, and an attribute dictionary props. The method includes: Step 1: Quality Inspection Task Creation and Schema Binding Receive a quality inspection task creation request containing the target graph identifier graph_id, pull graph metadata through the knowledge service interface, and bind at least schema_id, schema_name, and graph_name; create a master record for the task in the quality inspection database and initialize the subtask list to empty.

[0045] Step Two: Subtask Arrangement and Execution Under the quality inspection task, create one or more subtask records. Each subtask must include at least a type field (type), a tool identifier (util), a status field (status), a creation / update time, and a result field (result). The status field must include at least three categories: running, successful, and failed; an error message is written when a failure occurs. Subtask types must include at least: (a) SHACL constraint verification subtask; (b) Reverse validation subtask based on rule mining rules; (c) Graph structure analysis subtask; (d) Statistical analysis subtask.

[0046] Step 3: SHACL Constraint Validation Subtask (Entity Attribute Constraints + Relationship Constraints) (3.1) Obtain the schema from the knowledge service and map the attribute definitions of the entity type to SHACL node shapes (NodeShape): select the corresponding value constraint template according to the attribute data type (including but not limited to integer, floating point, string, date and time, boolean, etc.) to generate at least one constraint among minimum value, maximum value, regular expression pattern, maximum length, and enumeration set; map the "required / recommended" business requirements to minimum cardinality, maximum cardinality, or existence constraint.

[0047] (3.2) Map the endpoint constraints of the relation type to SHACL relation shape or attribute path constraints: restrict the domain (source entity type) and value range (target entity type) of the relation, and optionally generate attribute constraint templates isomorphic to (3.1) for relation edge attributes.

[0048] (3.3) Compile the schema constraints into a SHACL Shapes Graph in the form of RDF triples (e.g., serialize with TTL) and convert the graph instance data into a consistent data graph.

[0049] (3.4) Call the W3C SHACL-compliant validation engine to apply Shapes Graph validation to the Data Graph, output a validation report and store it in the database in a structured manner: each violation should include at least the violation focus resource, trigger shape, constraint component, message text and severity level mapping fields, which are used to unify and display with the issue_type system of subsequent subtasks.

[0050] To facilitate understanding of the above process, the following uses symbols to illustrate the relationship between data objects and verification; these symbols do not limit the internal algorithm and implementation language of the verification engine.

[0051] Let the transformed graph instance data be G_D=(V, E), where V is the set of entity nodes and E is the set of relation edges. For any edge e∈E, let s(e), t(e), and r(e) represent the source entity, target entity, and relation type, respectively; for any node v∈V, let P(v) represent its attribute set (key-value mapping).

[0052] Let G_S be the shape constraint graph obtained by mapping defined by the schema, which defines the set of focus nodes for the target. The constraints imposed on (or the focus on the resource set). For any focus f∈F, let C(f) be the set of constraint components acting on f (which may include attribute value constraints, cardinality constraints, relation endpoint type constraints, etc.). Then SHACL verification can be expressed as: determining whether each c∈C(f) holds true on G_D.

[0053] A violation record is generated when there exist a focus f ∈ F and a constraint component c ∈ C(f) such that c does not satisfy G_D. Let R be the set of violation records, then: (1) Here, sh represents the trigger shape identifier, cc represents the trigger constraint component identifier, and the ellipsis represents extensible fields such as message text and severity level.

[0054] In one embodiment, the violation scale of a single verification can be denoted as |R|, which can be combined with the task threshold or the front-end display pagination strategy; this processing is an engineering implementation detail and does not constitute a limitation on the scope of protection of this invention.

[0055] Differences from existing technologies Using SHACL (or an equivalent shape constraint language) alone to perform schema consistency verification on RDF / knowledge graphs is a known technique in the field. The technical contribution of step three in this invention is not to replace or improve the SHACL specification itself, but to make the above explicit schema constraint verification a programmable sub-process under the quality inspection task. Its output is entered into the unified quality inspection task record in the form of structured violation entries. It is also convenient to converge, display and trace with reverse verification based on mining rules, graph structure analysis, statistical analysis and schema / data version snapshot mechanism in the same platform process, thereby alleviating the problem of independent operation of verification tools and difficulty in consistent management of results with platform tasks and graph evolution process in the prior art.

[0056] Step 4: Reverse Validation Subtask Based on Rule Mining (AMIE) (4.1) Convert the graph fact triples into tabular samples that can be consumed by the rule mining tool. The fields should include at least the head entity, relation, and tail entity (and optional entity type columns), and configure mining parameters such as support threshold, confidence threshold and rule length upper limit.

[0057] (4.2) The rule set is obtained by running the rule mining. The rule is represented in the form of Horn rule: a rule body consisting of several relation atoms contains a conclusion relation atom.

[0058] (4.3) Perform reverse verification for each rule: perform pattern matching on the rule body in the graph; when a matching instance exists but the conclusion relation is missing on the corresponding entity pair, or conflicts with the conclusion relation (e.g., there is a mutually exclusive relation label on the same entity pair), generate a suspicious data record. The record includes at least: rule identifier, rule body instance binding, checked relation triplet, conflict type (missing / mutually exclusive / low confidence check) and explanatory text.

[0059] Step (3.) focuses on explicit schema constraints, while step (4.) focuses on data-driven co-occurrence patterns. The two complement each other in terms of the causes of false alarms.

[0060] To facilitate understanding of the above process, the following uses symbols to provide auxiliary explanations of the fact set, rule form, statistical measure, and reverse verification judgment; the symbols do not limit the internal implementation or specific parameter naming of the selected rule mining tool.

[0061] The set of fact triples in the graph is denoted as (T={(h,r,t)}), where (h) represents the head entity, (t) represents the tail entity, and (r) represents the relation. Optionally, the triples can also carry entity type information to constrain the mining space; this invention does not limit the field column names.

[0062] A rule obtained through rule mining adopts the Horn implication form, where the conjunction of several relation atoms in the rule body implies a conclusion relation atom, denoted as: (2) in, H represents the i-th relation atom in the rule body, H is a single conclusion relation atom; m is a positive integer representing the number of atoms in the rule body.

[0063] In one embodiment, statistical measures such as support and confidence can be defined for rule R (i.e., the form shown in equation (2)) to screen rule size and reliability. Let supp(body) be the support count or normalized support that the rule body can match on the fact set T (the definition of key endpoints is consistent with the selected mining tool), and let supp(R) be the support count or normalized support when the rule body and the conclusion are both true. Then the confidence can be expressed as: (3) When supp(body) = 0, the rule is either not reverse-validated or discarded; the specific threshold and smoothing strategy are given by the configuration and are not limited by this invention.

[0064] The graph instance data is still denoted as G_D = (V, E) (consistent with the meaning of step three), where E is the set of relation edges. When performing reverse validation on rule R, if there exists a binding θ on G_D such that the rule body is true under θ, but the conclusion relation does not exist in E on the corresponding entity pair, or is true under θ along with a relation in the mutually exclusive relation set M, then a suspicious alert is generated. The mutually exclusive relation set M can be given by business configuration or schema definition. The above judgment can be expressed as: (4) Suspicious alerts should include at least the rule identifier, rule body binding information, the triple or relation instance being checked, the conflict type (missing, mutually exclusive, or a type to be reviewed related to a low-confidence control strategy), and explanatory text; the field organization method is determined by the platform implementation.

[0065] Differences from existing technologies Learning frequent patterns from knowledge graphs using association rule mining and further applying them to link prediction, knowledge completion, or recommendation ranking is a common application path in this field. The technical contribution of step four in this invention does not lie in proposing a new rule mining algorithm itself, but rather in: using the mined implicit rules for reverse consistency checks on existing relation instances, taking the statistically frequently occurring "rule body → conclusion relationship" as a data-driven constraint, and outputting a suspicious alert when the instance graph and conclusion relationship are inconsistent; and incorporating this process as a programmable subprocess in the quality inspection task, so that the output, along with the explicit pattern verification results from step three, as well as the results of graph structure analysis and statistical analysis, are aggregated in a unified task record. Compared to simply using the mined rules to forward generate candidate triples, this step is more conducive to discovering edge data that is significantly inconsistent with the data co-occurrence patterns, and complements the explicit schema constraints, thereby improving the problem of single-source missed detections or false alarms under a single detection path.

[0066] Step 5: Graph Structure Analysis Subtask (Memory Adjacency List + Multiple Nameable Detection) (5.1) Graph data loading and adjacency structure construction Obtain the set of edges in the knowledge graph to be analyzed. Each edge must contain at least the source entity identifier, target entity identifier, relation type, and source / target entity type information. Construct the outgoing and incoming edge adjacencies of the directed graph in memory, and construct undirected adjacencies for weak connectivity analysis. Simultaneously count the in-degree, outgoing degree, and total degree of each node, count the occurrence frequency of each relation type, and count parallel edges belonging to the same source node, the same target node, and the same relation type.

[0067] (5.2) Output of global structural statistics Calculate and output graph structure summary information, including at least: mean in-degree, mean out-degree, mean total degree, maximum total degree, and standard deviation of total degree; calculate graph density (normalized ratio determined by the number of edges to the number of nodes) under a common definition of density for directed simple graphs; perform weakly connected component partitioning from an undirected perspective, and output the number of connected components, the size of the maximum component, and its proportion of all nodes.

[0068] (5.3) Detection of multi-category structural anomalies and risk warnings Based on the adjacency and degree information described above, structured question entries are generated. Each entry includes at least the question category, the target object, evidence information, severity level, and a textual description. The question categories at least include: 1. Orphaned Node: A node with a total degree of zero, indicating that it may contain disconnected data or imported residual data.

[0069] 2. Weak connection node: A node whose total degree is not zero but does not exceed the preset limit, indicating that the connection is weak or that it is a dangling endpoint.

[0070] 3. Parallel duplicate edges: This indicates that there are multiple edges in the same direction and with the same relationship type, prompting a warning about redundancy or duplicate imports.

[0071] 4. Self-loop edge: An edge where the source entity and the target entity are the same. Note that you need to confirm whether it is allowed based on the business requirements.

[0072] 5. Hub Node: A node whose total degree simultaneously meets the requirements of "not lower than the preset minimum degree threshold" and "not lower than the total degree mean plus a certain multiple of the total degree standard deviation" is a node that indicates the structural imbalance or data aggregation risk that may be caused by high connectivity (where the multiple and threshold are configurable).

[0073] 6. Leaf Node Pattern: Distinguish between source leaf nodes (with only one outgoing edge and no incoming edges) and terminal leaf nodes (with only one incoming edge and no outgoing edges), used to indicate the endpoint characteristics of a chain structure.

[0074] 7. Sparse Relationship Type: When the edge size reaches the trigger condition, a low usage warning will be given for relationship types that occur very infrequently.

[0075] 8. Relation types defined in the schema but not used: Relation types declared in the schema but not appearing in the sample edge set indicate that the definition is redundant or the data is not covered.

[0076] 9. Weakly connected component anomaly: When there is a sub-connected part that is separate from the main component and has a size greater than one, it indicates knowledge silos or insufficient integration; an upper limit can be set for the number of reports per item, and the remaining number of components will be indicated in a summary manner for any excess.

[0077] 10. Chain structure: Identify linear chain patterns with a length not less than a preset threshold (where internal nodes in the chain satisfy a "one-in, one-out" connection relationship locally), indicating the possible existence of a linear hierarchical design or import path aggregation.

[0078] 11. Star topology: When a node has a large number of neighbors and the proportion of leaf nodes among the neighbors exceeds the preset ratio, it indicates the risk of excessive centralization or batch import aggregation.

[0079] 12. Relationship direction and schema consistency: Compare the "relationship - source entity type - target entity type" on the edge with the ternary constraints allowed by the schema; if the schema can be satisfied after swapping the source / target types, it will indicate that the direction may be reversed; if neither is satisfied, it will indicate that the relationship does not match the schema or the schema is not synchronized.

[0080] (5.4) Result size control When the number of detected problematic items exceeds the preset limit, the list is truncated, and a prompt message is added explaining that it has been truncated and suggesting reducing the sampling range or analyzing in batches.

[0081] To facilitate understanding of the graph structure analysis process described in this section, the following symbols are used to provide supplementary explanations of graph data objects, degree statistics, graph density, hub node thresholds, and result size control; these symbols do not constitute limitations on the specific storage structure, query language, or sampling interface of the graph database.

[0082] Let G = (V, E) be the graph data induced by the set of relation edges obtained through sampling or full acquisition, where V is the set of entity nodes and E is the set of relation edges. For any node v ∈ V, let d_in(v) and d_out(v) represent the in-degree and out-degree of v (statistically based on directed edges), respectively, and let d(v) represent the total degree of v. Then: (5) Directed adjacency relationships are constructed in memory for outgoing and incoming edge traversal, and undirected adjacency relationships are constructed for weak connectivity analysis: for any edge e∈E, if its source endpoint and target endpoint are different, an undirected connection is established between the two endpoints in an undirected sense. The weakly connected components can be partitioned into node sets on this undirected adjacency using methods such as breadth-first search, and the summary quantities such as the number of components, the maximum component size, and its proportion of |V| are obtained.

[0083] In one embodiment, the following directed simple graph density definition characterizes the proportion of edges in all ordered node pairs and is output as one of the graph structure summaries: (6) Where |V|>1; when |V|≤1, the density may not be calculated or may be left blank as agreed, which is not limited in this invention.

[0084] For hub node detection, let μ be the mean of the total degree of all nodes, σ be the overall standard deviation of the total degree, d_min be the preset minimum degree threshold, and k be the standard deviation factor. Then, the hub determination threshold τ can be taken as: (7) When d(v)≥τ, a hub node class hint can be generated; d_min and k are given by configuration.

[0085] Furthermore, the following provides several typical detection criteria, with the thresholds involved all given by configuration or business rules; the following formulas are for illustrative purposes only and do not preclude those skilled in the art from using equivalent criteria or approximate implementations.

[0086] (1) Isolated node, weakly connected node and leaf node pattern If node v satisfies: (8) Then v can be determined to be an isolated node.

[0087] If there exists a preset upper limit W for the degree of weak connections, and the following conditions are met: (9) Then v can be determined to be a weakly connected node.

[0088] If the following conditions are met: (10) Then v can be determined as the source leaf node; If the following conditions are met: (11) Then v can be determined as a terminal leaf node.

[0089] (2) Parallel repeating edges, self-looping edges For the same source endpoint s, target endpoint t, and relation type r, let the parallel edge count be n(s, t, r). If: (12) This indicates the presence of parallel repeating edges.

[0090] For edge e, if: (13) This indicates the presence of a self-loop edge.

[0091] (3) Sparse relation types and relation types declared in schemas but not used. Let |E| be the number of edges in the entire graph (or sample edge set), and let cnt(r) be the number of occurrences of relation type r. When |E| is not less than the preset trigger edge count E0, and: (14) This will provide sparse usage hints for relation type r; where c0 is the preset maximum number of uses.

[0092] Let R_S be the set of relation types declared in the schema, and R_E be the set of relation types actually appearing in the sample edge set. For example: (15) It can provide a "declared in the schema but not used in the sample" message for relation type r.

[0093] (4) Weakly connected substructures (non-principal components) The weakly connected component set {C1, C2, …} is obtained by partitioning on the undirected adjacency, and then... Sort in descending order, and denote the largest component as C1. For a component C that satisfies |C|>1 and j>1, output a hint of the substructure separated from the main connected part (the number of outputs can be set to an upper limit and the remaining number can be summarized).

[0094] (5) Chain structure and star structure The chain structure can be identified by expanding the path through the set of nodes that satisfy the condition that "the in-degree and out-degree of the internal nodes are both 1" and the directed adjacency connection relationship; when the length of the identified directed path node sequence is not less than the preset threshold L, the chain structure prompt is output.

[0095] For a candidate center node v, let its undirected neighbor set be Γ(v). If |Γ(v)| is not lower than a preset threshold S, and the proportion of neighbor nodes u that satisfy d(u)=1 is not lower than a preset proportion α, that is: (16) This will output a star-shaped structure hint.

[0096] (6) Relation-type ternary and schema allowable set comparison For edge e, let r(e) be the relation type, l_s(e) and l_t(e) be the source and target entity types respectively, and let A be the set of ternaries allowed by the schema. If ,and It can output a prompt that the direction may be reversed; if neither of them belongs to A, it can output a prompt that does not match the pattern or is out of sync (the specific message text is configured by the platform).

[0097] Differences from existing technologies Performing statistical analysis on degree distribution, connectivity components, density, and several topological morphologies for general graph data is a common technique in the field of graph analysis; batch calculation of these indicators in graph databases or graph computing frameworks is also a common implementation path. The technical contribution of step five in this invention lies not in proposing a completely new graph theory metric, but in: incorporating the above graph structure analysis into a quality inspection sub-task within a unified task orchestration system that integrates pattern consistency verification, rule reversal verification, and statistical analysis. After acquiring edge samples, adjacency is constructed in memory, and multiple named checks are performed, outputting structured question entries and storing them in the database for easy integration with platform filtering, aggregation, and version snapshot mechanisms; simultaneously, the consistency of the allowed set of relations in the pattern with the actual "relation-source type-target type" ternary information on the edges is checked (including cases of direction reversal, interpretability, and complete mismatch), aligning structural level detection with the goals of knowledge graph pattern governance. Compared to relying solely on multiple interactive queries to complete scattered statistics in graph databases, this step helps control the number of interactions and latency fluctuations in quality inspection scenarios, and balances the feasibility of large-scale sampling through output upper limits and truncation strategies.

[0098] Step Six: Statistical Analysis Subtask (6.1) Determination of sample tissue and set of attributes to be tested Obtain the entity node samples and relation edge samples to be counted. Group the entity nodes by entity type; for each entity type, determine the set of attributes that need to participate in the integrity statistics: in one embodiment, the attribute set can be the union of the attributes that actually appear in the samples of that type; in another embodiment, when schema constraint statistics are enabled, the attribute set is based on the attribute set declared for that entity type in the schema, and the intersection with the sample union is calculated or irrelevant system fields are filtered according to business rules.

[0099] (6.2) Attribute missing and null value detection For each entity type and each attribute to be inspected, the proportion of samples with missing or equivalent missing values ​​is calculated. Attributes with non-existent keys, empty or blank strings, or belonging to predefined null value markers (such as "none," "empty," or "undefined") are considered missing. When the missing proportion is not lower than a preset missing rate threshold, an attribute integrity risk entry is output, indicating the degree of missingness of that attribute on that entity type, and providing evidence such as the total sample size and the number of missing attributes.

[0100] (6.3) Detection of duplicate attribute values ​​and value sets Provided that the number of non-empty samples meets the minimum statistical threshold, the duplication characteristics of non-empty values ​​are statistically analyzed for each entity type and its attributes: the percentage of duplicate values ​​is calculated, and when it is not lower than the preset duplication rate threshold, it is indicated that there may be batch default values ​​or duplicate entries; the percentage of the single value with the highest frequency is statistically analyzed, and when it is not lower than the preset concentration threshold, it is indicated that the value is too concentrated, and it is recommended to check abnormal default values ​​or entry deviations.

[0101] (6.4) Entity type and relation type distribution detection Provided the total number of sample nodes meets statistical significance, the sample counts for each entity type are statistically analyzed: For entity types with counts not exceeding a preset rarity threshold, long-tail suggestions are output; for the entity type with the highest proportion, its percentage of all sample nodes is calculated, and if it is not lower than a preset dominant proportion threshold, a severely skewed entity type distribution suggestion is output. Similar statistical analysis is performed on relation types: For relation types with very few edges, a rarity suggestion is output; for the relation type with the highest proportion, its percentage of all sample edges is calculated, and if it is not lower than a preset dominant proportion threshold, a severely skewed relation type distribution suggestion is output.

[0102] (6.5) Sparsity detection of triple co-occurrence patterns This function identifies co-occurrence patterns and their edge counts within the statistical sample edges, which are composed of "source entity type - relation type - target entity type". It outputs a prompt for co-occurrence patterns whose edge count is not higher than a preset low threshold, used to identify weak co-occurrence paths or insufficient data coverage (an upper limit can be set for the number of output entries; those exceeding this limit will not be listed individually).

[0103] (6.6) Entity information richness detection Calculate the average number of non-empty attributes in the sample for each entity type (average of the number of non-empty attributes across nodes). When the average is lower than a preset richness threshold, output a message indicating insufficient entity filling for that type, and provide evidence of sample size.

[0104] (6.7) Attribute value type consistency check For each entity type and its attributes, count the number of numeric values ​​and the number of string values ​​in the non-empty samples (special types such as Boolean can be excluded separately to avoid misjudgment). When both types of values ​​exist simultaneously and the proportion of a few types is not lower than the preset mixed-use ratio threshold, output a mixed-use prompt to detect multi-source fusion or inconsistent format issues.

[0105] (6.8) Detection of Entity Type Relationship Participation and Isolation Tendency When the sample edge set is not empty, the proportion of nodes in the sample nodes that do not appear on any edge endpoints is counted for each entity type. When this proportion is not lower than a preset isolation proportion threshold and isolated nodes exist, an isolation tendency indicator for that type is output, explaining the risk that the sampling range may lead to an underestimation of the connectivity of the entire graph.

[0106] (6.9) Numerical attribute outlier detection For each entity type and its numerical attribute, when the number of non-empty numerical samples meets the minimum statistical threshold, the numerical sequence is sorted and the first quartile, third quartile, and interquartile range are calculated. A lower and upper fence are constructed based on the interquartile range (the fence width is obtained by multiplying the interquartile range by a configurable multiple). The proportion of samples falling outside the fence is counted, and outlier alerts are output to detect input errors or measurement anomalies (this attribute can be skipped when the interquartile range is zero, preventing the definition of a valid fence).

[0107] (6.10) Schema declaration entity type coverage detection When the complete set of entity types in the schema is available, it is compared with the set of entity types that appear in the sample. For entity types declared in the schema but not appearing in the sample, an "overwritten" message is output to identify situations such as redundant definitions, data not yet imported, or sampling not being covered.

[0108] (6.11) Integrity check of relation edge attributes When edge attribute information of the relation edges is available, group by relation type, summarize the set of edge attribute keys that have appeared in the sample edges for each relation type, and calculate the proportion of missing or equivalent missing values ​​for each edge attribute key. When the proportion is not lower than the preset relation attribute missing rate threshold, output the edge attribute integrity risk entry under that relation type.

[0109] (6.12) Result size control When the number of problematic items detected exceeds the preset limit, the list is truncated, and a prompt message is added explaining that it has been truncated and suggesting reducing the sampling range or increasing the threshold.

[0110] To facilitate understanding of the statistical analysis process described in this section, the following symbols are used to provide supplementary explanations of sample organization, ratio indicators, quantile outliers, and pattern comparisons; these symbols do not constitute a limitation on specific storage field names, sampling interfaces, or statistical engine implementations.

[0111] Let the entity node samples be grouped by entity type. Let the set of sample nodes of type L be denoted as V_L, and let n_L = |V_L|. Let the set of attributes to be counted be P(L) (in one embodiment, it is taken from the union of attributes appearing in the samples; in another embodiment, it is taken from the set of attributes declared with pattern L and the set after business filtering). For v∈V_L, let I(v,p) represent whether attribute p is missing or equivalent to a null value (1 if the attribute key does not exist, or if the value is empty, blank, or a conventional null value marker; otherwise, 0).

[0112] (1) Attribute missing rate The missing rate of attribute p on type L is defined as: Right now: (17) When miss(L,p) is not lower than the preset missing rate threshold, an attribute integrity risk warning can be output.

[0113] (2) The proportion of duplicate attribute values ​​and principal values ​​(statistics on non-empty samples) For type L and attribute p, let the non-empty sample set be W_{L,p}, let N_nn = |W_{L,p}|, let U_{L,p} be the number of distinct values ​​in the non-empty value sequence, and let f_max be the number of times the most frequent value appears. Then the proportion of repeated values ​​and the proportion of principal values ​​can be defined as follows: Right now: (18) Right now: (19) When dup(L,p) or top(L,p) are not lower than the preset threshold, a prompt such as "too many repeated values" or "excessive concentration of principal values" can be output (this can be skipped if N_nn is lower than the minimum statistical threshold).

[0114] (3) Entity type distribution imbalance (proportion of dominant type) Let the set of all sample nodes be V, |V|>0. For any entity type L, let n_L be the number of sample nodes of that type. Let n_max = max_Ln_L, then the proportion of the dominant entity type can be defined as: Right now: (20) When s_ent is not lower than the preset dominant proportion threshold, a warning message indicating a severely skewed entity type distribution can be output. The same proportion definition can also be used for relation type distribution (replacing node counts with edge counts). This invention does not limit the repetition of formulas.

[0115] (4) Low amount of triple co-occurrence pattern For a sample edge set, let π be the pattern consisting of (source entity type S, relation type R, target entity type T), and let cnt(π) be the number of occurrences. When cnt(π) is not higher than a preset low threshold c_t, a weak co-occurrence pattern prompt can be output: Right now: (twenty one) (5) Entity attribute richness (average number of non-empty attributes) For type L, let |P_nonempty(v)| be the number of nonempty attributes of v. Then the average number of nonempty attributes can be defined as: Right now: (twenty two) When rich(L) is lower than the preset richness threshold, a message indicating insufficient entity filling can be output.

[0116] (6) Mixed use of attribute value types (numeric and string) For type L and attribute p, count the number of numeric samples N_num and the number of string samples N_str on the non-empty sample (boolean samples can be excluded to avoid misjudgment). When N_num + N_str is not lower than the minimum statistical threshold and both are positive, the minority type proportion is recorded as: Right now: (twenty three) When mix(L,p) is not lower than the preset mixing ratio threshold, a type mixing prompt can be output.

[0117] (7) Entity type relationship participation and isolation tendency Let the sample edge set be E, and the set of nodes appearing at any endpoint of an edge be V_E. For type L, let n_iso(L) be the number of nodes in V_L that do not belong to V_E. Then the isolation ratio can be defined as: Right now: (twenty four) When iso(L) is not lower than the preset isolation ratio threshold and n_iso(L)>0, an isolation tendency warning of this type can be output (in the sampling scenario, it is advisable to indicate that the connectivity of the whole graph may be underestimated).

[0118] (8) Numerical attribute outliers (interquartile range fences) For type L and numerical attribute p, let the sorted non-empty numerical samples be x_(1)≤…≤x_(N). The first quartile Q1 and the third quartile Q3 are obtained using the linear interpolation percentile method. Let be... If the preset multiplier is k, then the fence can be defined as: Right now: (25) This attribute can be skipped when IQR=0. Let N_out be the number of samples falling outside the fence; then the outlier ratio can be defined as: Right now: (26) When N is not lower than the minimum numerical statistical threshold and N_out>0, a numerical outlier class prompt can be output.

[0119] (9) The entity type declared in the schema does not appear in the sample. Let T_S be the set of entity types declared in the schema, and T_E be the set of entity types appearing in the sample. For any e, the following holds: Right now: (27) The output pattern declaration type is not overridden or the class hint does not appear in the sample.

[0120] (10) Missing rate of relation edge attributes (when edge attributes are available) For a set of sample edges E_R of relation type R, let the number of edges be m_R. For an edge attribute q, let the number of missing or equivalently missing edges be m_miss(R,q). Then the missing rate can be defined as: Right now: (28) When miss_rel(R,q) is not lower than the preset missing rate threshold for relation attributes, a risk warning for the integrity of relation edge attributes can be output.

[0121] When the number of structured question entries generated in a single statistical analysis exceeds the platform's preset limit, the set of entries can be truncated and truncation description information can be generated; the specific strategy is given by the platform configuration and is not limited by this invention.

[0122] Differences from existing technologies Performing analysis on missing rates, frequency concentration, distribution skewness, and outlier detection based on quantiles for table or record data is a standard practice in data statistics and data quality management. The technical contribution of step six in this invention lies not in reintroducing general statistical indicators, but in organizing these indicators as quality inspection sub-tasks and aligning them with data structures in knowledge graph scenarios such as "entity type grouping—attribute dictionary—relationship type—(source type, relation, target type) co-occurrence pattern—(optional) relation edge attribute." When enabling pattern comparison, the pattern declaration attribute set is used as one of the integrity statistical benchmarks, ensuring consistency between statistical results and pattern governance goals. The output is incorporated into a unified quality inspection task record as structured quality prompts, facilitating aggregation, display, and traceability of the detection results from steps three, four, and five, as well as the pattern / data version snapshot mechanism. This alleviates the problems of fragmented task flows between general statistical tools and the knowledge graph platform, and difficulties in comparing and closing loops of results.

[0123] Example 2 The embodiments are used to illustrate the typical use and processing flow of the present invention in a type of knowledge graph quality management platform. These embodiments do not limit the quality of the detection results or the conclusions drawn from comparisons with other methods; the institution names, graph sizes, and parameter values ​​in these embodiments are all illustrative examples, and those skilled in the art can adjust them according to the specific scenario.

[0124] 1. Data Sources and Processing Flow (1) Object binding and metadata retrieval Users select a target knowledge graph on the platform and create a quality inspection main task. The platform reads information such as the schema identifier, schema name, and graph name bound to the graph through the knowledge service and writes it into the main task record; it can also read metadata such as schema update time for subsequent version snapshots. The subtask list is initially empty.

[0125] (2) Acquisition of Spectrum Instance Data (Sampling is configurable) The platform acquires graph instance data for analysis based on task configuration through graph data services. Configuration items may include, for example, upper limits for relation sampling, upper limits for node sampling, and whether to perform consistency checks on relation directions and patterns. Sampling strategies are used to control the cost of a single analysis on large-scale industrial graphs; reducing the sampling range may decrease the representativeness of the entire graph, and the platform should indicate this limitation in the results.

[0126] (3) Preparation of shape constraint verification data When enabling the SHACL-based schema consistency subtask, the platform retrieves schema definitions from the knowledge service, maps entity attribute constraints and relation constraints to shape constraints, and generates a constraint graph representation that can be loaded by the validation engine. Simultaneously, it converts the graph instance data into a consistent data graph representation. After validation, violations are written as structured entries into the subtask results, and the subtask status is updated.

[0127] (4) Rule mining and reverse validation data preparation When enabling subtasks based on association rule mining, the platform organizes the fact triples in the graph into tabular samples that can be consumed by the rule mining tool, and configures thresholds such as support, confidence, and rule length to control the rule size. After the rules are mined, the platform performs a reverse consistency check on the relation instances: when the rule body is matched but the conclusion relation is missing or conflicting, a suspicious relation hint is generated and written into the subtask results.

[0128] (5) Input for graph structure and statistical analysis When the graph structure analysis subtask is enabled, the platform constructs adjacency relationships in memory based on the sampled edge list and entity type information, and outputs a structure summary and structure class hints. When the statistical analysis subtask is enabled, the platform calculates statistical indicators for grouped sampled entities and relationships and outputs statistical class hints. Both types of subtasks can set an upper limit for the number of output items per session; if the limit is exceeded, the output will be truncated and a prompt message will be given.

[0129] (6) Result write-back and version snapshot After each subtask is completed, the structured results are written to the corresponding subtask record of the main quality inspection task. For subtasks that require the front-end component or external tool to write back the results, the platform can simultaneously write a snapshot of the pattern update time and a snapshot of the last update time of the graph data when receiving the results. This is to determine whether the historical quality inspection conclusions may be invalid after changes to the pattern or graph data and to prompt for retesting.

[0130] 2. Task Execution and Platform Setup (Example) (1) Subtask composition and parallelism In this embodiment, users can simultaneously enable any combination of pattern consistency verification, rule reverse verification, graph structure analysis and statistical analysis; except for a few dependencies such as "the pattern definition must be obtained before shape constraints can be generated", each subtask can usually be scheduled and executed in parallel. The platform maintains the running, success or failure status of each subtask, and saves a summary of the failure reason when it fails.

[0131] (2) Threshold and strategy configuration (illustrative) The structural suggestions, such as the determination of hub nodes, chain length threshold, and star neighbor ratio threshold, as well as the statistical suggestions, such as the missing rate threshold, concentration threshold, and outlier determination multiple, can all be configured by the platform using default strategies or according to the graph domain; the specific values ​​do not constitute a limitation on the scope of protection of this invention.

[0132] (3) Relationship with the attached figures In one embodiment, it can be as follows Figure 1 The system module architecture is shown below, as follows: Figure 2 The diagram shows the data flow for the main and subtasks of the quality inspection process. The diagram is for illustrative purposes only and is not intended to limit this embodiment.

[0133] This invention addresses quality issues in the construction and continuous operation of knowledge graphs. It proposes organizing multiple detection capabilities within a unified quality inspection framework. This involves combining shape-constraint-based schema consistency verification, association rule mining-based reverse consistency verification, graph structure analysis based on memory graph representation, and statistical analysis oriented towards attribute and type distribution. Structured quality alerts are stored in a database, facilitating platform filtering, aggregation, and closed-loop governance. By linking detection results with schema update times and graph data update times, it helps determine the validity of historical quality inspection conclusions in scenarios with frequent schema and data changes, thereby improving the engineering level and traceability of knowledge graph quality governance. Equivalent substitutions made by those skilled in the art to the above module divisions, interface forms, and parameter configurations without inventive effort should be included within the reasonable extension scope of this invention.

[0134] Example 3 The present invention also provides a multi-dimensional automated quality inspection system for knowledge graphs. The system is used to implement the method described in Embodiment 1. The system includes: a creation module, an execution module, and a saving module. A creation module is used to obtain graph instance data of the target knowledge graph and the pattern definition bound to the target knowledge graph, and to create a quality inspection task, so that the quality inspection task records the correspondence between the target knowledge graph and the pattern definition; An execution module is used to execute at least one quality inspection sub-process under the quality inspection task, and save the output of each quality inspection sub-process as a corresponding sub-task record; The storage module is used to save the quality prompts in each of the subtask records in the form of structured entries, wherein the structured entries include at least the problem category, the target object, and explanatory information.

[0135] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A multi-dimensional automated quality inspection method for knowledge graphs, characterized in that, The method includes: Obtain the graph instance data of the target knowledge graph and the pattern definition bound to the target knowledge graph, and create a quality inspection task so that the quality inspection task records the correspondence between the target knowledge graph and the pattern definition; Under the quality inspection task, at least one quality inspection sub-process is executed, and the output of each quality inspection sub-process is saved as the corresponding sub-task record; The quality tips in each of the subtask records are saved in the form of structured entries, which include at least the problem category, the target object, and explanatory information.

2. The method according to claim 1, characterized in that, The quality inspection sub-process includes: The first sub-process for verifying the consistency between the map instance data and the pattern definition based on the shape constraint language; The second sub-process of performing reverse consistency verification on relation instances based on association rules obtained from the data mining of the graph instances; The third sub-process involves constructing a graph structure representation in memory and generating structure class quality hints based on the relation edge samples in the graph instance data. The fourth sub-process performs statistical analysis on the distribution of entity attributes and relationship types in the graph instance data and generates statistical quality prompts.

3. The method according to claim 2, characterized in that, The first sub-process includes: Map the entity attribute constraints and relation constraints in the pattern definition to shape constraints to generate a shape constraint diagram; Convert the map instance data into a data map; The data graph is validated by applying the shape constraint graph using a validation engine conforming to the W3C SHACL standard, and the structured entries are generated based on the validation report. Specifically: Let the transformed graph instance data be G_D=(V, E), where V is the set of entity nodes and E is the set of relation edges; for any edge e∈E, let s(e), t(e), and r(e) represent the source entity, target entity, and relation type, respectively; for any node v∈V, let P(v) represent its attribute set; Let G_S be the shape constraint graph obtained by mapping defined by the schema, which defines the set of focus nodes for the target. The constraints applied; for any focus f∈F, let C(f) be the set of constraint components acting on f; then the SHACL check statement is: determine whether each c∈C(f) holds true on G_D; A violation record is generated when there exists a focus f ∈ F and a constraint component c ∈ C(f) such that c does not satisfy G_D; let the set of violation records be R, then: ; Here, sh represents the trigger shape identifier, cc represents the trigger constraint component identifier, and the ellipsis represents the message text and severity level extensible field.

4. The method according to claim 2, characterized in that, The second sub-process includes: Fact triples are extracted from the graph instance data and organized into rule mining inputs; Configure support and confidence thresholds to mine implicit association rules; The association rules are pattern matched on the graph instance data. When the rule body matches but the conclusion relation is missing in the corresponding entity pair or conflicts with the conclusion relation, the structured entry used to indicate the suspicious relation instance is generated. The method for extracting fact triples from the graph instance data and organizing them into rule mining inputs includes: A rule obtained through rule mining adopts the Horn implication form, where the conjunction of several relation atoms in the rule body implies a conclusion relation atom, denoted as: ; in, H represents the i-th relation atom in the rule body, H is a single conclusion relation atom; m is a positive integer representing the number of atoms in the rule body; Methods for mining implicit association rules by configuring support and confidence thresholds include: Statistical measures such as support and confidence can be defined for rule R to filter rule size and reliability; let supp(body) be the support count or normalized support that the rule body can match on the fact set T, and let supp(R) be the support count or normalized support when both the rule body and the conclusion are true. Then the confidence level is expressed as: ; When supp(body) = 0, the rule is either not reverse-validated or discarded. The method for generating the structured entry indicating a suspicious relation instance by performing pattern matching on the association rules in the graph instance data, and generating the structured entry to indicate the suspicious relation instance when the rule body matches but the conclusion relation is missing in the corresponding entity pair or conflicts with the conclusion relation, includes: The graph instance data is still denoted as G_D = (V, E), where E is the set of relation edges. When performing reverse validation on rule R, if there exists a binding θ on G_D such that the rule body is true under θ, but the conclusion relation does not exist in E on the corresponding entity pair, or is true under θ along with a relation in the mutually exclusive relation set M, then a suspicious alert is generated. The mutually exclusive relation set M is given by business configuration or schema definition and is expressed as follows: ; Suspicious alerts should include at least the rule identifier, rule body binding information, the checked triple or relation instance, conflict type, and explanatory text; the field organization method is determined by the platform.

5. The method according to claim 2, characterized in that, The third sub-process includes at least one: Weakly connected component partitioning based on undirected graphs and outputting substructure hints that are separated from the main connected components; Calculate the in-degree, out-degree, and total degree of each node, and output the degree distribution statistics. Hub node prompts are determined based on degree distribution statistics, preset multiples, and minimum degree thresholds. Detection of chain-like and star-shaped structures; Detect repeating edges and self-looping edges; The ternary information consisting of the relation type, source entity type, and target entity type is compared with the relation constraints allowed by the schema definition, and an output prompt indicating inconsistency or mismatch in direction is given. Among them, the methods for partitioning weakly connected components based on undirected graphs and outputting substructure hints that are separated from the main connected components; and for calculating the in-degree, out-degree, and total degree of nodes and outputting degree distribution statistics include: Let the graph data induced by the sampled or fully acquired set of relation edges be G = (V, E), where V is the set of entity nodes and E is the set of relation edges; for any node v ∈ V, let d_in(v) and d_out(v) represent the in-degree and out-degree of v, respectively, and let d(v) represent the total degree of v, then: ; In memory, directed adjacency relationships are constructed for outgoing and incoming edge traversal, and undirected adjacency relationships are constructed for weak connectivity analysis: for any edge e∈E, if its source endpoint and target endpoint are different, an undirected connection is established between the source endpoint and the target endpoint in an undirected sense; the weakly connected components are partitioned into node sets on this undirected adjacency using a breadth-first search method to obtain the number of components, the maximum component size, and its proportion of |V|; Methods for determining hub node suggestions based on degree distribution statistics, preset multiples, and minimum degree thresholds include: The density definition of a directed simple graph is used to characterize the proportion of edges in all ordered node pairs, and the output is one of the graph structure summaries: ; Where |V|>1; when |V|≤1, density is not calculated or is left blank by convention. For hub node detection, let μ be the mean of the total degree of all nodes, σ be the overall standard deviation of the total degree, d_min be the preset minimum degree threshold, and k be the standard deviation factor. Then, the hub determination threshold τ is taken as: ; When d(v)≥τ, generate a hub node class prompt; Methods for detecting chain and star structures include: The chain structure identifies and expands the path by identifying the set of nodes that satisfy the condition that "both the in-degree and out-degree of the internal nodes are 1" and the directed adjacency connection relationship; when the length of the identified directed path node sequence is not less than the preset threshold L, the chain structure prompt is output. For a candidate center node v, let its undirected neighbor set be Γ(v); if |Γ(v)| is not lower than a preset threshold S, and the proportion of neighbor nodes u that satisfy d(u)=1 is not lower than a preset proportion α, that is: ; Then output a star-shaped structure hint; Methods for detecting repeating edges and self-loop edges include: For the same source endpoint s, target endpoint t, and relation type r, let the parallel edge count be n(s, t, r). If: ; The presence of parallel repeating edges is then indicated. For edge e, if: ; Then a hint indicating the presence of a self-loop edge is given. Methods for comparing the ternary information consisting of the relation type, source entity type, and target entity type with the relation constraints allowed by the schema definition, and outputting a prompt indicating inconsistency or mismatch in direction, include: For edge e, let r(e) be the relation type, l_s(e) and l_t(e) be the source and target entity types respectively, and let A be the set of triplets allowed by the schema; like And (r(e), l_t(e), l_s(e)) ∈ A, the output direction may be reversed (hint); if ,and Output may be mismatched with the pattern or out of sync.

6. The method according to claim 2, characterized in that, The fourth sub-process includes at least one: The missing rate of attributes is calculated based on entity type, and suggestions are generated accordingly; specifically, the missing rate of attribute p on type L is defined as: ; Where V_L is the set of sample nodes of type L, and n_L = |V_L|. For sample nodes of type L; When miss(L,p) is not lower than the preset missing rate threshold, an attribute integrity risk warning can be output. The system calculates the percentage of repeated values ​​or principal values ​​for statistical attributes and generates prompts accordingly. Specifically, for type L and attribute p, let the non-empty sample set be W_{L,p}, let N_nn = |W_{L,p}|, let U_{L,p} be the number of different values ​​in the non-empty value sequence, and let f_max be the number of times the most frequent value appears. Then, the percentage of repeated values ​​and the percentage of principal values ​​are defined as follows: ; ; When dup(L,p) or top(L,p) are not lower than the preset threshold, output a prompt indicating that the repeated values ​​are too high or the main values ​​are too concentrated. The function analyzes the rarity or skewness of the distribution of entity types or relation types and generates hints. Specifically, let the set of all sample nodes be V, |V|>0. For any entity type L, let n_L be the number of sample nodes of that type, and let n_max = max_Ln_L. Then the proportion of the dominant entity type is defined as: ; When s_ent is not lower than the preset dominant proportion threshold, a warning message indicating a severe skew in the distribution of entity types is output, and the same proportion definition is also used for the distribution of relation types. The system counts instances where the same attribute is used interchangeably with numeric and string types and generates a prompt. Specifically, for type L and attribute p, on non-empty samples, the number of numeric samples N_num and the number of string samples N_str are counted separately. When N_num + N_str is not lower than the minimum statistical threshold and both are positive, the minority type percentage is recorded as: ; When mix(L,p) is not lower than the preset mixing ratio threshold, the output type will be a mixed class prompt. For numerical attributes, fences are constructed based on interquartile ranges, and the outlier ratio is statistically analyzed. Specifically, for type L and numerical attribute p, let the sorted non-empty numerical samples be x_(1)≤…≤x_(N), and obtain the first quartile Q1 and the third quartile Q3 using the linear interpolation percentile method. If the preset multiplier is k, then the fence is defined as follows: ; This attribute can be skipped when IQR=0; let N_out be the number of samples falling outside the fence, then the outlier ratio is defined as: ; When N is not lower than the minimum numerical statistical threshold and N_out>0, output a numerical outlier class hint; The entity types declared in the pattern definition are compared with the entity types appearing in the sample, and a type hint is output for any types that do not appear. Specifically: Let the set of entity types declared in the pattern be T_S, and the set of entity types appearing in the sample be T_E. For any e, the following holds: ; The output mode declaration type is not overridden or no class hint appears in the sample.

7. The method according to claim 1, characterized in that, When saving the subtask record, a snapshot of the pattern update time and a snapshot of the map data update time are also saved. After the pattern definition is updated or the map instance data is updated, the quality prompts saved in the past are compared with the current update time information to determine whether they are invalid or need to be retested.

8. A multi-dimensional automated quality inspection system for knowledge graphs, the system being used to implement the method described in any one of claims 1-7, characterized in that, The system includes: a creation module, an execution module, and a saving module; The creation module is used to obtain graph instance data of the target knowledge graph and the pattern definition bound to the target knowledge graph, and to create a quality inspection task, so that the quality inspection task records the correspondence between the target knowledge graph and the pattern definition; The execution module is used to execute at least one quality inspection sub-process under the quality inspection task, and save the output results of each quality inspection sub-process as a corresponding sub-task record; The storage module is used to save the quality prompts in each of the subtask records in the form of structured entries. The structured entries include at least the problem category, the target object, and explanatory information.