CN113111135A - Knowledge graph construction method and device - Google Patents

Knowledge graph construction method and device Download PDF

Info

Publication number
CN113111135A
CN113111135A CN202110438576.6A CN202110438576A CN113111135A CN 113111135 A CN113111135 A CN 113111135A CN 202110438576 A CN202110438576 A CN 202110438576A CN 113111135 A CN113111135 A CN 113111135A
Authority
CN
China
Prior art keywords
information
knowledge
graph
category information
map
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110438576.6A
Other languages
Chinese (zh)
Inventor
樊骏锋
李长亮
毛璐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Software Co Ltd
Beijing Kingsoft Digital Entertainment Co Ltd
Original Assignee
Beijing Kingsoft Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Software Co Ltd filed Critical Beijing Kingsoft Software Co Ltd
Priority to CN202110438576.6A priority Critical patent/CN113111135A/en
Publication of CN113111135A publication Critical patent/CN113111135A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/288Entity relationship models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/26Visual data mining; Browsing structured data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/285Clustering or classification

Abstract

The application provides a knowledge graph construction method and a knowledge graph construction device, wherein the method comprises the following steps: creating an interactive control corresponding to the map editor, and receiving map editing information through the interactive control; converting the map editing information into structured data corresponding to the current database architecture through the map editor; and generating a knowledge graph corresponding to the graph editing information based on the structured data.

Description

