The present invention relates generally to the field of knowledge graphs, and more particularly to generating rules from embeddings in a knowledge graph.P
In knowledge representation and reasoning, knowledge graph is a knowledge base that uses a graph-structured data model or topology to integrate data. Knowledge graphs are often used to store interlinked descriptions of entities—objects, events, situations or abstract concepts—with free-form semantics. Entities are represented by nodes, and facts by relationships between the nodes. Many large knowledge graphs have been created over the last several years to support intelligent applications. These intelligent applications (e.g., question answering, fact checking, and knowledge graph completion) employ rules derived from the data in the knowledge graph to successfully infer additional facts and provide conclusions to a user. The rules are generally written manually, or generated based on nodes and relational information in the knowledge graph. These rules or constraints on the data are also referred to as ontology information for a given knowledge graph. The use of diagrams in formal logic reasoning has generated a great deal of interest in recent years due to the need to visualize complex logic problems that are difficult to understand. The term diagram refers to a graphical representation of how objects in a domain are interconnected or interrelated to one another. In logic reasoning, the central diagram in question is the Venn diagram, a well-known diagramming technique that is used to graphically represent relations among sets.
According to one embodiment of the present invention, a computer-implemented method, a computer program product, and a computer system are provided for deriving rules for a knowledge graph. The rules derived for the knowledge graph provide additional data for deductive and inductive reasoning by intelligent applications. A processor derives existential rules from knowledge graph data. A processor represents a knowledge graph using a geometric embedding. A processor transforms the geometric embedding to a syllogism logic representation using geometric relationships. A processor derives existential rules using standard transformation rules present in the syllogism logic representation.
According to one embodiment of the present invention, a computer-implemented method is provided for deriving rules for a knowledge graph. These rules improve the ability for intelligent application to meaningfully interpret data contained within the knowledge graph. A processor divides a knowledge graph into classes. A processor organizes geometric embeddings for entities in the knowledge graph. A processor constructs premises. The premises may include syllogistic relationships for a pair of classes. A processor transforms the geometric embeddings into Venn diagrams. A processor transforms the Venn diagrams into Venn diagrams with shading and x-sequence using the premises. A processor derives conclusive rules using the Venn diagrams with shading and x-sequence.
According to one embodiment of the present invention, a computer-implemented method is provided for deriving rules for a knowledge graph. These rules improve the ability for intelligent application to meaningfully interpret data contained within the knowledge graph. A processor divides a knowledge graph into classes. A processor organizes geometric embeddings for entities in the knowledge graph. A processor constructs premises. The premises may include syllogistic relationships for a pair of classes. A processor transforms the geometric embeddings into Carroll's diagrams. A processor transforms, using the premises, the Carroll's diagrams into transformed Carroll's diagrams having 1's or 0's. A processor derives conclusive rules using the transformed Carroll's diagrams.
The disclosed embodiments include a framework for learning rules from a knowledge graph. The framework uses logical relationships, such as those represented in diagrams (e.g., Venn diagrams, Carroll's diagrams), to construct logic proofs.
Knowledge graphs are typically constructed in a format known as semantic triple format, a semantic triple, Resource Description Framework (RDF) triple, or simply “triple.” The triple is the atomic data entity in knowledge graphs. As its name indicates, a triple is a set of three entities that codifies a statement about semantic data in the form of subject—predicate— object expressions (e.g., John is 38, or Bob knows John). The triple format representation of knowledge graphs is effective in representing structured data, but the underlying symbolic nature of such triples usually makes knowledge graphs hard to manipulate.
To improve manipulation of the data within the knowledge graph, and support intelligent applications using the data within the knowledge graph, the embodiments disclosed herein use knowledge graph embedding, which is a process by which a system embeds entities and relations into continuous vector spaces. This knowledge graph embedding simplifies the manipulation while preserving the inherent structure of the knowledge graph. Current embedding techniques, however, are prohibitively restrictive in capturing existential rules. Comprehensive integration of neural embeddings and Knowledge Representation is required to develop methods that combine deductive and inductive reasoning in a tighter way than current approaches.
Turning now to the figures,
R=∀x∀y(B[x,y]→∃zH[y,z])
That is, for all x vectors and all y vectors input into a body B, there exists a vector z for which there is a head having y and z vectors. Examples of existential rules 104 include:
The rules generator 102 may access the knowledge graph 108 through a network connection 112, with the knowledge graph 108 located on an external storage device 114. The network connection 112 may also enable client devices 116 to have access to the knowledge graph 108 or the existential rules 104. The rules generator 102 derives the existential rules 104 in the knowledge graph 108 that includes classes 120. The knowledge graph 108 may include any number of classes 120. With the motivation and background for the rules generator 102 to create the existential rules 104, we turn to the process of creating the existential rules 104.
A second geometric relationship 402-2 illustrates a geometric embedding in which all examples of the first class 404 are included within a third class 410. The second geometric relationship 402-2 could illustrate, for example, the data represented in
The rules generating program 130 also transforms the geometric embedding to a syllogism logic representation 124 (block 204). A syllogism, as used herein, is an argument in which a conclusion is inferred from its premises. The syllogism is valid when the conclusion cannot be false when the premises of the syllogism are true. The transforming of the geometric embedding may include a two-step transformation, the first step being the transformation of geometric relationships (e.g., geometric relationships 402 illustrated in
The rules generator 102 also transforms the second transformed geometric relationship 422-2 into a second syllogism logic representation 424-2. The second syllogism logic representation 424-2 is transformed using an A form premise to shade a shaded area 428 indicating that all of the datapoints 106 in the first class 404 are datapoints in the third class 410. That is, the knowledge graph 108 does not have any datapoints 106 in the first class 404 unless the datapoints are also in the third class 410. The rules generator 102 transforms the third transformed geometric relationship 422-3 into the third syllogism logic representation 424-3 using the null premise, which still represents that the datapoints 106 are unrelated to other classes in the knowledge graph 108.
With the syllogism logic representations 124 transformed, the rules generating program 130 derives the existential rules 104 using standard transformation rules present in the syllogism logic representations 124 (block 206). The syllogism logic representations 124 have an advantage in the representation of partial knowledge, and can be combined to add successively more knowledge to the knowledge graph 108 as a whole, and to any applications accessing the knowledge graph 108. That is, when the rules generator 102 determines additional syllogism logic representations 124 the rules generator 102 can combine the syllogism logic representations 124 by putting in more x's 426 and shadings 428 into appropriate areas of a combination Venn diagram. This capability endows Venn diagrams with a more dynamic quality and enables us to manipulate diagrams to determine whether a syllogism is valid or not.
Deriving the existential rules 104 may include the application of manipulation rules (“MR”) to the syllogism logic representations 124. For example, the MRs may include Unification MRs, Resolution MRs, or Transformation MRs. Unification MRs unify each of the diagrams created above into a unified diagram. Resolution MRs resolve any conflicts on the unified diagram. Transformation MRs draw a conclusion diagram that represents the facts that the conclusion of an existential rule 104 conveys. The examples given below (i.e., in
The Unification MRs include U.1: Copying circles to the unified diagram; U.2: Copying corresponding shadings to the unified diagram; U.3: Copying corresponding a-sequences to the unified diagram; and U.4: Inclusion of all compartments of a region in an a-sequence.
Resolution MRs include R.1: determining an inconsistent diagram based on a-sequence and shading; and R.2: erasure of part of an x-sequence in a shaded compartment. R.1 applies to diagrams that have x-sequences that are entirely contained in shaded compartments. Such a diagram represents inconsistent information. That is, the knowledge graph 108 cannot have one datapoint 106 (represented by the x-sequence) and no datapoints 106 (represented by the shading) in the same combination of classes. The inconsistent diagram, as resolved by R.1, indicates that the underlying premises must be reconsidered.
Once the rules generator 102 has combined information from the premises into the unified diagram using the Unification MRs, and then resolved any conflicts using the Resolution MRs, the next step is to transform the resolved unified diagram into a conclusion diagram using the Transformation MRs. The rules generator 102 uses two types of Transformation MRs: erasing information from the diagram, and extending an x-sequence. Specifically, the Transformation MRs include: T.1: Erasure of shading in a compartment; T.2: Erasure of a whole x-sequence; T.3: Erasure of a circle; T.3.a: A partial shading in a compartment; T.3.b: An x-sequence with more than one x-sequence in a compartment; T.4: Lengthening an x-sequence.
Venn diagrams are not the only way that the rules generator 102 may transform geometric embeddings to syllogism logic representations and derive existential rules. A variety of logic representations may be used to derive the existential rules 104 from the knowledge graph 108. For example, one additional representation that the rules generator 102 may use is a Carroll's Diagram.
Employing these premises, the rules generator 102 breaks up the proposition “All Masters are Bachelors” into “some Masters are Bachelors” and “no Masters is not Bachelors.” The rules generator 102 then maps a first syllogism logic representation 1224-1 for “no Masters is not Bachelors” by marking cells 1202 marked “B′MP” and “B′MP′” with a 0. The rules generator 102 then maps a second syllogism logic representation 1224-2 for “some Masters are Bachelors” by marking the border between cells 1202 “BMP” and “BMP′” with a 1. The rules generator 102 also maps a third syllogism logic representation 1224-3 for “some PhDs are Masters” by marking the cell 1202 marked “BMP” with a 1.
The rules generator 102 may then derive existential rules 104 by using transformation rules that are standard for the Carroll's Diagrams. The transformation rules dictate that for each quarter of the trilateral diagram 1200, select one of three options: if there is a ‘1’ in either cell, mark the quarter with a ‘1’; if there is a ‘0’ in both cells, mark the quarter with a ‘0’; or else transfer nothing. The result of the transformation rules is a bilateral diagram that gives the complete conclusion (if it exists) of the syllogism.
The computing device 1400 includes communications fabric 1402, which provides communications between RAM 1414, cache 1416, memory 1406, persistent storage 1408, communications unit 1410, and input/output (I/O) interface(s) 1412. Communications fabric 1402 can be implemented with any architecture designed for passing data and/or control information between processors (such as microprocessors, communications and network processors, etc.), system memory, peripheral devices, and any other hardware components within a system. For example, communications fabric 1402 can be implemented with one or more buses or a crossbar switch.
Memory 1406 and persistent storage 1408 are computer readable storage media. In this embodiment, memory 1406 includes random access memory (RAM). In general, memory 1406 can include any suitable volatile or non-volatile computer readable storage media. Cache 1416 is a fast memory that enhances the performance of computer processor(s) 1404 by holding recently accessed data, and data near accessed data, from memory 1406.
The software components (e.g., rules generating program 130) may be stored in persistent storage 1408 and in memory 1406 for execution and/or access by one or more of the respective computer processors 1404 via cache 1416. In an embodiment, persistent storage 1408 includes a magnetic hard disk drive. Alternatively, or in addition to a magnetic hard disk drive, persistent storage 1408 can include a solid state hard drive, a semiconductor storage device, read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, or any other computer readable storage media that is capable of storing program instructions or digital information.
The media used by persistent storage 1408 may also be removable. For example, a removable hard drive may be used for persistent storage 1408. Other examples include optical and magnetic disks, thumb drives, and smart cards that are inserted into a drive for transfer onto another computer readable storage medium that is also part of persistent storage 1408.
Communications unit 1410, in these examples, provides for communications with other data processing systems or devices. In these examples, communications unit 1410 includes one or more network interface cards. Communications unit 1410 may provide communications through the use of either or both physical and wireless communications links. The proxy, application, access manager, collection page, authentication tool, or multi-factor authentication page may be downloaded to persistent storage 1408 through communications unit 1410.
I/O interface(s) 1412 allows for input and output of data with other devices that may be connected to the computing device 1400. For example, I/O interface 1412 may provide a connection to external devices 1418 such as a keyboard, keypad, a touch screen, and/or some other suitable input device. External devices 1418 can also include portable computer readable storage media such as, for example, thumb drives, portable optical or magnetic disks, and memory cards. Software and data used to practice embodiments of the present invention (e.g., rule generating program 130) can be stored on such portable computer readable storage media and can be loaded onto persistent storage 1408 via I/O interface(s) 1412. I/O interface(s) 1412 also connect to a display 1420.
Display 1420 provides a mechanism to display data to a user and may be, for example, a computer monitor.
The present invention may be a system, a method, and/or a computer program product at any possible technical detail level of integration. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention.
The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.
Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, configuration data for integrated circuitry, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++, or the like, and procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
These computer readable program instructions may be provided to a processor of a computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the Figures. For example, two blocks shown in succession may, in fact, be accomplished as one step, executed concurrently, substantially concurrently, in a partially or wholly temporally overlapping manner, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions.