Knowledge graph construction method and device, electronic equipment and readable storage medium
By generating configuration operation information through the display interface, constructing target graph templates and outputting knowledge graphs, the problem of traditional models being unable to manage temporal and spatial changes is solved, realizing personalized knowledge graph construction and display, and supporting natural resource management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-07
- Publication Date
- 2026-03-24
AI Technical Summary
Traditional natural resource data models cannot meet users' management requirements for temporal or spatial changes in knowledge graphs, and they ignore the correlation between natural resource elements in the data at different periods and business stages.
By obtaining configuration operation information, operations are performed based on the knowledge graph components displayed in the interface to generate a target graph template. The target knowledge graph is then constructed based on this template, and the final graph is output. Personalized configuration is achieved by combining the operator's management requirements.
It enables personalized construction and display of knowledge graphs, meets users' management needs for changes in time and space, and provides scientific evidence to support natural resource management and protection.
Smart Images

Figure CN117271801B_ABST
Abstract
Description
[0001] This application claims priority to a domestic application filed on June 12, 2023, with application number 202310693374.5, entitled "Method, Apparatus, Electronic Device and Readable Storage Medium for Constructing Knowledge Graphs", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of data processing, and more specifically, to a method, apparatus, electronic device, and readable storage medium for constructing a knowledge graph. Background Technology
[0003] Traditional natural resource data models are mainly based on GIS (Geographic Information System) modeling theory. They store data in databases in layers according to different types and express it in application systems by overlaying layers. This data modeling method ignores the relationship between natural resource elements in different periods and business stages in the data, and cannot meet users' management requirements for time or space changes in knowledge graphs. Summary of the Invention
[0004] In view of this, this application provides a method, apparatus, electronic device, and readable storage medium for constructing a knowledge graph, as follows:
[0005] A method for constructing a knowledge graph, comprising:
[0006] Obtain configuration operation information, which is generated by operations performed on the content displayed in the display interface, and the display content includes at least two constituent elements of the knowledge graph;
[0007] Based on the configuration operation information, target elements in the knowledge graph are configured to obtain a target graph template. The target elements include concepts, attributes, and / or relationships.
[0008] Construct a target knowledge graph based on the target graph template;
[0009] Output the target knowledge graph.
[0010] Optionally, in the above method, configuring the target elements in the knowledge graph based on the configuration operation information to obtain the target graph template includes:
[0011] Analyze the configuration operation information to obtain the corresponding target area in the display interface;
[0012] The constituent elements displayed in the target area are determined as the target elements of the target configuration;
[0013] Based on the target elements, a target map template is obtained.
[0014] Optionally, in the above method, outputting the target knowledge graph includes:
[0015] Receive display configuration information;
[0016] The target knowledge graph is processed based on the display configuration information to obtain target display content that meets preset display conditions;
[0017] Output the target display content.
[0018] Optionally, in the above method, the step of constructing the target knowledge graph based on the target graph template includes:
[0019] Based on the target elements in the target graph template, triplet data in the triplet relation database are filtered to obtain a triplet data set.
[0020] Construct a target knowledge graph based on the triplet dataset.
[0021] Optionally, the above methods also include:
[0022] Construct a ternary relation database, which contains at least two triplet data.
[0023] Optionally, the above method, wherein constructing the ternary relation database includes:
[0024] Obtain domain data;
[0025] A data model is constructed based on the data in the aforementioned domain;
[0026] Based on the data model, at least two triplet data are obtained by processing the data source data in the target domain.
[0027] A ternary relation database is obtained based on the combination of at least two triplet data.
[0028] Optionally, in the above method, constructing the target knowledge graph based on the triplet dataset includes:
[0029] Based on preset analysis rules, the triplet data set is analyzed to obtain entities, entity attributes, and relationships between entities;
[0030] Based on the entities, attributes, and relationships contained in the triplet data set, a target knowledge graph is constructed.
[0031] A knowledge graph construction apparatus, comprising:
[0032] The module is used to obtain configuration operation information, which is generated by operations performed on the content displayed in the display interface. The display content includes at least two components of the knowledge graph.
[0033] The configuration module is used to configure target elements in the knowledge graph based on the configuration operation information to obtain a target graph template. The target elements include concepts, attributes and / or relationships.
[0034] The construction module is used to construct a target knowledge graph based on the target knowledge graph template;
[0035] The output module is used to output the target knowledge graph.
[0036] An electronic device includes: a memory and a processor;
[0037] The memory stores the processing program;
[0038] The processor is used to load and execute the processing program stored in the memory to implement the steps of the knowledge graph construction method as described in any of the preceding claims.
[0039] A readable storage medium having a computer program stored thereon, the computer program being invoked and executed by a processor to implement the steps of the knowledge graph construction method as described in any of the preceding claims.
[0040] In summary, this application provides a method for constructing a knowledge graph, comprising: obtaining configuration operation information, wherein the configuration operation information is generated by operations performed on content displayed in a display interface, and the display content includes at least two constituent elements of a knowledge graph; configuring target elements in the knowledge graph based on the configuration operation information to obtain a target graph template, wherein the target elements include concepts, attributes, and / or relationships; constructing a target knowledge graph based on the target graph template; and outputting the target knowledge graph. In this embodiment, configuration operation information is generated based on the operator's operations on the constituent elements of the knowledge graph displayed in the display interface; target elements in the knowledge graph are configured based on the configuration operation information to obtain a target graph template; and a target knowledge graph is constructed and output based on the template. This configuration process is a visual operation performed by the operator, and the knowledge graph is set according to the operator's management requirements, thus meeting user needs. Attached Figure Description
[0041] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0042] Figure 1 This is a flowchart of an embodiment 1 of a knowledge graph construction method provided in this application;
[0043] Figure 2 This is a flowchart of Embodiment 2 of a knowledge graph construction method provided in this application;
[0044] Figure 3 This is a flowchart of embodiment 3 of a knowledge graph construction method provided in this application;
[0045] Figure 4 This is a flowchart of embodiment 4 of a knowledge graph construction method provided in this application;
[0046] Figure 5 This is a flowchart of embodiment 5 of a knowledge graph construction method provided in this application;
[0047] Figure 6 This is a flowchart of the knowledge graph construction process using existing technologies;
[0048] Figure 7 This is a flowchart of the knowledge graph construction process in Embodiment 5 of the knowledge graph construction method provided in this application;
[0049] Figure 8 This is a flowchart of embodiment 6 of a knowledge graph construction method provided in this application;
[0050] Figure 9 This is a schematic diagram of an embodiment of a knowledge graph construction device provided in this application. Detailed Implementation
[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0052] like Figure 1 The diagram shown is a flowchart of an embodiment 1 of a knowledge graph construction method provided in this application. The method is applied to an electronic device and includes the following steps:
[0053] Step S101: Obtain configuration operation information;
[0054] The configuration operation information is generated by operations performed on the content displayed in the display interface, and the display content includes at least two components of the knowledge graph.
[0055] This method is applied to an electronic device, which is a configuration terminal device for a knowledge graph. The electronic device has a display screen that displays a configuration interface, which contains various constituent elements that make up the knowledge graph.
[0056] The constituent elements include concepts, attributes, relationships, etc. This application does not limit the specific content of the constituent elements in the configuration interface.
[0057] In this context, a concept is the definition of the constituent elements in a knowledge graph, such as the concept of an entity or the concept of a relationship.
[0058] In this context, an entity is the subject representing the data.
[0059] Among them, an attribute is a value that represents the data.
[0060] Here, "relationship" refers to the relationships between data, including temporal relationships, spatial relationships, and business relationships. In this embodiment, relationships are configured based on configuration operation information.
[0061] The operator manipulates the various components displayed on the screen, such as selecting, dragging, and placing them.
[0062] After obtaining the configuration operation information, the configuration operation information is analyzed to obtain the target element of the operation.
[0063] Step S102: Configure the target elements in the knowledge graph based on the configuration operation information to obtain the target graph template;
[0064] The target elements include concepts, attributes, and / or relationships.
[0065] The target element that the operator wants to configure is determined based on this configuration operation information.
[0066] Accordingly, based on the configuration operation information, the target element is configured into the knowledge graph to obtain the target graph template.
[0067] Specifically, if the configuration operation information is configured for a concept, then the concept of an entity can be configured, such as concepts including: individual, department, etc.
[0068] The target map template is obtained based on the operator's configuration operations, and it represents the domain knowledge that the operator wants to understand.
[0069] Step S103: Construct a target knowledge graph based on the target knowledge graph template;
[0070] Specifically, a target knowledge graph is constructed based on the target graph template configured by the operator. The elements contained in this target knowledge graph are the content that the operator wants to know.
[0071] Specifically, based on the target knowledge graph template, the domain knowledge selected by the operator is processed to construct a target knowledge graph for that domain.
[0072] The process of constructing the target knowledge graph will be described in detail in subsequent embodiments, but will not be described in detail in this embodiment.
[0073] Step S104: Output the target knowledge graph.
[0074] Specifically, the target knowledge graph is output on the display screen of the electronic device.
[0075] Specifically, the output format can be selected based on the operator's actions. This process will be described in detail in subsequent embodiments, but will not be described in detail in this embodiment.
[0076] In summary, this embodiment provides a method for constructing a knowledge graph, comprising: obtaining configuration operation information, wherein the configuration operation information is generated by operations performed on content displayed in a display interface, and the display content includes at least two constituent elements of a knowledge graph; configuring target elements in the knowledge graph based on the configuration operation information to obtain a target graph template, wherein the target elements include concepts, attributes, and / or relationships; constructing a target knowledge graph based on the target graph template; and outputting the target knowledge graph. In this embodiment, configuration operation information is generated based on the operator's operations on the constituent elements of the knowledge graph displayed in the display interface; target elements in the knowledge graph are configured based on the configuration operation information to obtain a target graph template; and a target knowledge graph is constructed and output based on the template. This configuration process is a visual operation performed by the operator, and the knowledge graph is set according to the operator's management requirements, thus meeting user needs.
[0077] like Figure 2 The diagram shown is a flowchart of Embodiment 2 of a knowledge graph construction method provided in this application. The method includes the following steps:
[0078] Step S201: Obtain configuration operation information;
[0079] Step S201 is the same as the corresponding step in Example 1, and will not be described again in this example.
[0080] Step S202: Analyze the configuration operation information to obtain the corresponding target area in the display interface;
[0081] Specifically, the configuration operation information is analyzed to determine the target area corresponding to the operation in the display interface.
[0082] The configuration operation information can be generated based on a selection operation, such as a point selection operation, with the corresponding target area being a small, regular area, such as a circular area; or it can be generated based on a drag operation, with the corresponding target area being a long strip-shaped area, such as an arc-shaped area or a rectangular area.
[0083] Specifically, the configuration operation information also includes configuration information input by the operator through the input device, such as the selected conceptual elements being individual, department, and company.
[0084] Therefore, the target area corresponding to the configuration operation information can be one or more areas in the display interface. These multiple areas may overlap or not. This application does not limit the specific shape of the target area.
[0085] In this embodiment, the component elements are presented graphically in the display interface, which facilitates the operator to configure the map in a graphical manner.
[0086] Step S203: Determine the constituent elements displayed in the target area as the target elements of the target configuration;
[0087] The display interface shows multiple components that can form a knowledge graph.
[0088] Since the target area includes the area where the displayed constituent elements are located, it can be determined that the configuration operation is to configure the elements in the target area.
[0089] The target area can contain multiple sub-areas, and each sub-area displays one or more constituent elements.
[0090] Specifically, one or more constituent elements displayed in the target area are identified as target elements in the target configuration.
[0091] Step S204: Based on the target elements, obtain the target map template;
[0092] The target map template is composed of target elements selected by the operator.
[0093] When the target element includes a concept, the concept of the target element is defined based on the concept-related information input by the operator; when the target element includes an attribute, the attribute of the target element is defined based on the attribute-related information input by the operator; when the target element includes a relation, the relation of the target element is defined based on the relation-related information input by the operator.
[0094] Specifically, based on the target element selected by the operator and the input definition information, the target element is defined to obtain the target map template.
[0095] The target graph template is a graph that represents the operator's needs. Subsequently, based on the target graph template, the domain data is processed to obtain the graph of the content / form required by the operator.
[0096] Step S205: Construct a target knowledge graph based on the target knowledge graph template;
[0097] Step S206: Output the target knowledge graph.
[0098] Steps S205-206 are consistent with the corresponding steps in Example 1, and will not be repeated in this example.
[0099] In summary, this embodiment provides a method for constructing a knowledge graph, comprising: analyzing the configuration operation information to obtain the corresponding target area in the display interface; determining the constituent elements displayed in the target area as target elements of the target configuration; and obtaining a target graph template based on the target elements. In this embodiment, the operator configures the graph based on the graphics displayed in the display interface, determines the target element selected by the operator in the display interface according to the operator's operation information, obtains a target graph template that meets the operator's needs based on the target element, and configures the target graph template according to the operator's needs to achieve personalized construction of the knowledge graph.
[0100] like Figure 3 The flowchart shown is a third embodiment of a knowledge graph construction method provided in this application. The method includes the following steps:
[0101] Step S301: Obtain configuration operation information;
[0102] Step S302: Configure the target elements in the knowledge graph based on the configuration operation information to obtain the target graph template;
[0103] Step S303: Construct a target knowledge graph based on the target knowledge graph template;
[0104] Steps S301-303 are consistent with the corresponding steps in Example 1, and will not be repeated in this example.
[0105] Step S304: Receive display configuration information;
[0106] Among them, the display configuration information is the configuration information related to the display of the target knowledge graph that the operator inputs based on the input device.
[0107] Specifically, this display configuration information refers to the display-related configuration information when visually presenting the target knowledge graph.
[0108] For example, the display configuration information includes: calling map, chart information, etc.
[0109] It should be noted that the execution order of step S304 and the aforementioned steps S301-303 is not limited to the order shown in this embodiment, and the two can be executed in any order.
[0110] Step S305: Process the target knowledge graph based on the display configuration information to obtain target display content that meets preset display conditions;
[0111] Specifically, the target knowledge graph is processed based on the display configuration information to obtain the target display content corresponding to the display configuration information.
[0112] The target knowledge graph includes various entities, attributes, and relationships between entities.
[0113] This relationship can include spatiotemporal relationships, business relationships, etc.
[0114] For example, if the target knowledge graph is forest resources, the display configuration information includes calling a map. Accordingly, the target knowledge graph is processed based on the map, and the target knowledge graph is combined with the map to obtain a knowledge graph displayed in map form, which intuitively presents the distribution of forest resources in different times and spaces.
[0115] Step S306: Output the target display content.
[0116] Specifically, the target content is output on the display screen to visualize the knowledge graph.
[0117] For example, a knowledge graph in the form of a map can be output on the display screen to show the distribution of forest resources in different times and spaces, providing a scientific basis for subsequent natural resource management and protection.
[0118] In summary, this embodiment provides a method for constructing a knowledge graph, including: receiving display configuration information; processing the target knowledge graph based on the display configuration information to obtain target display content that meets preset display conditions; and outputting the target display content. In this embodiment, the display can also be configured, the target knowledge graph can be processed based on the display configuration information to obtain target display content that meets preset display conditions and output it, and the display mode can be set according to the operator's display needs to achieve personalized display of the knowledge graph.
[0119] like Figure 4 The flowchart shown is a fourth embodiment of a knowledge graph construction method provided in this application. The method includes the following steps:
[0120] Step S401: Obtain configuration operation information;
[0121] Step S402: Configure the target elements in the knowledge graph based on the configuration operation information to obtain the target graph template;
[0122] Steps S401-402 are consistent with the corresponding steps in Example 1, and will not be repeated in this example.
[0123] Step S403: Based on the target elements in the target graph template, filter the triplet data in the triplet relation database to obtain a triplet data set;
[0124] In this process, a ternary relation database is pre-generated, which contains several triplet data.
[0125] In this context, the triplet data refers to a data model in which each entity has a corresponding attribute value, and these attribute values form a triplet data structure.
[0126] Specifically, triplet data contains the following three elements: Entity Identifier, Entity Property Value, and Property Identifier.
[0127] Among them, the entity identifier is used to uniquely identify an entity, the entity attribute value is used to represent the attribute value of the entity, and the attribute identifier is used to uniquely identify an attribute.
[0128] For example, in the field of natural resources, triplet data can be used to represent different types of natural resources, such as land, water, atmosphere, and organisms. Each natural resource entity has a corresponding attribute value, and these attribute values form a triplet data structure. For example, for a land entity, its attribute values may include geographical location, area, and quality.
[0129] Specifically, based on the target elements contained in the target graph template, the data is filtered in the ternary relation database to select the triplet data corresponding to the target elements. The multiple triplet data obtained by this filtering are used to obtain a triplet data set.
[0130] Step S404: Construct the target knowledge graph based on the triplet dataset;
[0131] Specifically, the triplet data in the selected triplet dataset is analyzed to obtain the relationships between entities and the relationships between attribute values. Based on each entity, attribute value, entity relationship, and attribute relationship, a target knowledge graph is constructed.
[0132] The data used to construct the target knowledge graph is a set of triplet data obtained by filtering triplet data from triplet relation data based on the target graph template. The target graph template is generated based on the configuration operation information input by the operator. Therefore, the content contained in the constructed target knowledge graph is constructed based on the operator's configuration requirements and is a knowledge graph that reflects the content / form required by the operator.
[0133] Step S405: Output the target knowledge graph.
[0134] Step S405 is the same as the corresponding step in Example 1, and will not be described again in this example.
[0135] In summary, this embodiment provides a method for constructing a knowledge graph, comprising: filtering triplet data in a ternary relation database based on target elements in the target graph template to obtain a triplet data set; and constructing a target knowledge graph based on the triplet data set. In this embodiment, the target elements in the constructed target graph template are filtered through the ternary relation database based on configuration information input by the operator to obtain a triplet data set. The target knowledge graph is constructed based on the triplet data in this triplet data set. The content contained in the constructed target knowledge graph is constructed based on the operator's configuration requirements and reflects the content / form required by the operator, thus realizing personalized configuration of the target knowledge graph.
[0136] like Figure 5 The flowchart shown is a fifth embodiment of a knowledge graph construction method provided in this application. The method includes the following steps:
[0137] Step S501: Construct a ternary relation database;
[0138] The ternary relation database contains at least two triplet data.
[0139] Among them, a ternary relation database is pre-built to provide triplet data for the subsequent construction of the target knowledge graph.
[0140] This embodiment explains in detail the process of constructing a ternary relation database. Step S501 includes:
[0141] Step S5011: Obtain domain data;
[0142] This domain data includes data about the domain to which each entity in the ternary relation database belongs.
[0143] For example, the data in this field could be in the fields of natural resources, automobiles, automatic control, etc. This application does not limit the specific field of the data.
[0144] Specifically, data in this field is categorized into structured data, semi-structured data, and unstructured data based on the type of data source.
[0145] Structured data consists of ordered rows and columns, where each row represents a data element and each column represents an attribute; semi-structured data typically contains text or other unstructured data types, such as images, audio, or video; and unstructured data typically contains large amounts of text and other types of data, such as web pages, documents, and social media posts.
[0146] Step S5012: Construct a data model based on the domain data;
[0147] This involves extracting information from domain data and then constructing a data model based on the extracted information.
[0148] In practice, semi-structured data typically requires preprocessing to extract attributes and relationships. Attribute extraction usually involves extracting keywords, key terms, and other features from text or other data types. Relationship extraction typically involves extracting relationships between entities from text or other data types. When processing semi-structured data, natural language processing (NLP) and other data processing techniques are usually required to process and analyze the data.
[0149] In practice, unstructured data typically requires data cleaning, preprocessing, and word segmentation to extract attributes and relationships. Attribute extraction usually involves extracting keywords and other features from the text. Relationship extraction typically involves extracting relationships between entities from the text. Natural language processing and other data processing techniques are generally required to process and analyze unstructured data.
[0150] In the process of building a data model, we usually extract information related to the target domain from various types of data sources and transform it into elements such as entities, attributes, entity attribute values, and relationships between entities in the data model.
[0151] Specifically, data models for domain data can be constructed in the following ways: Based on natural language processing (NLP) technology: extracting information related to the target domain from text data using NLP technology and transforming it into entities, attributes, and other elements in the data model; Based on data mining technology: extracting information related to the target domain from large-scale datasets using data mining technology and transforming it into entities, attributes, relationships, and other elements in the data model; Based on domain expert knowledge: transforming the knowledge and experience of domain experts into entities, attributes, relationships, and other elements in the data model.
[0152] It should be noted that in the process of building a data model, it is necessary to determine the various components of the data model and the relationships between them based on the extracted information and the knowledge of domain experts, combined with existing data modeling techniques and knowledge graph techniques.
[0153] When multiple data sources exist, it is necessary to integrate the data from these multiple data sources.
[0154] The methods for integrating knowledge include the following: knowledge extraction, knowledge fusion, and knowledge processing.
[0155] Specifically, information extraction involves extracting entities (concepts), attributes, and relationships between entities from various types of data sources, forming an ontological knowledge representation. Data fusion, after acquiring new knowledge, requires integration to eliminate contradictions and ambiguities; for example, some entities may have multiple expressions, and a specific term may correspond to multiple different entities. Knowledge processing involves quality assessment of the integrated new knowledge before adding qualified portions to the knowledge base to ensure its quality. After adding new data, knowledge reasoning can be performed to expand existing knowledge and obtain new knowledge.
[0156] In practice, new knowledge that has been integrated needs to undergo quality assessment before qualified parts can be added to the knowledge base to ensure its quality. After adding new data, knowledge reasoning can be performed to expand existing knowledge and obtain new knowledge.
[0157] Step S5013: Process the data source data of the target domain according to the data model to obtain at least two triplet data;
[0158] After constructing the data model, the data model processes the data source data in the target domain to obtain multiple triplet data.
[0159] The triplet data is in the form of a triplet provided by the data source in the target domain.
[0160] Step S5014: Obtain a ternary relation database based on the combination of the at least two triplet data.
[0161] The resulting triplet data is then combined to form a ternary relation database.
[0162] In subsequent steps, a target knowledge graph will be constructed based on the triplet data in the ternary relation database.
[0163] Figure 6The diagram shows an existing knowledge graph construction flowchart, including: a data source, which includes structured, semi-structured, and unstructured data; information extraction of the semi-structured and unstructured data to obtain extracted data; knowledge fusion of the structured data and the extracted data; and finally, knowledge processing to obtain the knowledge graph. Information extraction includes attribute extraction, relation extraction, and entity extraction. Knowledge fusion includes knowledge fusion of structured data, followed by coreference resolution and entity resolution of the extracted data. Knowledge processing includes ontology extraction of the data after coreference resolution and entity resolution, followed by knowledge reasoning, quality assessment, and ontology extraction to obtain the knowledge graph. Finally, knowledge fusion is performed between the data in the ternary relation knowledge base and the structured data.
[0164] Figure 7 The diagram shown is a flowchart of the knowledge graph construction process in this scheme, including the data source, which includes structured data, semi-structured data and unstructured data. The semi-structured data and unstructured data are processed through an information extraction process to obtain extracted data. The structured data and the extracted data are processed through a knowledge fusion process. The resulting data enters the knowledge processing process to obtain a ternary relation database. The target knowledge graph is constructed based on the results of filtering the ternary relation database according to the configuration operation information.
[0165] Step S502: Obtain configuration operation information;
[0166] Step S503: Configure the target elements in the knowledge graph based on the configuration operation information to obtain the target graph template;
[0167] Step S504: Based on the target elements in the target graph template, filter the triplet data in the triplet relation database to obtain a triplet data set;
[0168] Step S505: Construct the target knowledge graph based on the triplet dataset;
[0169] Step S506: Output the target knowledge graph.
[0170] Steps S502-506 are the same as the corresponding steps in Example 1, and will not be repeated in this example.
[0171] In summary, the knowledge graph construction method provided in this embodiment further includes: constructing a ternary relation database, wherein the ternary relation database contains at least two triplet data. In this embodiment, the ternary relation database is constructed in advance to provide a foundation for subsequent filtering of triplet data based on target elements in the target graph template.
[0172] like Figure 8The flowchart shown is a 6th embodiment of a knowledge graph construction method provided in this application. The method includes the following steps:
[0173] Step S801: Obtain configuration operation information;
[0174] Step S802: Configure the target elements in the knowledge graph based on the configuration operation information to obtain the target graph template;
[0175] Step S803: Based on the target elements in the target graph template, filter the triplet data in the triplet relation database to obtain a triplet data set;
[0176] Steps S801-802 are consistent with the corresponding steps in Example 4, and will not be repeated in this example.
[0177] Step S804: Based on preset analysis rules, analyze the triplet data set to obtain entities, attributes, and relationships;
[0178] Among them, there are preset analysis rules, which analyze triple data to determine the entities it contains, the attributes of the entities, and the relationships between the entities.
[0179] The entity, its attributes, and the relationships between entities are information used to generate the target knowledge graph.
[0180] Specifically, the data set is obtained by processing data in the field of natural resources to obtain triplet data in a ternary relation database and then filtering the triplet data.
[0181] Correspondingly, in the process of constructing a spatiotemporal knowledge graph of natural resources, the analysis rules can employ spatiotemporal correlation analysis algorithms and business correlation analysis algorithms to obtain spatiotemporal change information of natural resources and business application relationships.
[0182] Spatiotemporal correlation analysis algorithms refer to the methods used to analyze natural resource data in the field of natural resources, thereby obtaining information on the distribution of natural resources in different times and spaces, as well as the correlations between them. Common spatiotemporal correlation analysis algorithms include time series analysis algorithms, spatial statistical analysis algorithms, and spatiotemporal correlation analysis algorithms.
[0183] Specifically, time series analysis algorithms analyze natural resource data over time to obtain information such as periodicity and trends, thereby predicting future trends and changes; spatial statistical analysis algorithms analyze natural resource data spatially to obtain information such as distribution characteristics and spatial relationships, thereby enabling spatial data visualization and analysis; and spatiotemporal correlation analysis algorithms analyze natural resource data spatiotemporally to obtain information such as correlation and synergy among them, thereby enabling spatiotemporal prediction and analysis of natural resources.
[0184] Among them, business association analysis algorithms refer to the analysis of business application relationships in the natural resources field to obtain these relationships and their impact on natural resources. Business association analysis algorithms include: association rule mining algorithms, business model modeling algorithms, etc.
[0185] Specifically, association rule mining algorithms extract information such as correlation and synergy between natural resource data by performing association rule mining on the data, thereby enabling association prediction and analysis of natural resources; business modeling algorithms model the business application relationships between natural resource data to obtain these relationships, thereby enabling business prediction and analysis of natural resources.
[0186] It should be noted that by employing spatiotemporal correlation analysis algorithms and business correlation analysis algorithms, we can obtain spatiotemporal change information of natural resources and business application relationships, and integrate this information into the spatiotemporal knowledge graph of natural resources to facilitate intelligent management and decision-making of natural resources.
[0187] Step S805: Construct the target knowledge graph based on the entities, attributes, and relationships contained in the triplet data set;
[0188] Here, the attribute is an attribute of an entity, and the relationship is the relationship between entities.
[0189] Specifically, the relationships between these entities include: temporal relationships, spatial relationships, and business relationships.
[0190] Specifically, a target knowledge graph is constructed based on the entities, entity attributes, and relationships between entities contained in the triplet data set obtained from the analysis.
[0191] The target knowledge graph contains the data knowledge in the triplet dataset, which is obtained by filtering based on the target graph template configured by the operator. Therefore, the target knowledge graph constructed based on the data contained in the triplet dataset is adapted to the user's needs.
[0192] Step S806: Output the target knowledge graph.
[0193] Step S806 is the same as the corresponding step in Example 4, and will not be described again in this example.
[0194] In summary, this embodiment provides a method for constructing a knowledge graph, comprising: analyzing the triplet data set based on preset analysis rules to obtain entities, attributes, and relationships; and constructing a target knowledge graph based on the entities, attributes, and relationships contained in the triplet data set. In this embodiment, the target knowledge graph is constructed by analyzing the filtered triplet data set based on preset analysis rules and obtaining the entities, attributes, and relationships. This triplet data set is filtered based on a target graph template configured by the operator. Therefore, the target knowledge graph constructed based on the data contained in this triplet data set is adapted to the user's needs, realizing personalized settings for the knowledge graph.
[0195] Corresponding to the above embodiment of a knowledge graph construction method provided in this application, this application also provides an embodiment of an apparatus for applying the knowledge graph construction method.
[0196] like Figure 9 The diagram shown is a structural schematic of an embodiment of a knowledge graph construction device provided in this application. The electronic device includes the following structure: an acquisition module 901, a configuration module 902, a construction module 903, and an output module 904.
[0197] The obtaining module 901 is used to obtain configuration operation information, which is generated by the operation performed on the content displayed in the display interface, and the display content includes at least two components of the knowledge graph.
[0198] The configuration module 902 is used to configure target elements in the knowledge graph based on the configuration operation information to obtain a target graph template. The target elements include concepts, attributes and / or relationships.
[0199] The construction module 903 is used to construct a target knowledge graph based on the target graph template.
[0200] The output module 904 is used to output the target knowledge graph.
[0201] Optional configuration modules include:
[0202] The analysis unit is used to analyze the configuration operation information to obtain the corresponding target area in the display interface;
[0203] A determining unit is used to determine the constituent elements displayed in the target area as target elements of the target configuration;
[0204] The obtaining unit is used to obtain the target map template based on the target element.
[0205] Optional output modules include:
[0206] The receiving unit is used to receive display configuration information;
[0207] The processing unit is used to process the target knowledge graph based on the display configuration information to obtain target display content that meets preset display conditions;
[0208] The output unit is used to output the target display content.
[0209] Optional building blocks include:
[0210] The filtering unit is used to filter triplet data in the triplet relation database based on the target elements in the target map template to obtain a triplet data set.
[0211] The first construction unit is used to construct the target knowledge graph based on the triplet data set.
[0212] Optional, also includes:
[0213] The second construction unit is used to construct a ternary relation database, which contains at least two triplet data.
[0214] Optional, the second building block, specifically used for:
[0215] Obtain domain data;
[0216] A data model is constructed based on the data in the aforementioned domain;
[0217] Based on the data model, at least two triplet data are obtained by processing the data source data in the target domain.
[0218] A ternary relation database is obtained based on the combination of at least two triplet data.
[0219] Optional, the first building unit is specifically used for:
[0220] Based on preset analysis rules, the triplet data set is analyzed to obtain entities, entity attributes, and relationships between entities;
[0221] Based on the entities, attributes, and relationships contained in the triplet data set, a target knowledge graph is constructed.
[0222] It should be noted that the explanation of the various structural functions in the knowledge graph construction device provided in this embodiment is the same as that in the foregoing method embodiments, and will not be repeated in this embodiment.
[0223] In summary, the knowledge graph construction device provided in this embodiment generates configuration operation information based on the operator's operations on the constituent elements of the knowledge graph displayed on the interface, configures the target elements in the knowledge graph based on the configuration operation information to obtain a target graph template, constructs the target knowledge graph based on the template graph template and outputs it. This configuration process is a visual operation performed by the operator, and the knowledge graph is set according to the operator's management requirements, which meets the user's needs.
[0224] Corresponding to the above embodiment of the knowledge graph construction method provided in this application, this application also provides an electronic device and a readable storage medium corresponding to the knowledge graph construction method.
[0225] The electronic device includes: a memory and a processor;
[0226] The memory stores the processing program;
[0227] The processor is used to load and execute the processing program stored in the memory to implement the steps of the knowledge graph construction method as described in any of the preceding claims.
[0228] For details on the specific method for constructing the knowledge graph for this electronic device, please refer to the aforementioned examples of knowledge graph construction methods.
[0229] The readable storage medium stores a computer program that is invoked and executed by a processor to implement the steps of the knowledge graph construction method as described in any of the preceding claims.
[0230] For details on the specific implementation of the knowledge graph construction method by the computer program stored in the readable storage medium, please refer to the aforementioned embodiments of the knowledge graph construction method.
[0231] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. The apparatus provided in the embodiments is described simply because it corresponds to the method provided in the embodiments; relevant parts can be found in the method section.
[0232] The above description of the provided embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features provided herein.
Claims
1. A method for constructing a knowledge graph, characterized in that, include: Obtain configuration operation information, which is generated by operations performed on the content displayed in the display interface, and the display content includes at least two constituent elements of the knowledge graph; Analyze the configuration operation information to obtain the corresponding target area in the display interface; determine the constituent elements displayed in the target area as the target elements of the target configuration; Based on the target elements, a target graph template is obtained. The target graph template is used to characterize the operator's needs. The target elements include concepts, attributes, and / or relationships. Based on the target elements contained in the target graph template, the triplet data corresponding to the target elements are filtered in the triplet relation database to obtain the triplet data set. Construct a target knowledge graph based on the triplet dataset; The system receives display configuration information, which is configuration information related to the display of the target knowledge graph input by the operator based on the input device. The display configuration information is display-related configuration information when visually displaying the target knowledge graph, and the display configuration information represents the operator's display requirements. Based on the display configuration information, the system processes the target knowledge graph to obtain target display content that meets preset display conditions. Output the target display content.
2. The method according to claim 1, characterized in that, Also includes: Construct a ternary relation database, which contains at least two triplet data.
3. The method according to claim 2, characterized in that, The construction of the ternary relation database includes: Obtain domain data; A data model is constructed based on the data in the aforementioned domain; Based on the data model, at least two triplet data are obtained by processing the data source data in the target domain. A ternary relation database is obtained based on the combination of at least two triplet data.
4. The method according to claim 1, characterized in that, The construction of the target knowledge graph based on the triplet dataset includes: Based on preset analysis rules, the triplet data set is analyzed to obtain entities, entity attributes, and relationships between entities; Based on the entities, attributes, and relationships contained in the triplet data set, a target knowledge graph is constructed.
5. A knowledge graph construction apparatus, characterized in that, include: The module is used to obtain configuration operation information, which is generated by operations performed on the content displayed in the display interface. The display content includes at least two components of the knowledge graph. The configuration module is used to analyze the configuration operation information to obtain the corresponding target area in the display interface; and to determine the constituent elements displayed in the target area as the target elements of the target configuration. Based on the target elements, a target graph template is obtained. The target graph template is used to characterize the operator's needs. The target elements include concepts, attributes, and / or relationships. The construction module is used to filter the triplet data corresponding to the target elements contained in the target map template in the triplet relation database to obtain a triplet data set. Construct a target knowledge graph based on the triplet dataset; The output module is used to receive display configuration information, which is configuration information related to the display of the target knowledge graph input by the operator based on the input device. The display configuration information is display-related configuration information when visually displaying the target knowledge graph, and the display configuration information represents the operator's display requirements. Based on the display configuration information, the target knowledge graph is processed to obtain target display content that meets preset display conditions. Output the target display content.
6. An electronic device, characterized in that, include: Memory, processor; The memory stores the processing program; The processor is used to load and execute the processing program stored in the memory to implement the steps of the knowledge graph construction method as described in any one of claims 1-4.
7. A readable storage medium, characterized in that, It stores a computer program, which is called and executed by a processor to implement the steps of the knowledge graph construction method as described in any one of claims 1-4.
Citation Information
Patent Citations
Linear cultural heritage knowledge graph construction method and system, computing device and medium
CN112527915A
Knowledge graph generation tool with user-defined configuration
CN112559704A
Knowledge graph construction method and device
CN112579787A
Natural resource knowledge graph construction method and device, server and readable memory
CN112612908A
Knowledge graph construction method, tool, device and server
CN113157947A