Knowledge graph construction method and device
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a method and an apparatus for constructing a knowledge graph, a computing device, and a computer-readable storage medium.
Background
Database Schema (Schema) is a common criterion for graph construction and application adherence as a representation that specifies the structure and data types of a knowledge graph throughout the lifetime of the knowledge graph. The existing database architecture (Schema) representation method comprises the following steps: a triple representation method, a graph representation method, a tree diagram framework, and the like. Meanwhile, most of the existing manually designed database architectures (schemas) use a text or code editor for manual input, and in the existing knowledge graph database architecture (Schema) representation method, the triple method needs to respectively express the relationships among nodes and the relationships between nodes and attributes, which causes the problems of complexity and inconvenience in processing; the graph representation method can visually represent the graph structure, but cannot be conveniently used by other application terminals to effectively obtain database information; the dendrogram framework method is represented by a multi-level graph structure, but cannot provide an effective representation method for the attributes of nodes and relations and data structures and other constraints.
The process of constructing the map database architecture by using the method mainly uses an editor to perform manual input, but the existing editor has the problems of untight expression, large error hidden danger, low editing and modifying efficiency and the like.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for constructing a knowledge graph, a computing device, and a computer-readable storage medium, so as to solve technical defects in the prior art.
According to a first aspect of embodiments of the present specification, there is provided a knowledge-graph construction method, including:
creating an interactive control corresponding to the map editor, and receiving map editing information through the interactive control;
converting the map editing information into structured data corresponding to the current database architecture through the map editor;
and generating a knowledge graph corresponding to the graph editing information based on the structured data.
Optionally, creating an interactive control corresponding to the graph editor, and receiving graph editing information through the interactive control, where the interactive control includes:
creating an interactive control corresponding to first category information and second category information required by the map editor for map generation, and embedding the interactive control into the map editor;
receiving the first category information and/or the second category information through the interactive control, and transmitting the first category information and/or the second category information into the atlas editor in a character string mode.
Optionally, converting, by the graph editor, the graph editing information into structured data corresponding to a current database architecture, including:
converting the first category information into structured data of a fixed data structure corresponding to the current database architecture; and/or
Converting the second category information into structured data of an extended data structure corresponding to the current database architecture;
wherein the extended data structure is embedded in the fixed data structure.
Optionally, the method further comprises:
setting corresponding basic constraint conditions for each node category information and the relation category information;
and verifying the first category information and the second category information according to the basic constraint condition, and reporting errors under the condition that the verification is not passed.
Optionally, generating a knowledge graph corresponding to the graph editing information based on the structured data includes:
constructing a plurality of knowledge triples according to the structured data of the fixed data structure corresponding to the current database architecture, and adding corresponding attributes to the nodes and the relations in the knowledge graph triples;
constructing auxiliary description information corresponding to each knowledge triple in the plurality of knowledge triples according to the structured data of the extended data structure corresponding to the current database architecture;
and performing modeling representation on the multiple knowledge triples and the auxiliary description information corresponding to each knowledge triplet to form a knowledge graph structure.
According to a second aspect of embodiments herein, there is provided a knowledge-graph constructing apparatus including:
the interactive control module is configured to create an interactive control corresponding to the map editor and receive map editing information through the interactive control;
an editor module configured to convert, by the graph editor, the graph editing information into structured data corresponding to a current database architecture;
the map building module is configured to generate a knowledge map corresponding to the map editing information based on the structured data.
Optionally, the interaction control module includes:
the control creating unit is configured to create an interactive control corresponding to first category information and second category information required by the atlas editor for atlas generation, and embed the interactive control into the atlas editor;
the information receiving unit is configured to receive the first category information and/or the second category information through the interaction control, and transmit the first category information and/or the second category information to the map editor in a character string mode.
Optionally, the editor module comprises:
the first information representation unit is configured to convert the first category information into structured data of a fixed data structure corresponding to the current database architecture; and/or
The second information representation unit is configured to convert the second type information into structured data of an extended data structure corresponding to the current database architecture;
wherein the extended data structure is embedded in the fixed data structure.
Optionally, the system further comprises a correction checking module configured to:
setting corresponding basic constraint conditions for each node category information and the relation category information;
and verifying the first category information and the second category information according to the basic constraint condition, and reporting errors under the condition that the verification is not passed.
Optionally, the map building module comprises:
the triple construction unit is configured to construct a plurality of knowledge triples according to the structured data of the fixed data structure corresponding to the current database architecture, and add corresponding attributes to the nodes and the relations in the knowledge graph triples;
the auxiliary configuration unit is configured to construct auxiliary description information corresponding to each knowledge triple in the multiple knowledge triples according to the structured data of the extended data structure corresponding to the current database architecture;
the map display unit is configured to perform modeling representation on the multiple knowledge triples and the auxiliary description information corresponding to each knowledge triplet to form a knowledge map structure.
According to a third aspect of embodiments herein, there is provided a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the method of knowledge-graph construction when executing the instructions.
According to a fourth aspect of embodiments herein, there is provided a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the method of knowledge-graph construction.
The knowledge graph is constructed based on the database framework, the construction process of the database framework is the construction process of the graph structure, the database framework is expressed by adopting a hierarchical structure, and the database framework can be guaranteed to have a stable structure, so that the whole construction process of the knowledge graph can be conveniently and quickly obtained to obtain the structural information in the relational database. Meanwhile, enough extended data structures are reserved in the database architecture of the application, a free setting space under a fixed data structure is formed, and the requirement of specific class information on the design of the database architecture can be met.
In addition, the map editor can provide an efficient and convenient construction mode according to the requirement of database architecture design, and a user can ensure that correct and standard map editing information is provided for map construction and use only through click and simple input.
Drawings
FIG. 1 is a block diagram of a computing device provided by an embodiment of the present application;
FIG. 2 is a flow chart of a first method of knowledge-graph construction provided by an embodiment of the present application;
FIG. 3 is an interaction diagram of the knowledge graph construction method applied to an artificial intelligence system according to the embodiment of the present application;
FIG. 4 is a flow chart of a second method of knowledge-graph construction provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of a knowledge graph construction method provided by an embodiment of the application;
FIG. 6 is a flow chart of a third method of knowledge-graph construction provided by an embodiment of the present application;
FIG. 7 is a flow chart of a fourth method of knowledge-graph construction provided by an embodiment of the present application;
FIG. 8 is a flow chart of a fifth method of knowledge-graph construction provided by an embodiment of the present application;
FIG. 9 is a flow chart of a sixth method for knowledge graph construction provided in embodiments of the present application;
fig. 10 is a schematic structural diagram of a knowledge graph constructing apparatus provided in an embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description.
First, the noun terms to which one or more embodiments of the present invention relate are explained.
Knowledge graph: knowledge map (KG) is a semantic network, which is intended to describe concept entities in the objective world and their relationships, and is a structured semantic Knowledge Base (kgbase) for describing concepts in the physical world and their relationships in a symbolic form, and its basic constituent units are triples, and entities and their related attributes and attribute values, which are connected with each other through relationships to form a mesh Knowledge structure.
Triplet: a representation of a knowledge graph, in common forms including (entity 1, relationship, entity 2) or (entity, attribute value) and (relationship, relationship attribute value), etc. (Yaoming, efficacy in NBA), (Yaoming, height, 2.29m) and (efficacy in, availability, no)
Entity: an Entity (Entity) is a Node in the knowledge graph, and the Entity is a basic unit of the knowledge graph and also an important language unit for bearing information in a text; generally refers to entities having a specific meaning or strong designation in the text, and generally includes names of people, places, organizations, dates and times, proper nouns, and the like.
The attributes are as follows: property is an inherent Property of an entity or relationship, such as twenty-four for Zhang three, where "age" is an attribute.
The relationship is as follows: relationships (relationships) are used to describe relationships between ontologies (classes, concepts), i.e., a relationship is an abstraction of an entity-to-entity relationship, being some kind of relationship between two or more entities; for example, the father of Zhang three is Zhang two, wherein the "father" is the relationship.
A database architecture: the database Schema (Schema) is a representation that specifies the structure and data types of a knowledge graph, which defines the data model of the knowledge graph and the lexical hierarchy used to describe the physical world, normalizing the expression of structured data. As can be seen, a database schema is a collection of database objects that includes various objects such as: tables, views, stored procedures, indexes, and the like.
JSON: JavaScript Object notification, is a lightweight data exchange format. It is based on a subset of ECMAScript, JSON employs a text format that is completely language independent, but also uses a convention similar to the C language family. These features make JSON an ideal data exchange language for easy reading and writing, and also for easy machine parsing and generation.
MySQL: MySQL is a relational database management system that keeps data in different tables instead of putting all data in one large repository, which increases speed and flexibility, and the SQL language used by MySQL is the most common standardized language for accessing databases.
In the present application, a method and an apparatus for constructing a knowledge graph, a computing device and a computer readable storage medium are provided, which are described in detail in the following embodiments one by one.
FIG. 1 shows a block diagram of a computing device 100, according to an embodiment of the present description. The components of the computing device 100 include, but are not limited to, memory 110 and processor 120. The processor 120 is coupled to the memory 110 via a bus 130 and a database 150 is used to store data.
Computing device 100 also includes access device 140, access device 140 enabling computing device 100 to communicate via one or more networks 160. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 140 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 100 and other components not shown in FIG. 1 may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 1 is for purposes of example only and is not limiting as to the scope of the description. Those skilled in the art may add or replace other components as desired.
Computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), a mobile phone (e.g., smartphone), a wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 100 may also be a mobile or stationary server.
Wherein the processor 120 may perform the steps of the method shown in fig. 2. FIG. 2 is a schematic flow chart diagram illustrating a method of knowledge-graph construction according to an embodiment of the present application, including steps 202 through 206.
Step 202: and creating an interactive control corresponding to the map editor, and receiving map editing information through the interactive control.
Specifically, an interaction diagram corresponding to the knowledge graph construction method is shown in fig. 3, and the knowledge graph construction method is applied to an artificial intelligence system, and the artificial intelligence system includes a terminal 310 and a server 320. The terminal 310 and the server 320 are connected through a network. The terminal 310 may specifically be a desktop terminal or a mobile terminal, and the mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a notebook computer, and the like. The server 320 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers.
It should be noted that Artificial Intelligence (AI) is a theory, method, technique, and application system that simulates, extends, and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge, and uses the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making.
The artificial intelligence technology is a comprehensive subject and relates to the field of extensive technology, namely the technology of a hardware level and the technology of a software level. The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
Based on this, after receiving the creation request, the terminal 310 will create an interactive control corresponding to the map editor, and at the same time will receive the map editing information uploaded by the user through the interactive control, and then convert the map editing information into structured data corresponding to the current database architecture through the map editor, and finally may generate a knowledge map corresponding to the map editing information according to the structured data. In addition, after the conversion processing is completed to obtain the structured data, the terminal 310 may also upload the structured data to the server 320, and the server completes creation of the knowledge graph.
In the embodiment of the present application, as shown in fig. 4, the step 202 specifically includes steps 402 to 404.
Step 402: and creating an interactive control corresponding to the first category information and the second category information required by the atlas editor for atlas generation, and embedding the interactive control into the atlas editor.
Step 404: receiving the first category information and/or the second category information through the interactive control, and transmitting the first category information and/or the second category information into the atlas editor in a character string mode.
Specifically, the graph editor is an application program providing a user with a knowledge graph editing function, and the user may input relevant information (such as node information and relationship information) for creating a knowledge graph in the graph editing to complete creation of the knowledge graph; correspondingly, the interaction control is specifically a control capable of receiving a user instruction in the atlas editor, that is, a user can input different information for creating a knowledge atlas through different interaction controls. In order to meet the requirements for creating the knowledge graph in different scenes, different interaction controls can be set in the graph editor according to the requirements for creating the knowledge graph so as to support a user to use the graph editor to create the knowledge graph meeting the requirements, that is, the user can input and edit relevant elements of the knowledge graph, such as node information (including node types, node descriptions and the like) and attribute information (attribute names, attribute descriptions, attribute types and the like), through the interaction controls. It should be noted that the interaction control may be a control in different forms, such as a selection-type interaction control or an input-type interaction control, as long as the interaction with the user is supported, and the embodiment is not limited herein.
Further, after the developer creates the interactive control corresponding to the atlas editor, the user using the atlas editor can complete the input of the basic atlas information through the interactive control on the atlas editor according to the requirement, for example: a touch input mode and the like are used for facilitating the subsequent creation of a knowledge graph meeting the requirements of the user, and referring to (a) and (b) in fig. 5, the user can input a node type { per } in a node bar; description { character }; meanwhile, attribute description can be input into the attribute column, and options such as attribute types, default values, short for, whether the attribute types can be modified and the like can be selected, and data constraint aiming at the knowledge graph can also be realized through functions provided by the graph editor, so that the knowledge graph can be successfully created.
Furthermore, because different differences may exist in the creation of knowledge maps in different fields, in order to fully meet the map creation requirements of users, users can enter map editing information in forms filling, candidate item selection and other modes. The map editing information can be divided into first category information corresponding to a fixed data structure and second category information corresponding to an extended data structure according to the setting of a database architecture, and the second category information is not a necessary field in the database architecture, so that the map building process is more flexible.
The fixed data structure specifically refers to a framework corresponding to data which must be entered when the knowledge graph is created, and includes but is not limited to { node/rel } (information representing nodes and relations in a classified manner); { name: node/rel } (node/relationship name); { node/rel- > property } (node or property under relationship); { node/rel- > property- > name & type } (name and data structure type of property under node or relationship); { rel- > start _ node/end _ node } (relationship start node/end node), and the like; the method is used for entering the graph editing information as a basic necessary element for creating the knowledge graph. Correspondingly, the extended data structure specifically refers to a framework corresponding to data which is not necessarily input when the knowledge graph is created, but can be applied to the creation of an auxiliary knowledge graph, or the addition of auxiliary information of the knowledge graph, and the like, including but not limited to { node/rel- > visual } (for the front end to display a name); { node/rel- > property- > is _ update } (whether the map field is running for updating or not); { node/rel- > constraint } (secondary constraint of attribute data, used for inspection of a graph data construction process), and the like, so that the attribute data are used as basic auxiliary elements for creating the knowledge graph when graph editing information is input, and the expression capacity of the created knowledge graph is improved.
Based on this, the first category information is the related information corresponding to the fixed data structure and input by the user through the interactive control when the user uses the atlas editor, and correspondingly, the second category information is the related information corresponding to the extended data structure and input by the user through the interactive control when the user uses the atlas editor, so that the related information is subsequently transmitted to the atlas editor in the form of character strings to realize creation of the knowledge atlas.
For example, for nodes and relations in the knowledge graph, a user needs to create a knowledge graph of a person (per) — (BORN) — > birth from (BORN) — > location (location), and the user inputs a starting node-a by clicking an interactive control on a graph editor; description-character; attribute name-name; attribute type-string; relationship attribute-birth; ending the node-A city; and generating first category information corresponding to a fixed data structure in the map editor according to the input content. Meanwhile, in order to improve the representation capability of the knowledge graph, a user inputs constraint information by clicking an interactive control, wherein the constraint information comprises unique address and unique name; meanwhile, in order to enable the subsequently created knowledge graph to be convenient for the user to use, the user can also input extension information through an interactive control, wherein the extension information comprises attribute modification-false, front-end display-visual, then second category information corresponding to an extension data structure in the graph editor is generated according to the input content, and finally the graph editing information input by the user is used for creating the knowledge graph meeting the user requirements.
In practical applications, the creation of the knowledge graph is not limited to one node and one relationship, for convenience of description, the embodiment takes the one node and the one relationship as an example for description, and the setting of other nodes and relationships can refer to the corresponding description of the embodiment, which is not limited herein.
The map editor can provide a high-efficiency, convenient, visual and low-learning-cost construction mode according to the requirements of database architecture design, and a user can ensure that correct and standard map editing information is provided for map construction and use only through click and simple input.
Step 204: and converting the map editing information into structured data corresponding to the current database architecture through the map editor.
The database architecture defines a data model of the knowledge graph and an expression method of the knowledge graph, so that the construction process of the database architecture is the construction process of the knowledge graph structure. The database architecture of the application adopts a JSON form, additional fields can be added under specific nodes or relations and attributes, and the fields contain various auxiliary description information preset in the interactive control.
In the embodiment of the present application, as shown in fig. 6, the step 204 specifically includes steps 602 to 604.
Step 602: and converting the first category information into structured data of a fixed data structure corresponding to the current database architecture.
The first category information includes node category information, relationship category information, node name information, relationship name information, node attribute information, relationship starting node information and/or relationship ending node information.
Step 604: and converting the second category information into the structured data of the corresponding extended data structure under the current database architecture.
The second category information comprises front-end name information, attribute description information, page display information, field updating information and/or secondary constraint information.
Specifically, the database architecture of the present application mainly uses a JSON expression form, and adopts a flattened hierarchical structure to express the fixed data structure, for example, in the first category information, the node category information may be represented as "node", the relationship category information may be represented as "rel", the node name information may be represented as "name: node", the relationship name information may be represented as "name: rel", the node attribute information may be represented as "node- > property", the relationship attribute information may be represented as "rel- > property", the relationship start node information may be represented as "rel- > start _ node", the relationship end node information may be represented as "rel- > end _ node", and the like.
Meanwhile, the extended data structure is embedded in the fixed data structure, specifically, the code expression corresponding to the extended data structure at the code level can be embedded in the code expression of the fixed data structure, so that information corresponding to the extended data structure and information corresponding to the fixed data structure can be integrated, and a knowledge graph meeting user requirements is created, for example, the code expression { name: date _ leave, type: the "time" may be followed by the code expression { is _ update: false is used for limiting whether the map field is operated or not to be updated, so that the expanded data structure can be fully combined with the fixed data structure, and the subsequent creation of the knowledge map is facilitated.
In addition, the application allows the user to set the extended data structure through the interactive control, for example, the front-end name information may be represented as "visual" for displaying the name of the line segment, the attribute description information may be represented as "info" for returning description information of the first category information to the user on the interactive interface of the interactive control, the page display information may be represented as "abbr", the field update information may be represented as "update" for determining whether the map field is running for updating or for an automatic monitoring function for determining whether the first category information may be automatically modified, and the secondary constraint information may be represented as "constraint" for checking the map data construction process.
It should be noted that the data in the extended data structure is a custom field, which is necessary information for use by an upper layer (interactive control) application, and therefore, a hierarchical structure is adopted for expression on the data structure, for example, front-end name information corresponding to a node category or a relationship category may be represented as "node/rel- > visual", whether a graph field in the node category or the relationship category is updated by running or not may be represented as "node/rel- > is _ update", and secondary constraint information corresponding to the node category or the relationship category may be represented as "node/rel- > constraint".
Enough expansion data structures are reserved in the database architecture of the application, a free setting space under a fixed data structure is formed, and the requirement of specific class information on the design of the database architecture can be met.
In another embodiment of the present application, as shown in fig. 7, the method of the present application further includes steps 702 to 704.
Step 702: and setting corresponding basic constraint conditions for each node category information and the relation category information.
Step 704: and verifying the first category information and the second category information according to the basic constraint condition, and reporting errors under the condition that the verification is not passed.
Specifically, the method also presets corresponding basic constraint conditions for setting node type information and relation type information in the graph editor, for example, for a node 'person', the basic constraint condition is that 'person name cannot be null'; for a node "place", the basic constraint is that the place name must be unique; for the relationship "birth date", the basic constraint is that "birth date must be earlier than the date of departure from the birth date".
Specifically, the data structure of the constraint condition in the database architecture is as described in the "secondary constraint information" section in the foregoing, and details are not repeated herein.
Step 206: and generating a knowledge graph corresponding to the graph editing information based on the structured data.
The knowledge graph is constructed based on the database framework, the construction process of the database framework is the construction process of the graph structure, the database framework is expressed by adopting a hierarchical structure, and the database framework can be guaranteed to have a stable structure, so that the whole construction process of the knowledge graph can be conveniently and quickly obtained to obtain the structural information in the relational database.
In the embodiment of the present application, as shown in fig. 8, the step 206 specifically includes steps 802 to 806.
Step 802: and constructing a plurality of knowledge triples according to the structured data of the fixed data structure corresponding to the current database architecture, and adding corresponding attributes to the nodes and the relations in the knowledge triples.
In the above embodiment, the graph editor of the present application constructs a plurality of knowledge triples according to the node category information, the relationship category information, and the relationship start node information and/or the relationship end node information in the first category information, and adds corresponding attributes to the nodes and the relationships in the knowledge graph triples according to the node attribute information and the relationship attribute information.
Step 804: and constructing auxiliary description information corresponding to each knowledge triple in the plurality of knowledge triples according to the structured data of the extended data structure corresponding to the current database architecture.
In the above embodiments, the graph editor of the present application further generates auxiliary description information corresponding to each of the knowledge triples, for example, description information of nodes or attributes in the knowledge triples, according to the structured data in the extended data structure.
Step 806: and performing modeling representation on the multiple knowledge triples and the auxiliary description information corresponding to each knowledge triplet to form a knowledge graph structure, and performing modeling representation on nodes, relations and attributes in the multiple knowledge triples according to a level structure set in a database architecture to form the knowledge graph structure.
Specifically, each knowledge triple in the knowledge graph is edited by a user, and in order to ensure that the representation of the knowledge graph is more accurate, the user can input corresponding auxiliary description information for each knowledge triple when inputting graph editing information, so as to describe the attribute or relationship of each triple, thereby facilitating the use of other users or updating or modifying the edited knowledge graph; namely, the auxiliary description information specifically refers to information for performing auxiliary expression on each knowledge triplet, such as the triplet { first-birth-A city }, and a user can input a constraint that auxiliary description information is 'place name must be unique' for the triplet, so that the generated knowledge graph has a 'place name must be unique' label, the user can be reminded to pay attention to the 'place name must be unique' label conveniently during subsequent updating and modification of the knowledge graph, and the accuracy of updating and modifying the knowledge graph is improved.
In addition, in order to facilitate subsequent modification, update or addition of new triple of knowledge to the created knowledge graph, the graph editor provided in this embodiment may further provide a function of reading the knowledge graph to the user, that is, the user may obtain expressions in various forms of the knowledge graph, such as graph expression, word expression or code expression, by clicking an interactive control corresponding to the reading function on the graph editor, so that the user may conveniently adjust the knowledge graph according to the needs. Meanwhile, the unique identification is configured for the created knowledge graph and stored, so that the knowledge graph needing to be modified/updated can be conveniently obtained according to the unique identification to perform corresponding processing.
The method and the device can dynamically generate the graph structure of the knowledge graph database architecture according to the design structure of the database architecture, so that a user can visually know the design structure of the database architecture and adjust the design structure of the database architecture; meanwhile, the method and the device also provide perfect storage and reading functions, and are convenient for a user to continuously optimize and update the database architecture.
Fig. 9 shows a method for constructing a knowledge graph, which is described by taking (person, birth, location) knowledge triples as an example, according to an embodiment of the present disclosure, and includes steps 902 to 906.
Step 902: and receiving map editing information corresponding to the person, the birth place and the place through the interactive control respectively.
Step 904: and expressing the person and the map editing information corresponding to the place in a JSON form in a map editor.
The method comprises the steps of taking people and places as nodes, taking the occurrence of the people and the places as a relation, representing the ontology, the attributes and whether the added objects need to be updated or not and carrying out secondary constraint in a JSON form, and checking and correcting the represented contents through a graph editor.
Step 906: and generating a relation structure of the figure and the knowledge graph of the graph editing information corresponding to the place through a graph editor under a preset database architecture.
The knowledge graph is constructed based on the database framework, the construction process of the database framework is also the construction process of the graph structure, the database framework is expressed by adopting a hierarchical structure, the database framework can be guaranteed to have a stable structure, the database framework which is high in flexibility, strong in applicability and reasonable in rule is designed through a fixed data structure and an extended data structure, and therefore the whole construction process of the knowledge graph can be guaranteed to be convenient and fast to acquire structural information in a relational database. Meanwhile, enough free setting space is reserved in the certificate database framework of the application, and the requirement of each independent module on the design of the database framework can be met.
In addition, the map editor can provide a high-efficiency, convenient, visual and low-learning-cost construction mode according to the requirements of database architecture design, and a user can ensure that correct and standard map editing information is provided for map construction and use only through click and simple input.
Corresponding to the above method embodiment, the present specification further provides an embodiment of a knowledge graph constructing apparatus, and fig. 10 shows a schematic structural diagram of the knowledge graph constructing apparatus according to an embodiment of the present specification. As shown in fig. 10, the apparatus includes:
an interactive control module 1001 configured to create an interactive control corresponding to the atlas editor, and receive atlas editing information through the interactive control;
an editor module 1002 configured to convert the graph edit information into structured data corresponding to a current database architecture through the graph editor;
a map building module 1003 configured to generate a knowledge map corresponding to the map editing information based on the structured data.
In an alternative embodiment, the interactive control module 1001 includes:
the control creating unit is configured to create an interactive control corresponding to first category information and second category information required by the atlas editor for atlas generation, and embed the interactive control into the atlas editor;
the information receiving unit is configured to receive the first category information and/or the second category information through the interaction control, and transmit the first category information and/or the second category information to the map editor in a character string mode.
In an alternative embodiment, the editor module 1002 comprises:
the first information representation unit is configured to convert the first category information into structured data of a fixed data structure corresponding to the current database architecture; and/or
The second information representation unit is configured to convert the second type information into structured data of an extended data structure corresponding to the current database architecture;
wherein the extended data structure is embedded in the fixed data structure.
In an optional embodiment, the apparatus further comprises a revision checking module configured to:
setting corresponding basic constraint conditions for each node category information and the relation category information;
and verifying the first category information and the second category information according to the basic constraint condition, and reporting errors under the condition that the verification is not passed.
In an optional embodiment, the map building module 1003 includes:
the triple construction unit is configured to construct a plurality of knowledge triples according to the structured data of the fixed data structure corresponding to the current database architecture, and add corresponding attributes to the nodes and the relations in the knowledge graph triples;
the auxiliary configuration unit is configured to construct auxiliary description information corresponding to each knowledge triple in the multiple knowledge triples according to the structured data of the extended data structure corresponding to the current database architecture;
the map display unit is configured to perform modeling representation on the multiple knowledge triples and the auxiliary description information corresponding to each knowledge triplet to form a knowledge map structure.
It should be noted that the components in the device claims should be understood as functional blocks which are necessary to implement the steps of the program flow or the steps of the method, and each functional block is not actually defined by functional division or separation. The device claims defined by such a set of functional modules are to be understood as a functional module framework for implementing the solution mainly by means of a computer program as described in the specification, and not as a physical device for implementing the solution mainly by means of hardware.
An embodiment of the present application further provides a computing device, including a memory, a processor, and computer instructions stored on the memory and executable on the processor, where the processor executes the instructions to implement the following steps:
creating an interactive control corresponding to the map editor, and receiving map editing information through the interactive control;
converting the map editing information into structured data corresponding to the current database architecture through the map editor;
and generating a knowledge graph corresponding to the graph editing information based on the structured data.
An embodiment of the present application also provides a computer readable storage medium storing computer instructions, which when executed by a processor, implement the steps of the method for constructing a knowledge graph as described above.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the computer-readable storage medium and the technical solution of the above-mentioned knowledge graph construction method belong to the same concept, and details that are not described in detail in the technical solution of the computer-readable storage medium can be referred to the description of the technical solution of the above-mentioned knowledge graph construction method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and the practical application, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.

Claims (12)

1. A knowledge graph construction method is characterized by comprising the following steps:
creating an interactive control corresponding to the map editor, and receiving map editing information through the interactive control;
converting the map editing information into structured data corresponding to the current database architecture through the map editor;
and generating a knowledge graph corresponding to the graph editing information based on the structured data.
2. The method of claim 1, wherein creating an interactive control corresponding to the graph editor through which graph editing information is received comprises:
creating an interactive control corresponding to first category information and second category information required by the map editor for map generation, and embedding the interactive control into the map editor;
receiving the first category information and/or the second category information through the interactive control, and transmitting the first category information and/or the second category information into the atlas editor in a character string mode.
3. The method of claim 2, wherein translating, by the graph editor, the graph-editing information into structured data corresponding to a current database architecture comprises:
converting the first category information into structured data of a fixed data structure corresponding to the current database architecture; and/or
Converting the second category information into structured data of an extended data structure corresponding to the current database architecture;
wherein the extended data structure is embedded in the fixed data structure.
4. The method of claim 2, further comprising:
setting corresponding basic constraint conditions for each node category information and the relation category information;
and verifying the first category information and the second category information according to the basic constraint condition, and reporting errors under the condition that the verification is not passed.
5. The method of claim 3, wherein generating the knowledge-graph corresponding to the graph-editing information based on the structured data comprises:
constructing a plurality of knowledge triples according to the structured data of the fixed data structure corresponding to the current database architecture, and adding corresponding attributes to the nodes and the relations in the knowledge graph triples;
constructing auxiliary description information corresponding to each knowledge triple in the plurality of knowledge triples according to the structured data of the extended data structure corresponding to the current database architecture;
and performing modeling representation on the multiple knowledge triples and the auxiliary description information corresponding to each knowledge triplet to form a knowledge graph structure.
6. A knowledge-graph building apparatus, comprising:
the interactive control module is configured to create an interactive control corresponding to the map editor and receive map editing information through the interactive control;
an editor module configured to convert, by the graph editor, the graph editing information into structured data corresponding to a current database architecture;
the map building module is configured to generate a knowledge map corresponding to the map editing information based on the structured data.
7. The apparatus of claim 6, wherein the interactive control module comprises:
the control creating unit is configured to create an interactive control corresponding to first category information and second category information required by the atlas editor for atlas generation, and embed the interactive control into the atlas editor;
the information receiving unit is configured to receive the first category information and/or the second category information through the interaction control, and transmit the first category information and/or the second category information to the map editor in a character string mode.
8. The apparatus of claim 7, wherein the editor module comprises:
the first information representation unit is configured to convert the first category information into structured data of a fixed data structure corresponding to the current database architecture; and/or
The second information representation unit is configured to convert the second type information into structured data of an extended data structure corresponding to the current database architecture;
wherein the extended data structure is embedded in the fixed data structure.
9. The apparatus of claim 7, further comprising a rework verification module configured to:
setting corresponding basic constraint conditions for each node category information and the relation category information;
and verifying the first category information and the second category information according to the basic constraint condition, and reporting errors under the condition that the verification is not passed.
10. The apparatus of claim 6, wherein the atlas-building module comprises:
the triple construction unit is configured to construct a plurality of knowledge triples according to the structured data of the fixed data structure corresponding to the current database architecture, and add corresponding attributes to the nodes and the relations in the knowledge graph triples;
the auxiliary configuration unit is configured to construct auxiliary description information corresponding to each knowledge triple in the multiple knowledge triples according to the structured data of the extended data structure corresponding to the current database architecture;
the map display unit is configured to perform modeling representation on the multiple knowledge triples and the auxiliary description information corresponding to each knowledge triplet to form a knowledge map structure.
11. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor implements the steps of the method of any one of claims 1-5 when executing the instructions.
12. A computer-readable storage medium storing computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1 to 5.
CN202110438576.6A 2021-04-22 2021-04-22 Knowledge graph construction method and device Pending CN113111135A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110438576.6A CN113111135A (en) 2021-04-22 2021-04-22 Knowledge graph construction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110438576.6A CN113111135A (en) 2021-04-22 2021-04-22 Knowledge graph construction method and device

Publications (1)

Publication Number Publication Date
CN113111135A true CN113111135A (en) 2021-07-13

Family

ID=76719633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110438576.6A Pending CN113111135A (en) 2021-04-22 2021-04-22 Knowledge graph construction method and device

Country Status (1)

Country Link
CN (1) CN113111135A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113836316A (en) * 2021-09-23 2021-12-24 北京百度网讯科技有限公司 Processing method, training method, device, equipment and medium for ternary group data
CN114153360A (en) * 2021-12-07 2022-03-08 华南理工大学 Man-machine interaction system and method based on artificial intelligence
CN116303516A (en) * 2023-04-21 2023-06-23 中信证券股份有限公司 Method, device and related equipment for updating knowledge graph

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100049763A1 (en) * 2006-08-28 2010-02-25 Korea Institute Of Science & Technology Information System for Providing Service of Knowledge Extension and Inference Based on DBMS, and Method for the Same
CN110275894A (en) * 2019-06-24 2019-09-24 恒生电子股份有限公司 A kind of update method of knowledge mapping, device, electronic equipment and storage medium
US20200050632A1 (en) * 2018-08-08 2020-02-13 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for generating knowledge graph, device and computer readable storage medium
CN111427901A (en) * 2020-03-23 2020-07-17 浪潮通用软件有限公司 Interactive knowledge graph data editing method, computer device and storage medium
CN111708892A (en) * 2020-04-24 2020-09-25 陆洋 Database system based on depth knowledge graph
US20200364584A1 (en) * 2015-10-28 2020-11-19 Qomplx, Inc. Multi-tenant knowledge graph databases with dynamic specification and enforcement of ontological data models
CN112559704A (en) * 2020-12-08 2021-03-26 北京航天云路有限公司 Knowledge graph generation tool configured by user-defined

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100049763A1 (en) * 2006-08-28 2010-02-25 Korea Institute Of Science & Technology Information System for Providing Service of Knowledge Extension and Inference Based on DBMS, and Method for the Same
US20200364584A1 (en) * 2015-10-28 2020-11-19 Qomplx, Inc. Multi-tenant knowledge graph databases with dynamic specification and enforcement of ontological data models
US20200050632A1 (en) * 2018-08-08 2020-02-13 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for generating knowledge graph, device and computer readable storage medium
CN110275894A (en) * 2019-06-24 2019-09-24 恒生电子股份有限公司 A kind of update method of knowledge mapping, device, electronic equipment and storage medium
CN111427901A (en) * 2020-03-23 2020-07-17 浪潮通用软件有限公司 Interactive knowledge graph data editing method, computer device and storage medium
CN111708892A (en) * 2020-04-24 2020-09-25 陆洋 Database system based on depth knowledge graph
CN112559704A (en) * 2020-12-08 2021-03-26 北京航天云路有限公司 Knowledge graph generation tool configured by user-defined

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113836316A (en) * 2021-09-23 2021-12-24 北京百度网讯科技有限公司 Processing method, training method, device, equipment and medium for ternary group data
CN113836316B (en) * 2021-09-23 2023-01-03 北京百度网讯科技有限公司 Processing method, training method, device, equipment and medium for ternary group data
CN114153360A (en) * 2021-12-07 2022-03-08 华南理工大学 Man-machine interaction system and method based on artificial intelligence
CN116303516A (en) * 2023-04-21 2023-06-23 中信证券股份有限公司 Method, device and related equipment for updating knowledge graph

Similar Documents

Publication Publication Date Title
CN110147437B (en) Knowledge graph-based searching method and device
CN113111135A (en) Knowledge graph construction method and device
US9652719B2 (en) Authoring system for bayesian networks automatically extracted from text
Jabbar et al. A methodology of real-time data fusion for localized big data analytics
US11797585B2 (en) Data updating method and apparatus, electronic device and computer readable storage medium
WO2020010834A1 (en) Faq question and answer library generalization method, apparatus, and device
CN110119473B (en) Method and device for constructing target file knowledge graph
CN115587175B (en) Man-machine conversation and pre-training language model training method and system and electronic equipment
EP3671526A1 (en) Dependency graph based natural language processing
CN113392197B (en) Question-answering reasoning method and device, storage medium and electronic equipment
CN110275963A (en) Method and apparatus for output information
CN113535977A (en) Knowledge graph fusion method, device and equipment
CN111553138B (en) Auxiliary writing method and device for standardizing content structure document
CN111782825A (en) Knowledge base construction method and device
CN113220901A (en) Writing concept auxiliary system and network system based on enhanced intelligence
CN114911893A (en) Method and system for automatically constructing knowledge base based on knowledge graph
CN114911915A (en) Knowledge graph-based question and answer searching method, system, equipment and medium
CN105335466A (en) Audio data retrieval method and apparatus
CN113220951B (en) Medical clinic support method and system based on intelligent content
CN112582073B (en) Medical information acquisition method, device, electronic equipment and medium
CN114360731A (en) Method for constructing medical care and knowledge combined service system for old people care
CN111159427B (en) Knowledge graph construction method and system based on crowdsourcing
CN114281957A (en) Natural language data query method and device, electronic equipment and storage medium
CN117453925A (en) Knowledge migration method, apparatus, device, readable storage medium and program product
CN115878818B (en) Geographic knowledge graph construction method, device, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination