CN112860912B - Method and device for updating knowledge graph - Google Patents

Method and device for updating knowledge graph Download PDF

Info

Publication number
CN112860912B
CN112860912B CN202110185453.6A CN202110185453A CN112860912B CN 112860912 B CN112860912 B CN 112860912B CN 202110185453 A CN202110185453 A CN 202110185453A CN 112860912 B CN112860912 B CN 112860912B
Authority
CN
China
Prior art keywords
intervention
data
attribute value
database
entity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110185453.6A
Other languages
Chinese (zh)
Other versions
CN112860912A (en
Inventor
陈正源
陈嘉伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202110185453.6A priority Critical patent/CN112860912B/en
Publication of CN112860912A publication Critical patent/CN112860912A/en
Application granted granted Critical
Publication of CN112860912B publication Critical patent/CN112860912B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a method and a device for updating a knowledge graph, and relates to the technical field of data processing. The method comprises the following steps: acquiring a target attribute value, wherein the target attribute value is an attribute value of a first attribute of a first entity; generating at least one piece of intervention data according to the target attribute value and a map attribute value, wherein the map attribute value is an attribute value of the first attribute of the first entity in a knowledge map; updating intervention data in an intervention database according to the at least one piece of intervention data; and constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source, and generating an updated knowledge graph. The embodiment of the invention is used for solving the problem that intervention data in the existing knowledge graph intervention mode does not have the capability of tracing and replaying.

Description

Method and device for updating knowledge graph
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for updating a knowledge graph.
Background
The essence of a knowledge graph is a knowledge base of a Semantic Network (Semantic Network), which consists of nodes (points) and edges (edges), and aims to describe entities and relationships among entities in the objective world in the form of a Semantic Network, each node represents an entity existing in the real world, and each Edge is a relationship between the entities.
The process of constructing the knowledge graph is a process of fusing data of a plurality of data sources, and errors may exist in the knowledge graph constructed by a machine, so that correction of the knowledge graph is necessary. The intervention of the knowledge graph is a behavior of correcting the knowledge graph, and errors in the knowledge graph can be corrected through intervention data. At present, a commonly used knowledge graph intervention mode is to directly write intervention data into a database where the knowledge graph is located. That is, the errors that exist are modified on the knowledge-graph that is ultimately generated. The intervention data is taken as an important link of the construction of the atlas, and the data must be traceable and replayable and can be used for iteration of the atlas. However, the intervention data do not participate in the data fusion process, and only all the operations of adding, deleting and modifying are directly acted on the knowledge graph, so that the intervention data in the prior knowledge graph intervention mode do not have the problems of traceability and playback capability.
Disclosure of Invention
In view of the above, the invention provides a method and a device for updating a knowledge graph, which are used for solving the problem that intervention data in the existing knowledge graph intervention mode do not have the capability of tracing and replaying.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
in a first aspect, an embodiment of the present invention provides a method for updating a knowledge-graph, including:
acquiring a target attribute value, wherein the target attribute value is an attribute value of a first attribute of a first entity;
generating at least one piece of intervention data according to the target attribute value and a map attribute value, wherein the map attribute value is an attribute value of the first attribute of the first entity in a knowledge map;
Updating intervention data in an intervention database according to the at least one piece of intervention data;
and constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source, and generating an updated knowledge graph.
As an optional implementation manner of the embodiment of the present invention, the generating at least one piece of intervention data according to the target attribute value and the map attribute value includes:
if the target attribute value contains a first attribute value and the map attribute value does not contain the first attribute value, generating intervention data for adding the first attribute value to the knowledge map;
and if the target attribute value does not contain the second attribute value and the map attribute value contains the second attribute value, generating intervention data for deleting the second attribute value from the knowledge map.
As an optional implementation manner of the embodiment of the present invention, the updating intervention data in the intervention database according to the at least one piece of intervention data includes:
Judging whether conflict data of each intervention data are contained in the intervention database; conflict data of any intervention data is intervention data with opposite semantics of the intervention data;
If the intervention database contains conflict data of first intervention data, deleting the conflict data of the first intervention data from the intervention database;
and if the intervention database does not contain conflict data of second intervention data, writing the second intervention data into the intervention database.
As an optional implementation manner of the embodiment of the present invention, the method further includes:
in case of conflicting data comprising first intervention data in the intervention database, writing the first intervention data in the intervention database.
As an alternative implementation of the embodiment of the present invention, any intervention data includes: entity, attribute value, and status information; the state information is positive or negative, when the state information is positive, the semantics of the corresponding intervention data are added with the corresponding attribute values, and when the state information is negative, the semantics of the corresponding intervention data are deleted with the corresponding attribute values;
the judging whether the intervention database contains conflict data of each intervention data comprises the following steps:
Judging whether the intervention database contains intervention data which have the same entity, attribute and attribute value as the intervention data and opposite state information;
If the intervention database contains intervention data which are the same as the entity, attribute and attribute value of the first intervention data and have opposite state information, determining conflict data containing the first intervention data in the intervention database;
And if the intervention database does not contain intervention data which is the same as the entity, attribute and attribute value of the second intervention data and has opposite state information, determining that conflict data of the second intervention data is not contained in the intervention database.
As an optional implementation manner of the embodiment of the present invention, the method further includes:
Under the condition that at least two entities are fused into an entity group, and the first entity is selected as a main entity of the entity group, modifying to the first entity of intervention data to be fused and entity of source data to be fused, wherein the source data to be fused comprises all source data of which the entity is a non-main entity of the entity group in the source data extracted from a data source, and the intervention data to be fused comprises all intervention data of which the entity is a non-main entity of the entity group in the intervention database;
and constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source, and generating the knowledge graph after fusing the at least two entities.
As an optional implementation manner of the embodiment of the present invention, after modifying the entity of the intervention data to be fused and the source data to be fused into the first entity, the method further includes:
judging whether the intervention database contains intervention data with opposite semantics;
if the semantics of the third intervention data and the fourth intervention data are opposite, acquiring the time stamps of the third intervention data and the fourth intervention data;
acquiring target intervention data, wherein the target intervention data are intervention data with time stamps behind in the third intervention data and the fourth intervention data;
And controlling the target intervention data to take effect in the process of constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source and generating the knowledge graph after fusing the at least two entities.
As an alternative implementation of the embodiment of the present invention, the validation priority of the intervention data is higher than the validation priority of the source data extracted from the data source.
In a second aspect, an embodiment of the present invention provides an apparatus for updating a knowledge graph, including:
The acquisition unit is used for acquiring a target attribute value, wherein the target attribute value is an attribute value of a first attribute of a first entity;
The generation unit is used for generating at least one piece of intervention data according to the target attribute value and the map attribute value, wherein the map attribute value is an attribute value of the first attribute of the first entity in the knowledge map;
an updating unit for updating the intervention data in the intervention database according to the at least one piece of intervention data;
and the construction unit is used for constructing the knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source and generating an updated knowledge graph.
As an optional implementation manner of the embodiment of the present invention, the updating unit is specifically configured to generate intervention data for adding the first attribute value to the knowledge graph when the target attribute value includes the first attribute value and the graph attribute value does not include the first attribute value; if the target attribute value does not include a second attribute value and the map attribute value includes the second attribute value, intervention data for deleting the second attribute value from the knowledge map is generated.
As an optional implementation manner of the embodiment of the present invention, the updating unit is further configured to determine whether the intervention database includes conflict data of each intervention data; if the intervention database contains conflict data of first intervention data, deleting the conflict data of the first intervention data from the intervention database; if the intervention database does not contain conflict data of second intervention data, writing the second intervention data into the intervention database;
Wherein the conflict data of any intervention data is the intervention data with the opposite meaning of the intervention data.
As an optional implementation manner of the embodiment of the present invention, the updating unit is further configured to write, in the case where the intervention database contains conflict data of the first intervention data, the first intervention data into the intervention database.
As an alternative implementation of the embodiment of the present invention, any intervention data includes: entity, attribute value, and status information; the state information is positive or negative, when the state information is positive, the semantics of the corresponding intervention data are added with the corresponding attribute values, and when the state information is negative, the semantics of the corresponding intervention data are deleted with the corresponding attribute values;
The updating unit is specifically configured to determine whether the intervention database includes intervention data that has the same entity, attribute value, and opposite status information as each intervention data; if the intervention database contains intervention data which are the same as the entity, attribute and attribute value of the first intervention data and have opposite state information, determining conflict data containing the first intervention data in the intervention database; and if the intervention database does not contain intervention data which is the same as the entity, attribute and attribute value of the second intervention data and has opposite state information, determining that conflict data of the second intervention data is not contained in the intervention database.
As an optional implementation manner of the embodiment of the present invention, the updating unit is further configured to, when at least two entities are fused into one entity group and the first entity is selected to be a main entity of the entity group, modify, to the first entity, to-be-fused intervention data and an entity of to-be-fused source data, where the to-be-fused source data includes source data, of which an entity is a non-main entity of the entity group, in the source data extracted from a data source, and the to-be-fused intervention data includes intervention data, of which an entity is a non-main entity of the entity group, in the intervention database;
The construction unit is further used for constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source, and generating the knowledge graph after fusing the at least two entities.
As an optional implementation manner of the embodiment of the present invention, the updating unit is further configured to determine whether the intervention database includes intervention data with opposite semantics after modifying an entity of the intervention data to be fused and the source data to be fused into the first entity; if the semantics of the third intervention data and the fourth intervention data are opposite, acquiring the time stamps of the third intervention data and the fourth intervention data; acquiring target intervention data, wherein the target intervention data are intervention data with time stamps behind in the third intervention data and the fourth intervention data; and controlling the target intervention data to take effect in the process of constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source and generating the knowledge graph after fusing the at least two entities.
As an alternative implementation of the embodiment of the present invention, the validation priority of the intervention data is higher than the validation priority of the source data extracted from the data source.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a memory and a processor, the memory for storing a computer program; the processor is configured to perform the method of updating a knowledge-graph of the first aspect or any of the first aspects when invoking a computer program.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium, where a computer program is stored thereon, where the computer program, when executed by a processor, implements the method for updating a knowledge-graph according to the first aspect or any one of the first aspects.
In a fifth aspect, embodiments of the present invention provide a computer program product comprising a computer program/instruction which, when executed by a processor, implements the method of updating a knowledge-graph according to the first aspect or any of the alternative embodiments of the first aspect.
The method for updating the knowledge graph provided by the embodiment of the invention comprises the steps of firstly obtaining the target attribute value of the first attribute of the first entity, then generating at least one piece of intervention data according to the attribute value of the first attribute of the first entity and the target attribute value in the knowledge graph, updating the intervention data in the intervention database according to the generated intervention data, and finally constructing the knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source to generate the updated knowledge graph. The intervention data in the embodiment of the invention are all stored in the intervention database, and the intervention database can be used as an independent data source to participate in the construction of the knowledge graph, so that the method for updating the knowledge graph provided by the embodiment of the invention can enable the intervention data to have the capability of tracing and replaying, and solve the problem that the intervention data in the existing knowledge graph intervention mode does not have the capability of tracing and replaying.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is one of the flowcharts of the method for updating knowledge-graph according to the embodiment of the present invention;
FIG. 2 is a second flowchart illustrating a method for updating a knowledge graph according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating an intervention state transition provided in an embodiment of the present invention;
FIG. 4 is a third flowchart illustrating steps of a method for updating a knowledge graph according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a device for updating a knowledge graph according to an embodiment of the present invention;
Fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order that the above objects, features and advantages of the invention will be more clearly understood, a further description of the invention will be made. It should be noted that, without conflict, the embodiments of the present invention and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the invention.
In embodiments of the invention, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment should not be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion. Furthermore, in the description of the embodiments of the present invention, unless otherwise indicated, the meaning of "plurality" means two or more.
The embodiment of the invention provides a method for updating a knowledge graph, and specifically, referring to fig. 1, the method for updating the knowledge graph provided by the embodiment of the invention comprises the following steps:
S101, acquiring a target attribute value.
Wherein the target attribute value is an attribute value of a first attribute of the first entity.
Illustratively, when it is desired to modify the classification properties of the steel pipe to: when building materials and weaponry are used, then the target property values (building materials, weaponry) may be entered for the first property value (classification) of the first entity (steel pipe).
S102, generating at least one piece of intervention data according to the target attribute value and the map attribute value.
The map attribute value is an attribute value of the first attribute of the first entity in the knowledge map.
By way of example, the intervention data in embodiments of the present invention may be an intervention SPO. Where SPO is a basic concept in a knowledge graph for identifying relationships between entities by triples of { subject, predicate, object, for example: a's wife is B, and can be expressed by SPO of { A, wife, B }. Intervention SPO can then be categorized into two types based on the semantics of the operation that the intervention is intended to perform, one of which is: an intervention SPO adding a certain SPO, such an intervention SPO being called a positive intervention SPO, its corresponding intervention operation being called a positive intervention. The other is: an intervening SPO that wants to delete a certain SPO, such intervening operation is called negative intervening SPO, and its corresponding intervening operation is called negative intervening.
As an alternative implementation of the embodiment of the invention: the generating at least one piece of intervention data according to the target attribute value and the map attribute value comprises the following steps:
if the target attribute value contains a first attribute value and the map attribute value does not contain the first attribute value, generating intervention data for adding the first attribute value to the knowledge map;
and if the target attribute value does not contain the second attribute value and the map attribute value contains the second attribute value, generating intervention data for deleting the second attribute value from the knowledge map.
For example: the map attribute value comprises a classification attribute B of the entity A, the target attribute value comprises a classification attribute C of the entity A, two pieces of intervention data are generated according to the target attribute value and the map attribute value, and one piece of the intervention data is positive intervention data for adding the classification attribute C of the entity A into the knowledge map; the other piece is negative intervention data for deleting the classification attribute B of the entity A from the knowledge graph. When the intervention data is an intervention SPO, the two generated intervention SPOs are { entity a, category, C, positive intervention }, { entity a, category, B, negative intervention }, respectively.
For another example: the target attribute values include the classification attributes "weaponry" and "building material" of "steel", the map attribute values include the classification attributes "building material" and "machine parts" of "steel", and because the target attribute values include "weaponry" and the map attribute values do not include "weaponry", it is necessary to generate intervention data for adding "weaponry" to the knowledge map, and because the target attribute values do not include "machine parts" and the map attribute values include "machine parts", it is necessary to generate intervention data for deleting the second attribute value from the knowledge map. When the intervention data is an intervention SPO, the two generated intervention SPOs are { steel, category, weapon equipment, positive intervention }, { steel, category, mechanical accessory, negative intervention }, respectively.
S103, updating intervention data in an intervention database according to the at least one piece of intervention data.
For example, the generated intervention data may be added to an intervention database to update the intervention data in the intervention database.
S104, constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source, and generating an updated knowledge graph.
Since the updated knowledge spectrogram is a knowledge spectrogram constructed according to the intervention data in the intervention database and the source data extracted from the data source, the attribute value of the first attribute in the updated knowledge spectrogram is the target attribute value.
Optionally, the intervention data has a higher validation priority than the source data extracted from the data source.
The method for updating the knowledge graph provided by the embodiment of the invention comprises the steps of firstly obtaining the target attribute value of the first attribute of the first entity, then generating at least one piece of intervention data according to the attribute value of the first attribute of the first entity and the target attribute value in the knowledge graph, updating the intervention data in the intervention database according to the generated intervention data, and finally constructing the knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source to generate the updated knowledge graph. The intervention data in the embodiment of the invention are all stored in the intervention database, and the intervention database can be used as an independent data source to participate in the construction of the knowledge graph, so that the method for updating the knowledge graph provided by the embodiment of the invention can enable the intervention data to have the capability of tracing and replaying, and solve the problem that the intervention data in the existing knowledge graph intervention mode does not have the capability of tracing and replaying.
When the intervention data in the intervention database is updated according to the newly generated intervention data, if the newly generated intervention data is directly added into the intervention database, the problem of unclear semantics of the intervention data is very likely to occur in the iterative process of the knowledge graph. For example: when the intervention data in the intervention database is updated at one time, the intervention data with the semantic of increasing the relation A is added into the intervention database, and when the intervention data in the intervention database is updated at the other time, the intervention data with the semantic of deleting the relation A is added into the intervention database, and at the moment, the intervention database simultaneously comprises the intervention data with the semantic of increasing the relation A and the intervention data with the semantic of deleting the relation A, so that the semantic of the intervention data is unclear. In order to solve the above-mentioned problem, an embodiment of the present invention provides another method for updating a knowledge graph, referring to fig. 2, on the basis of the above-mentioned steps S101 to S104, the above-mentioned step S103 (updating the intervention data in the intervention database according to the at least one intervention data) includes:
s201, judging whether conflict data of each intervention data are contained in the intervention database.
Wherein the conflict data of any intervention data is the intervention data with the opposite meaning of the intervention data.
Optionally, any intervention data comprises: entity, attribute value, and status information; the state information is positive or negative, when the state information is positive, the semantics of the corresponding intervention data are added with the corresponding attribute values, and when the state information is negative, the semantics of the corresponding intervention data are deleted with the corresponding attribute values;
the judging whether the intervention database contains conflict data of each intervention data comprises the following steps:
Judging whether the intervention database contains intervention data which have the same entity, attribute and attribute value as the intervention data and opposite state information;
If the intervention database contains intervention data which are the same as the entity, attribute and attribute value of the first intervention data and have opposite state information, determining conflict data containing the first intervention data in the intervention database;
And if the intervention database does not contain intervention data which is the same as the entity, attribute and attribute value of the second intervention data and has opposite state information, determining that conflict data of the second intervention data is not contained in the intervention database.
That is, the conflicting intervention SPO of any positive intervention SPO is the same negative intervention SPO as the SPO corresponding to that positive intervention SPO; the conflicting intervention SPO of any negative intervention SPO is the same positive intervention SPO as the SPO corresponding to that negative intervention SPO.
For example: the generated at least one intervention SPO includes a positive intervention SPO { a, wife, B, positive intervention }, and since the SPO corresponding to the positive intervention SPO is { a, wife, B }, a manner of determining whether the intervention database includes conflict data of each intervention data may be: judging whether the intervention database contains negative intervention SPO { A, wife, B, negative intervention }.
For another example: the generated at least one intervention SPO includes a negative intervention SPO { C, classification, D, negative intervention }, and since the SPO corresponding to the negative intervention SPO is { C, classification, D }, a manner of determining whether the intervention database includes conflict data of each intervention data may be: judging whether the intervention database contains the intervention SPO { C, classification, D, intervention }.
In the above step S201, if the intervention database includes the conflict intervention SPO of the first intervention SPO, the following step S202 is executed, and if the intervention database does not include the conflict intervention SPO of the first intervention SPO, the following step S203 is executed.
S202, deleting conflict data of the first intervention data from the intervention database.
S203, writing the second intervention data into the intervention database.
That is, in the embodiment of the present invention, the intervention operation includes 2 kinds of semantics of positive intervention and negative intervention, the intervention SPO corresponding to the two kinds of semantics is the positive intervention SPO and the negative intervention SPO, and 2 kinds of operations may be added or deleted to the intervention SPO itself, so the intervention SPO includes 4 kinds of intervention states composed of 2 kinds of semantics (positive intervention SPO and negative intervention SPO) and 2 kinds of operations (addition intervention SPO and deletion intervention SPO), the 4 kinds of intervention states are respectively: when positive intervention is added, positive intervention is deleted, negative intervention is added and negative intervention is deleted, and the intervention state is converted by taking SPO as granularity, the conversion relationship among 4 intervention states is shown in fig. 3, including: adding positive intervention to the empty intervention to obtain positive intervention; deleting the positive intervention to obtain an empty intervention; adding negative intervention to the empty intervention to obtain negative intervention; deleting the negative intervention to obtain the null intervention.
The above embodiment judges each piece of intervention data generated according to the target attribute value and the map attribute value, if the intervention database contains conflict data, the conflict intervention data in the intervention database is deleted, and if the conflict data in the intervention database is not contained in the plurality of pre-databases, the conflict data is written into the intervention database. In the embodiment, under the condition that the intervention database contains conflict data of certain intervention data, the conflict data of the intervention data are deleted, and the intervention data are not written into the intervention database, so that the intervention database simultaneously contains the intervention data and the conflict data, and therefore, the embodiment of the invention can avoid unclear semantics of the intervention data in the intervention database.
The following description will exemplify a method of updating a knowledge graph, in which the intervention data and the source number data are SPO, for example, provided in the above embodiment.
Example 1, classification of entity "X", intervention SPO in the intervention database and SPO extracted from the data source at times T1-T4 are as follows:
Time T1:
The classification of data source 1 providing X includes a and B, so two SPOs can be extracted from data source 1, which are: { X, classification, A } and { X, classification, B }. The intervention is not intervening, the intervention database is empty, and the map attribute values are: A. and B, a step of performing the process.
Time T2:
Intervention, wherein the target attribute value is as follows: A. and C, performing the operation of the device. Since the profile attribute values are: A. b, thus generating first 2 intervention SPOs based on the intervention operation, the two intervention SPOs being respectively: { X, classification, B, negative intervention } and { X, classification, C, positive intervention }. Since the current intervention database is empty, contains no intervention SPO, contains no conflicting intervention SPO of { X, class, B, negative intervention } and { X, class, C, positive intervention } and thus writes { X, class, B, negative intervention } and { X, class, C, positive intervention } into the intervention database. After time T2, the intervention database includes { X, class, B, negative intervention } and { X, class, C, positive intervention } 2 intervention SPOs.
Time T3:
The classification of data source 2 providing X includes F, so 1 SPO can be extracted from data source 2, which SPO is: { X, class, F }, map genus becomes A, C, F. After time T3, the intervention SPO in the intervention database is unchanged, still comprising: { X, classification, B, negative intervention } and { X, classification, C, positive intervention } 2 intervention SPO.
Time T4:
Intervention is performed again, and the target attribute values are as follows: F. since the map membership becomes A, C, F, 2 intervention SPOs are first generated based on the intervention operation, the two intervention SPOs being respectively: { X, classification, A, negative intervention } and negative intervention { X, classification, C, negative intervention }. Second, for { X, class, A, negative intervention } the { X, class, A, negative intervention } is written into the intervention database because its conflicting intervention SPO is not contained in the intervention database, and for { X, class, C, negative intervention } the { X, class, C, positive intervention } is deleted from the intervention database because its conflicting intervention SPO { X, class, C, positive intervention } is contained in the intervention database. After time T4, the intervention database includes { X, class, a, negative intervention }, { X, class, B, negative intervention }2 intervention SPOs.
Finally, the intervention SPO in the intervention database comprises:
{ X, classification, A, negative intervention };
{ X, classification, B, negative intervention }.
The SPO extracted from the data source includes:
{ X, class, A }, from data source 1;
{ X, class, B }, from data source 1;
{ X, class, F }, from data source 2;
Since the intervention SPO in the intervention database has a higher priority than the SPO extracted from the data source, the classification of X in the finally constructed knowledge-graph is F.
Example 2, classification of entity "steel", intervention SPO in the intervention database and SPO extracted from the data source at time T1-T4 is as follows:
Time T1:
the classification of the data source 1 providing "steel" includes "mechanical fittings" and "weaponry", so that two SPOs can be extracted from the data source 1, which are respectively: { Steel, classification, mechanical fittings } and { Steel, classification, weaponry }. The intervention is not intervening, the intervention database is empty, and the map attribute values are: "mechanical fittings", "weaponry".
Time T2:
Intervention, wherein the target attribute value is as follows: "weapon equipment", "building material". Since the profile attribute values are: "mechanical accessory", "weapon equipment", therefore, 2 intervention SPOs are first generated based on the intervention operations, the two intervention SPOs being respectively: { Steel, classification, weapon equipment, negative intervention } and { Steel, classification, building Material, positive intervention }. Since the current intervention database is empty, and contains no intervention SPO, { steel, class, weapon equipment, negative intervention } and { steel, class, building material, positive intervention } are written into the intervention database. At time T2, the intervention database includes { steel, class, weaponry, negative intervention } and { steel, class, building material, positive intervention }2 intervention SPO.
Time T3:
The classification of the data source 2 providing "steel" includes "metal", so 1 SPO can be extracted from the data source 2, which SPO is: { steel, classification, metal }, map properties become: "weapon equipment", "building material", "metal". At time T3, the intervention SPO in the intervention database is unchanged, still comprising: { Steel, classification, weapon equipment, negative intervention } and { Steel, classification, building Material, positive intervention }2 intervention SPO.
Time T4:
Intervention intervenes again, with the target property value being "metal". As the current profile attributes become: "weapon equipment", "building material", "metal", so that first 2 intervention SPOs are generated based on the intervention operation, the two intervention SPOs being respectively: { Steel, classification, weapon equipment, negative intervention } and negative intervention { Steel, classification, building Material, negative intervention }. Secondly, for { steel, class, weapon equipment, negative intervention }, since the intervention database does not contain its conflicting intervention SPO, { steel, class, weapon equipment, negative intervention } is written into the intervention database, for { steel, class, building material, negative intervention }, since the intervention database contains its conflicting intervention SPO { steel, class, building material, positive intervention }, the { steel, class, building material, positive intervention } is deleted from the intervention database. At time T4, the intervention database includes { steel, class, machine fitting, negative intervention }, { steel, class, weapon equipment, negative intervention }2 intervention SPO.
Finally, the intervention SPO in the intervention database comprises:
{ steel, classification, mechanical fitting, negative intervention };
{ Steel, classification, weaponry, negative intervention }.
The SPO extracted from the data source includes:
{ Steel, classification, mechanical fittings }, from data Source 1;
{ Steel, classification, weaponry }, from data Source 1;
{ Steel, classification, metal }, from data Source 2;
since the priority of the intervention SPO in the intervention database is higher than that of the SPO extracted from the data source, the classification attribute of the steel in the finally constructed knowledge graph is metal.
As an optional implementation manner of the embodiment of the present invention, referring to fig. 4, on the basis of the steps S201 to S203, the method provided by the embodiment of the present invention further includes: in the above step S201 (determining whether the intervention database contains the conflict data of each intervention data), if the intervention database does not contain the conflict intervention SPO of the first intervention SPO, the above step S202 is performed (deleting the conflict data of the first intervention data from the intervention database), and after the above step S202 is performed, the following step S401 is performed.
S401, writing the first intervention data into the intervention database.
Illustratively, at time T4 of example 1, after { X, category, C, positive intervention } is deleted from the intervention database, { X, category, C, negative intervention } is also written into the intervention database, such that { X, category, a, negative intervention }, { X, category, B, negative intervention } and { X, category, C, negative intervention }3 intervention SPO are included in the intervention database after time T4.
Illustratively, at time T4 of example 2 above, after { steel, classification, building material, positive intervention } is deleted from the intervention database, { steel, classification, building material, negative intervention } is also written into the intervention database, such that after time T4 { steel, classification, machine accessory, negative intervention }, { steel, classification, weapon equipment, negative intervention } and { steel, classification, building material, positive intervention }3 intervention SPO are included in the intervention database.
The above embodiment writes an intervention SPO into an intervention database after deleting the conflicting intervention SPO of the intervention SPO, since the intervention SPO is present in the intervention database and the intervention SPO in the intervention database has a higher priority than the SPO extracted from the data source, even if the SPO that semantically conflicts with the intervention SPO is subsequently extracted from other data sources. SPOs extracted from other data sources may also be covered by the intervening SPO without validating in the knowledge-graph, thereby avoiding that the SPO subsequently extracted from the data source affects the accuracy of the knowledge-graph.
For example: on the basis of the above example 2, SPO { steel, classification, building material }, a number of pre-databases not including { steel, classification, building material, negative intervention }, were again extracted from the data source 3 at time T5, and then the classification properties of steel were metal and building material in the finally constructed knowledge graph. However, building materials are classified by the intention of deletion by intervention, and thus the constructed knowledge graph is inaccurate. The above embodiment further writes { steel, class, building material, negative intervention } into the intervention database, the SPO { steel, class, building material } extracted from the data source 3 would be covered by the intervention SPO { steel, class, building material, negative intervention } so the SPO { steel, class, building material } extracted from the data source 3 would not be validated into the final constructed atlas. In the finally constructed knowledge graph, the classification attribute of the steel is metal.
As an alternative implementation of the embodiment of the invention, each intervention SPO is stored in the MYSQL database with the SP as an index.
That is, the intervention database is a MYSQL database, and the intervention SPO is stored in the intervention database indexed by SP.
The above embodiments are illustrated below by taking the established knowledge graph as an example of the twelve animals whose entities are small. At time T1, the animal of CHINESE BIRTH provided in data source 1 is sheep, and the intervention is not intervening. The intervention at the moment T2 modifies the Ming's Chinese zodiac into tiger. Intervention at the moment T3 is performed again to modify the young Chinese zodiac into cattle. Intervention at time T4 again intervention modifies the small animal of Chinese zodiac into sheep, then the intervention operation at each time, the intervention SPO generated based on the intervention operation, the intervention SPO in the intervention database and the SPO table for constructing the knowledge graph are shown in the following table 1:
TABLE 1
As shown in the above table 1,
At time T1, intervention is not intervening, and the generated intervention SPO, the operation on the intervention database and the SPO in the intervention database are all empty.
At time T2, the target attribute value is: tiger, the map attribute value is: sheep, the resulting intervention SPO included: { Xiaoming, chinese zodiac, sheep, negative intervention } and { Xiaoming, chinese zodiac, tiger, positive intervention }. Since the intervention database does not contain conflicting intervention SPOs of the generated intervention SPO, the operation on the intervention database comprises 2 steps, step 1 being: writing intervention SPO { small Ming, chinese zodiac, sheep, negative intervention }, step 2 is: write intervention SPO { small Ming, chinese zodiac, tiger, positive intervention }. The intervention database includes 2 intervention SPOs, which are respectively: { Xiaoming, chinese zodiac, sheep, negative intervention } and { Xiaoming, chinese zodiac, tiger, positive intervention }.
At time T3, the target attribute value is: the attribute values of the beef atlas are as follows: tiger, thus generated intervention SPO includes: { Xiaoming, chinese zodiac, tiger, negative intervention } and { Xiaoming, chinese zodiac, bovine, positive intervention }. Since the intervention database contains conflict intervention SPO of { small, chinese zodiac, tiger, negative intervention }, and does not contain conflict intervention SPO of { small, chinese zodiac, cow, positive intervention }, the operation on the intervention database comprises 3 steps, step 1 is: deleting intervention SPO { Xiaoming, chinese zodiac, tiger, positive intervention }, step 2 is: writing intervention SPO { small Ming, chinese zodiac, tiger, negative intervention }, step 3 is: write intervention SPO { small Ming, chinese zodiac, bovine, positive intervention }. The intervention database includes 3 intervention SPOs, which are respectively: { Xiaoming, chinese zodiac, sheep, negative intervention }, { Xiaoming, chinese zodiac, tiger, negative intervention }, { Xiaoming, chinese zodiac, cow, positive intervention }.
At time T4, the target attribute value is: sheep, the atlas attribute value is: cattle, the resulting intervention SPO includes: { Xiaoming, chinese zodiac, cattle, negative intervention } and { Xiaoming, chinese zodiac, sheep, positive intervention }. Since the intervention database contains conflict intervention SPO of { small, chinese zodiac, cow, negative intervention }, and conflict intervention SPO of { small, chinese zodiac, sheep, positive intervention }, the operation on the intervention database comprises 4 steps, step 1 is: deleting intervention SPO { small Ming, chinese zodiac, cow, positive intervention }, step 2 is: writing intervention SPO { small Ming, chinese zodiac, cow, negative intervention }, step 3 is: deleting intervention SPO { small Ming, chinese zodiac, sheep, negative intervention }, step 4 is: the intervention SPO { small light, chinese zodiac, sheep, positive intervention }.
As an optional implementation manner of the embodiment of the present invention, the method further includes:
Under the condition that at least two entities are fused into an entity group, and the first entity is selected as a main entity of the entity group, modifying to the first entity of intervention data to be fused and entity of source data to be fused, wherein the source data to be fused comprises all source data of which the entity is a non-main entity of the entity group in the source data extracted from a data source, and the intervention data to be fused comprises all intervention data of which the entity is a non-main entity of the entity group in the intervention database;
and constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source, and generating the knowledge graph after fusing the at least two entities.
Specifically, in the process of fusing data of multiple data sources to construct a knowledge graph, the data sources may have entities with different names and the same entity is marked, in this case, the entities with different names and the same entity are fused into an entity group, and one entity is selected as a main entity of the entity group. For example: the names of the potatoes, the potatoes and the young potatoes are different, but the indicated entities are the same, so that the potatoes, the potatoes and the young potatoes can be fused into a group of entities, and the potatoes are selected as main entities.
Further, after modifying the entity of the intervention data to be fused and the source data to be fused to the first entity, the method further includes:
judging whether the intervention database contains intervention data with opposite semantics;
if the semantics of the third intervention data and the fourth intervention data are opposite, acquiring the time stamps of the third intervention data and the fourth intervention data;
acquiring target intervention data, wherein the target intervention data are intervention data with time stamps behind in the third intervention data and the fourth intervention data;
And controlling the target intervention data to take effect in the process of constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source and generating the knowledge graph after fusing the at least two entities.
As described in the above example, since it is determined whether the conflict data exists before the intervention data is written into the intervention database, if so, the conflict data is deleted, and then the intervention data is written into the pre-database, the intervention data which are mutually conflicting data cannot necessarily exist in the intervention database for the same entity. However, in the process of building the knowledge graph, a plurality of entities may need to be fused into the same entity group, the entity name of the intervention data corresponding to each entity in the fused entity group is modified to be the main entity name of the entity group, and the intervention data acting on each entity in the entity group may be caused to exist in the intervention database, wherein the intervention data are mutually conflicting data of the entity group. For example: the potatoes, the potatoes and the potato seeds are fused into the same entity group, and the potatoes are selected as main entities of the entity group. At time T1, an intervention SPO { potato, classification, vegetable, positive intervention }, is added to the entity group. At time T2, the entity group joins the potato and elects the potato as the primary entity of the entity group. At time T3, another intervention SPO { potato, classification, vegetable, negative intervention }, which is different from the SPO { potato, classification, vegetable, SPO { potato, classification, vegetable }, SPO { potato, classification, vegetable, negative intervention } corresponding to the intervention SPO { potato, classification, vegetable, negative intervention } is added to the entity group, so that the step of deleting and writing first is not performed, and the intervention SPO { potato, classification, vegetable, positive intervention } and the intervention SPO { potato, classification, vegetable, negative intervention } become { potato, classification, vegetable, positive intervention }, { potato, classification, vegetable, negative intervention }, after fusion, which results in unclear semantics of the intervention data.
For the problem that the semantics of the intervention data are unclear, the intervention database cannot perceive the entity change and the main entity change in the entity group, so that the above embodiment identifies the sequence of each intervention data through the time stamp of each intervention data, and when the entities are fused, the semantics of the intervention data conflict with each other to control the time stamp to take effect in the last intervention data, so that the above embodiment can solve the problem that the semantics of the intervention data corresponding to the entity group are unclear under the condition that the semantics of the intervention data are not destroyed.
Based on the same inventive concept, as an implementation of the method, the embodiment of the present invention further provides a device for updating a knowledge graph, where the embodiment of the device corresponds to the embodiment of the method, for convenience of reading, the embodiment of the device does not describe details in the embodiment of the method one by one, but it should be clear that the device for updating a knowledge graph in the embodiment of the present invention can execute each step in the embodiment of the method, and achieve a corresponding effect.
Fig. 5 is a schematic structural diagram of a client provided in an embodiment of the present invention, as shown in fig. 5, an apparatus 500 for updating a knowledge graph provided in the embodiment includes:
an obtaining unit 51, configured to obtain a target attribute value, where the target attribute value is an attribute value of a first attribute of a first entity;
A generating unit 52, configured to generate at least one piece of intervention data according to the target attribute value and a graph attribute value, where the graph attribute value is an attribute value of the first attribute of the first entity in a knowledge graph;
an updating unit 53 for updating the intervention data in the intervention database according to the at least one piece of intervention data;
and a construction unit 54, configured to construct a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source, and generate an updated knowledge graph.
As an optional implementation manner of the embodiment of the present invention, the updating unit 53 is specifically configured to generate intervention data for adding the first attribute value to the knowledge graph when the target attribute value includes the first attribute value and the graph attribute value does not include the first attribute value; if the target attribute value does not include a second attribute value and the map attribute value includes the second attribute value, intervention data for deleting the second attribute value from the knowledge map is generated.
As an optional implementation manner of the embodiment of the present invention, the updating unit 53 is further configured to determine whether the intervention database includes conflict data of each intervention data; if the intervention database contains conflict data of first intervention data, deleting the conflict data of the first intervention data from the intervention database; if the intervention database does not contain conflict data of second intervention data, writing the second intervention data into the intervention database;
Wherein the conflict data of any intervention data is the intervention data with the opposite meaning of the intervention data.
As an optional implementation manner of the embodiment of the present invention, the updating unit 53 is further configured to write the first intervention data into the intervention database in case that the intervention database contains conflicting data of the first intervention data.
As an alternative implementation of the embodiment of the present invention, any intervention data includes: entity, attribute value, and status information; the state information is positive or negative, when the state information is positive, the semantics of the corresponding intervention data are added with the corresponding attribute values, and when the state information is negative, the semantics of the corresponding intervention data are deleted with the corresponding attribute values;
The updating unit 53 is specifically configured to determine whether the intervention database includes intervention data that has the same entity, attribute value, and opposite status information as each of the intervention data; if the intervention database contains intervention data which are the same as the entity, attribute and attribute value of the first intervention data and have opposite state information, determining conflict data containing the first intervention data in the intervention database; and if the intervention database does not contain intervention data which is the same as the entity, attribute and attribute value of the second intervention data and has opposite state information, determining that conflict data of the second intervention data is not contained in the intervention database.
As an optional implementation manner of the embodiment of the present invention, the updating unit 53 is further configured to, when at least two entities are fused into one entity group and the first entity is selected to be a main entity of the entity group, modify to the first entity to be fused intervention data and an entity to be fused source data, where the entity to be fused source data includes source data, of which an entity is a non-main entity of the entity group, in the source data extracted from a data source, and the entity to be fused includes intervention data, of which an entity is a non-main entity of the entity group, in the intervention database;
the construction unit 54 is further configured to perform knowledge graph construction according to the intervention data in the intervention database and the source data extracted from the data source, and generate a knowledge graph after fusing the at least two entities.
As an optional implementation manner of the embodiment of the present invention, the updating unit 53 is further configured to determine whether the intervention database includes intervention data with opposite semantics after modifying an entity of the intervention data to be fused and the source data to be fused into the first entity; if the semantics of the third intervention data and the fourth intervention data are opposite, acquiring the time stamps of the third intervention data and the fourth intervention data; acquiring target intervention data, wherein the target intervention data are intervention data with time stamps behind in the third intervention data and the fourth intervention data; and controlling the target intervention data to take effect in the process of constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source and generating the knowledge graph after fusing the at least two entities.
As an alternative implementation of the embodiment of the present invention, the validation priority of the intervention data is higher than the validation priority of the source data extracted from the data source.
Based on the same inventive concept, the embodiment of the invention also provides electronic equipment. Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 6, where the electronic device provided in this embodiment includes: a memory 61 and a processor 62, the memory 61 for storing a computer program; the processor 62 is configured to perform the steps of the method for updating a knowledge-graph provided by the above embodiment when a computer program is invoked.
The embodiment of the invention also provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for updating the knowledge graph provided by the embodiment are realized.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein.
The processor may be a central processing unit (CentralProcessingUnit, CPU), but may also be other general purpose processors, digital signal processors (DigitalSignalProcessor, DSP), application specific integrated circuits (ApplicationSpecificIntegratedCircuit, ASIC), off-the-shelf programmable gate arrays (Field-ProgrammableGateArray, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may include non-volatile memory in a computer-readable medium, random Access Memory (RAM) and/or non-volatile memory, etc., such as read-only memory (ROM) or flash memory (flashRAM). Memory is an example of a computer-readable medium.
Computer readable media include both non-transitory and non-transitory, removable and non-removable storage media. Storage media may embody any method or technology for storage of information, which may be computer readable instructions, data structures, program modules, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transitorymedia), such as modulated data signals and carrier waves.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (9)

1. A method for updating a knowledge graph, comprising:
acquiring a target attribute value, wherein the target attribute value is an attribute value of a first attribute of a first entity;
Generating at least one piece of intervention data according to the target attribute value and a map attribute value, wherein the map attribute value is an attribute value of the first attribute of the first entity in a knowledge map; any intervention data includes: entity, attribute value, and status information; the state information is positive or negative, when the state information is positive, the semantics of the corresponding intervention data are added with the corresponding attribute values, and when the state information is negative, the semantics of the corresponding intervention data are deleted with the corresponding attribute values;
Updating intervention data in an intervention database according to the at least one piece of intervention data;
constructing a knowledge graph according to the intervention data in the intervention database and source data extracted from a data source, and generating an updated knowledge graph;
Said updating intervention data in an intervention database based on said at least one piece of intervention data comprising:
Judging whether conflict data of each intervention data are contained in the intervention database; conflict data of any intervention data is intervention data with opposite semantics of the intervention data;
If the intervention database contains conflict data of first intervention data, deleting the conflict data of the first intervention data from the intervention database;
If the intervention database does not contain conflict data of second intervention data, writing the second intervention data into the intervention database;
The generating at least one piece of intervention data according to the target attribute value and the map attribute value comprises the following steps:
if the target attribute value contains a first attribute value and the map attribute value does not contain the first attribute value, generating intervention data for adding the first attribute value to the knowledge map;
and if the target attribute value does not contain the second attribute value and the map attribute value contains the second attribute value, generating intervention data for deleting the second attribute value from the knowledge map.
2. The method according to claim 1, wherein the method further comprises:
And writing the first intervention data into the intervention database under the condition that conflict data of the first intervention data are not contained in the intervention database.
3. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The judging whether the intervention database contains conflict data of each intervention data comprises the following steps:
Judging whether the intervention database contains intervention data which have the same entity, attribute and attribute value as the intervention data and opposite state information;
If the intervention database contains intervention data which are the same as the entity, attribute and attribute value of the first intervention data and have opposite state information, determining conflict data containing the first intervention data in the intervention database;
And if the intervention database does not contain intervention data which is the same as the entity, attribute and attribute value of the second intervention data and has opposite state information, determining that conflict data of the second intervention data is not contained in the intervention database.
4. The method according to claim 1, wherein the method further comprises:
Under the condition that at least two entities are fused into an entity group, and the first entity is selected as a main entity of the entity group, modifying to the first entity of intervention data to be fused and entity of source data to be fused, wherein the source data to be fused comprises all source data of which the entity is a non-main entity of the entity group in the source data extracted from a data source, and the intervention data to be fused comprises all intervention data of which the entity is a non-main entity of the entity group in the intervention database;
and constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source, and generating the knowledge graph after fusing the at least two entities.
5. The method of claim 4, wherein after modifying the entity of the intervention data to be fused and the source data to be fused to the first entity, the method further comprises:
judging whether the intervention database contains intervention data with opposite semantics;
if the semantics of the third intervention data and the fourth intervention data are opposite, acquiring the time stamps of the third intervention data and the fourth intervention data;
acquiring target intervention data, wherein the target intervention data are intervention data with time stamps behind in the third intervention data and the fourth intervention data;
And controlling the target intervention data to take effect in the process of constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source and generating the knowledge graph after fusing the at least two entities.
6. The method of any of claims 1-5, wherein the intervention data has a higher validation priority than source data extracted from a data source.
7. The utility model provides a knowledge graph updating device which is characterized in that the device comprises:
The acquisition unit is used for acquiring a target attribute value, wherein the target attribute value is an attribute value of a first attribute of a first entity;
The generation unit is used for generating at least one piece of intervention data according to the target attribute value and the map attribute value, wherein the map attribute value is an attribute value of the first attribute of the first entity in the knowledge map; any intervention data includes: entity, attribute value, and status information; the state information is positive or negative, when the state information is positive, the semantics of the corresponding intervention data are added with the corresponding attribute values, and when the state information is negative, the semantics of the corresponding intervention data are deleted with the corresponding attribute values;
an updating unit for updating the intervention data in the intervention database according to the at least one piece of intervention data;
The construction unit is used for constructing a knowledge graph according to the intervention data in the intervention database and the source data extracted from the data source, and generating an updated knowledge graph;
The updating unit is specifically configured to determine whether the intervention database includes conflict data of each intervention data; conflict data of any intervention data is intervention data with opposite semantics of the intervention data; if the intervention database contains conflict data of first intervention data, deleting the conflict data of the first intervention data from the intervention database; if the intervention database does not contain conflict data of second intervention data, writing the second intervention data into the intervention database;
The generating unit is specifically configured to generate intervention data for adding the first attribute value to the knowledge graph if the target attribute value includes the first attribute value and the graph attribute value does not include the first attribute value; and if the target attribute value does not contain the second attribute value and the map attribute value contains the second attribute value, generating intervention data for deleting the second attribute value from the knowledge map.
8. An electronic device, comprising: a memory and a processor, the memory for storing a computer program; a processor for executing the method of updating a knowledge-graph of any of claims 1-6 when invoking a computer program.
9. A computer readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the method of updating a knowledge-graph of any of claims 1-6.
CN202110185453.6A 2021-02-10 2021-02-10 Method and device for updating knowledge graph Active CN112860912B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110185453.6A CN112860912B (en) 2021-02-10 2021-02-10 Method and device for updating knowledge graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110185453.6A CN112860912B (en) 2021-02-10 2021-02-10 Method and device for updating knowledge graph

Publications (2)

Publication Number Publication Date
CN112860912A CN112860912A (en) 2021-05-28
CN112860912B true CN112860912B (en) 2024-05-07

Family

ID=75989783

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110185453.6A Active CN112860912B (en) 2021-02-10 2021-02-10 Method and device for updating knowledge graph

Country Status (1)

Country Link
CN (1) CN112860912B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113870697A (en) * 2021-09-03 2021-12-31 厦门大学 Exhibit system using knowledge graph

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018006469A1 (en) * 2016-07-07 2018-01-11 深圳狗尾草智能科技有限公司 Knowledge graph-based human-robot interaction method and system
CN108920588A (en) * 2018-06-26 2018-11-30 北京光年无限科技有限公司 A kind of knowledge mapping update method and system for human-computer interaction
CN109902130A (en) * 2019-01-31 2019-06-18 北京明略软件系统有限公司 A kind of date storage method, data query method and apparatus, storage medium
CN110413695A (en) * 2019-07-29 2019-11-05 北京百度网讯科技有限公司 Police affair information management method, apparatus, equipment and medium based on block chain
CN110909168A (en) * 2019-09-23 2020-03-24 腾讯科技(深圳)有限公司 Knowledge graph updating method and device, storage medium and electronic device
CN111090683A (en) * 2019-11-29 2020-05-01 上海勘察设计研究院(集团)有限公司 Engineering field knowledge graph construction method and generation device thereof
CN111475602A (en) * 2020-06-23 2020-07-31 成都数联铭品科技有限公司 Multi-version knowledge graph storage method and device, storage medium and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018006469A1 (en) * 2016-07-07 2018-01-11 深圳狗尾草智能科技有限公司 Knowledge graph-based human-robot interaction method and system
CN108920588A (en) * 2018-06-26 2018-11-30 北京光年无限科技有限公司 A kind of knowledge mapping update method and system for human-computer interaction
CN109902130A (en) * 2019-01-31 2019-06-18 北京明略软件系统有限公司 A kind of date storage method, data query method and apparatus, storage medium
CN110413695A (en) * 2019-07-29 2019-11-05 北京百度网讯科技有限公司 Police affair information management method, apparatus, equipment and medium based on block chain
CN110909168A (en) * 2019-09-23 2020-03-24 腾讯科技(深圳)有限公司 Knowledge graph updating method and device, storage medium and electronic device
CN111090683A (en) * 2019-11-29 2020-05-01 上海勘察设计研究院(集团)有限公司 Engineering field knowledge graph construction method and generation device thereof
CN111475602A (en) * 2020-06-23 2020-07-31 成都数联铭品科技有限公司 Multi-version knowledge graph storage method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN112860912A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
US8307010B2 (en) Data feature tracking through hierarchical node sets
CN108959510B (en) Partition level connection method and device for distributed database
CN110019384B (en) Method for acquiring blood edge data, method and device for providing blood edge data
CN106951231B (en) Computer software development method and device
US11775507B2 (en) Methods and apparatuses for reading and updating data structures, and electronic devices
CN107870949B (en) Data analysis job dependency relationship generation method and system
CN106844369B (en) Objectification SQL sentence construction method and apparatus
CN112860912B (en) Method and device for updating knowledge graph
CN115599764A (en) Method, device and medium for migrating table data
CN107609011B (en) Database record maintenance method and device
US11966732B2 (en) Data structures for managing configuration versions of cloud-based applications
CN113791768A (en) Code generation method and device, storage medium and terminal
CN108241620B (en) Query script generation method and device
CN107491975B (en) Data slot data processing method and device for server and consumer
CN109710698B (en) Data aggregation method and device, electronic equipment and medium
CN117763024A (en) Data fragment extraction method and device
US20190354617A1 (en) Database revalidation using parallel distance-based groups
CN113849482A (en) Data migration method and device and electronic equipment
US11157247B2 (en) Cryptographic digital twin segregation system for development operations
CN110990378A (en) Block chain-based data consistency comparison method, device and medium
CN116644090B (en) Data query method, device, equipment and medium
US20120185493A1 (en) Avoiding duplicate and equivalent data objects in service registries
CN109299125A (en) Database update method and device
CN111338986B (en) Method for acquiring data in three-dimensional model data structure
CN115455035B (en) Data query model construction method and computer-readable 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
GR01 Patent grant
GR01 Patent grant