Reasoning implementation method and apparatus based on labeled property graph data model, and computer device
By extending semantic attributes and transforming user queries in the labeled attribute graph data model, the problem of insufficient reasoning ability of LPG is solved, enabling the provision of fast and accurate reasoning answers.
Patent Information
- Application Number
- PCT/CN2024/096396
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2025-12-04
AI Technical Summary
Existing labeled attribute graph data models (LPG) are insufficient in reasoning capabilities and cannot effectively support multiple semantic attributes, resulting in missing and incomplete reasoning answers.
By expanding and defining the semantic attributes of keywords through relation recognition tools, using a query converter to transform user queries into new forms with semantic attributes, and traversing the LPG database to provide more comprehensive reasoning answers.
It enables fast and accurate reasoning for the labeled attribute graph model, supports reasoning capabilities for symmetric, transitive, and similar semantic attributes, and improves the reasoning ability and data query efficiency of LPG.
Smart Images

Figure CN2024096396_04122025_PF_FP_ABST
Abstract
Description
Methods, apparatus, and computer equipment for inference based on labeled attribute graph data models. Technical Field
[0001] This application relates to graph computing, and more specifically, to a method, apparatus, computer device, and storage medium for reasoning implementation based on a labeled attribute graph data model. Background Technology
[0002] Graph computing utilizes two popular data models: Resource Description Framework (RDF), which uses Subject-Predicate-Object (SPO) to describe the model, and Labeled Property Graph (LPG), which uses nodes, relationships, and attributes to describe the data. RDF is widely used for graph-based reasoning because it has rich schemas to support expressive power and is supported by the extensive technical stack of the Semantic Web. LPG is widely used for graph traversal due to its performance advantages, but its reasoning capabilities are not superior to RDF, and to date, there is no standard or popular method to implement LPG-based reasoning.
[0003] Summary of the Invention
[0004] This summary section is provided to introduce some selected concepts in a simplified form, which will be further described in the detailed description section below. This summary section is not intended to identify any key or essential features of the claimed subject matter, nor is it intended to help determine the scope of the claimed subject matter.
[0005] Based on this, a reasoning implementation method based on a labeled attribute graph data model is provided, comprising: extracting keywords contained in a user query and semantic attributes associated with the keywords; converting the user query into a second query based on the semantic attributes; and providing a reasoning answer based on the labeled attribute graph data model based on the second query.
[0006] The above method can extend the semantics of the labeled attribute graph model, providing more accurate and reasonable reasoned answers to user queries within the labeled attribute graph data model. Furthermore, the method is relatively simple and fast to implement.
[0007] Furthermore, this also includes:
[0008] The semantic attributes are added to the semantic attribute file using the relationship recognition tool.
[0009] The above methods can be used to extend the semantics of the labeled attribute graph model, add reasonable semantic attributes to words, and prepare for providing comprehensive reasoning answers when querying later.
[0010] Furthermore, the semantic attributes are added to the semantic attribute file according to the relation recognition tool, including:
[0011] Based on the relationship recognition tool, symmetric attributes, transitive attributes, and similarity attributes are added to the semantic attribute file.
[0012] By using the above methods, the labeled attribute graph can support three new semantic attributes, thereby increasing the ability of the labeled attribute graph data model to provide accurate reasoning answers.
[0013] Furthermore, the semantic attributes are added to the semantic attribute file according to the relation recognition tool, including:
[0014] The relationship identification tool generates a JSON file, which includes relationship lines representing the keywords and semantic attributes associated with the keywords.
[0015] By using the above method, a JSON file containing keywords and associated semantic attributes is generated, which is easy to read. This allows user queries to be transformed into updated queries, changes the traversal method of the tag attribute graph model, and provides more reasoned answers.
[0016] Furthermore, the generation of a JSON file based on the relationship identification tool includes:
[0017] Define an inference attribute algorithm and domain knowledge; wherein the inference attribute algorithm and the domain knowledge are used to obtain semantic attributes associated with the keyword;
[0018] Add the inference attribute algorithm and the domain knowledge information to the configuration file;
[0019] Based on the configuration file, the relationship identification tool is run to generate the JSON file.
[0020] By using the above methods, attribute algorithms and domain knowledge can be added to define richer semantic attributes. Then, the labeled attribute graph data model can be configured accordingly through relation recognition tools, thereby completing the advance expansion of semantic attributes.
[0021] Furthermore, the step of converting the user query into a second query based on the semantic attribute includes:
[0022] Replace the code related to the semantic attribute in the user query.
[0023] By using the above method, the code in the original user query can be replaced, and then sent to the database later. The database will then perform inference according to the code of the new semantic attributes to obtain the query answer.
[0024] Furthermore, an inference implementation device based on a labeled attribute graph data model includes:
[0025] The extraction module is used to extract keywords contained in user queries and the semantic attributes associated with those keywords;
[0026] A conversion module is used to convert the user query into a second query based on the semantic attributes;
[0027] The implementation module is used to provide an inference answer based on the labeled attribute graph data model, according to the second query.
[0028] This application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0029] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method.
[0030] This application also provides a computer program product tangibly stored on a computer-readable medium and comprising computer-executable instructions that, when executed, cause at least one processor to perform the methods described above. Attached Figure Description
[0031] Implementations of this disclosure are illustrated in the accompanying drawings by way of example rather than limitation, and similar reference numerals in the drawings denote the same or similar parts.
[0032] Figure 1 is a schematic flowchart of a method for reasoning based on a labeled attribute graph data model according to an embodiment of this application.
[0033] Figure 2 is a schematic diagram of an apparatus for reasoning based on a labeled attribute graph data model according to an embodiment of this application.
[0034] Figure 3 is a schematic diagram of a computer device implementing reasoning based on a labeled attribute graph data model according to an embodiment of this application.
[0035] The reference numerals in the accompanying drawings are as follows: S101-S104 Step 200: Device 201: Module 202: Module 203: Module 204: Module 300: Computer device 302: Processor 304: Memory Detailed Implementation
[0036] In the following description, numerous specific details are set forth for illustrative purposes. However, it will be understood that the invention can be implemented without these specific details. In other instances, well-known circuits, structures, and techniques have not been shown in detail so as not to affect the understanding of the description.
[0037] Throughout the specification, references to "an implementation," "implementation," "exemplary implementation," "some implementations," "various implementations," etc., indicate that the implementation of the invention described may include specific features, structures, or characteristics. However, it is not implied that every implementation must include these specific features, structures, or characteristics. Furthermore, some implementations may have some, all, or none of the features described for other implementations.
[0038] The implementation scenario of this application is as follows: First, let's introduce the labeled attribute graph, which is a graph-type data model composed of nodes and connections. Circular nodes represent important data terms such as names of people and devices, while connections represent relational data terms such as verbs or nouns. A connection from one circular node to another indicates a relationship between the two nodes. Typically, this connection relationship can be labeled with text on the connection. For example, a connection between a node representing a person's name and another node representing a person's name, labeled "know," indicates that this person knows the other person. Similarly, a connection between a node representing a device and another node representing a driving relationship, such as one device driving another, can be labeled with "implement." However, due to the large number of nodes and the fact that historical records only show connections in a single direction, it's impossible to extrapolate or provide logically consistent answers. In other words, the labeled attribute graph does not support certain semantic attributes, hindering its use. Therefore, we aim to develop a solution that allows the labeled attribute graph to easily and quickly acquire these attributes, supporting user queries and other usage scenarios.
[0039] As mentioned above, there is currently no convenient and quick method to extend the semantic attributes of LPG. Because LPG cannot support multiple semantic attributes, the inference results provided are incomplete and lacking in comprehensiveness. To address this problem, this application discloses a method for extending the corresponding semantic attributes of LPG. Specifically, it expands and defines the semantic attributes of different keywords using a relation recognition tool. Then, a query converter identifies keywords containing special semantic attributes in user queries. For these keywords, the corresponding code is rewritten, transforming the user query into another query form, which is then sent to the LPG database. The database then traverses the data according to the new code, thereby obtaining a more comprehensive and accurate inference answer.
[0040] This application discloses a reasoning implementation method based on a labeled attribute graph data model, which includes:
[0041] S101, extract the keywords contained in the user query and the semantic attributes associated with the keywords.
[0042] For example, a query is received from an end user, containing keywords that are associated with certain semantic attributes. For instance, a received user query might be "I want to query people Jemmy Li knows," where "know" is a keyword. Another example is "I want to query all Bess Schrader's colleagues," where "colleagues" is a keyword. Yet another example is "I want to query all software that implements TinkerPop," where "implement" is a keyword. In some embodiments, a query converter is used to extract or identify these specific keywords from the query. After receiving the user's query, the query converter refers to a definition file for a semantic attribute, such as a JSON file, to extract the corresponding keywords and their associated semantic attributes.
[0043] After obtaining the keywords, the semantic attributes related to those keywords can be retrieved using the JSON file and a query converter. For example, for "know," the associated symmetric attributes can be retrieved. Similarly, for "colleague," the associated transitive attributes can be retrieved. Furthermore, for "implement," the associated similar attributes can be retrieved.
[0044] The semantic attributes of these keywords can be defined in advance or generated through preprocessing in the JSON file. For example, in some embodiments, a relationship recognition tool can generate these semantic attributes. The relationship recognition tool can utilize inference algorithms or specific domain knowledge to generate logical semantic attributes for the aforementioned keywords.
[0045] Taking "know" as an example, when Zheny Zhang knows Jemmy Li, it means that Jemmy Li also knows Zheny Zhang. Mathematically, this can be expressed as:
[0046] For if xRy, then yRx, so R is symmetric.
[0047] Therefore, the word "know" is marked as a symmetric attribute in the semantic attribute file, which is the JSON file.
[0048] Taking "colleagues" as an example, Bess Schrader's colleagues (colleagues) are Matthias Broecheler, and Sarak Pratik is Matthias Broecheler's colleague; therefore, Sarak Pratik is also Bess Schrader's colleague. Mathematically, this means:
[0049] For if xRy and yRz, then xRz, so R is transitive
[0050] Therefore, the word "colleagues" is marked as transitive in the semantic attribute file, which is the JSON file.
[0051] Similarly, for `implement`, since its meaning is similar to `perform`, it can be defined that `implement` and `perform` have similar attributes. Therefore, in the semantic attribute file, i.e., the JSON file, `implement` is marked as having similar attributes to `perform`.
[0052] Therefore, based on the above description, the semantic attributes are added to the semantic attribute file according to the relationship recognition tool.
[0053] Furthermore, based on the relationship recognition tool, the semantic attributes are added to the semantic attribute file, including:
[0054] Based on the relationship recognition tool, symmetric attributes, transitive attributes, and similarity attributes are added to the semantic attribute file.
[0055] And according to the relation recognition tool, the semantic attributes are added to the semantic attribute file, including:
[0056] The relationship identification tool generates a JSON file, which includes relationship lines representing the keywords and semantic attributes associated with the keywords.
[0057] And based on the relationship identification tool, a JSON file is generated, including:
[0058] Define an inference attribute algorithm and domain knowledge; wherein the inference attribute algorithm and the domain knowledge are used to obtain semantic attributes associated with the keyword;
[0059] Add the inference attribute algorithm and the domain knowledge information to the configuration file;
[0060] Based on the configuration file, the relationship identification tool is run to generate the JSON file.
[0061] When a keyword is identified as having a certain semantic attribute through reasoning algorithms or domain knowledge, a relation recognition tool can be used to mark the keyword as having a certain semantic attribute in the semantic attribute file, i.e., the JSON file.
[0062] For example, in some embodiments, when keywords exist in the form of connecting lines, such as Jemmy Li→Linary Li, the arrowed connecting lines represent the keyword "know". The symmetric attribute of "knows" can be represented as Symmetric:yes, and this symmetric attribute is attached to or associated with the area surrounding the connecting lines. As another example, in Bess Schrader→Matthias Broecheler, the arrowed connecting lines represent the keyword "colleagues". The transitive attribute of "colleagues" can be represented as transitive:yes, and this transitive attribute is attached to or associated with the area surrounding the connecting lines. Furthermore, the aforementioned symmetric attribute "Symmetric:yes" can also be attached to or associated with the area surrounding the "colleagues" connecting lines, indicating that "colleagues" also possesses a symmetric attribute. In terms of meaning, if one person is another person's colleague, then both should be colleagues; therefore, it is clear that the keyword "colleagues" possesses a symmetric attribute.
[0063] For similar attributes, matching and accumulation can be achieved through domain knowledge. For example, through domain knowledge, the similarity patterns between implement and perform can be summarized. Thus, when the keyword implement is identified, perform will also be used as a similar keyword for the same reasoning.
[0064] In some embodiments, the keywords and semantic attributes may be stored in a semantic attribute file or a JSON file, in the form of a marked attribute graph, or in other forms, which this application does not limit. The purpose of the semantic attribute file is that, after being read by the query converter, it allows the query converter to discover or match keywords and corresponding special semantic attributes in the user query based on the semantic attribute file. Therefore, in some embodiments, the semantic attribute file serves as a reference.
[0065] S102, based on the semantic attributes, convert the user query into a second query.
[0066] Using the aforementioned markers, after the query converter reads the semantic attribute file (i.e., after reading the JSON file), it can identify and match the keywords in the received user query, and simultaneously obtain the semantic attributes of the keywords through the JSON file.
[0067] After identifying keywords with special semantic attributes in the query, the query converter needs to update the user query into a more suitable query statement. This allows the database to traverse to the appropriate nodes to retrieve data. The updated query statement can be called the second query. Specifically, the query converter needs to convert the code related to semantic attributes in the user query into new code for database execution.
[0068] For example, for the user query "I want to query people Jemmy Li knows", since "know" contains a symmetric attribute, the original code is:
[0069] gV().hasLabel('person').has('name','Jemmy Li').out('knows').ValueMap('name').dedup().toList()
[0070] The updated code is as follows:
[0071] gV().hasLabel('person').has('name','Jemmy Li').both('knows').ValueMap('name').dedup().toList()
[0072] In this case, code similar to In / Out has been replaced with both.
[0073] For example, for the user query "I want to query all Bess Schrader's colleagues", because "colleagues" contains a passed attribute, the original code is:
[0074] gV().hasLabel('person').has('name"BessSchrader').out('colleague').ValueMap('name').dedup().toList()
[0075] The updated code is as follows:
[0076] gV().hasLabel('person').has('name"BessSchrader').out('colleague').emit().repeat(out('colleague')) ValueMap('name').dedup().toList()
[0077] Specifically, code like `In / Out($edge)` is replaced with `in / out($edge).emit().repeat(in / out($edge))`.
[0078] For example, in the user query "I want to query all software that implements TinkerPop", because the "implement" attribute is predefined, the original code...
[0079] gV().hasLabel('art').has('name','TinkerPop').in('implement').ValueMap('name').dedup().toList()
[0080] The updated code is as follows:
[0081] gV().hasLabel('art').has('name','TinkerPop').in('implement','performs').ValueMap('name').dedup().toList()
[0082] In summary, converting the user query into a second query based on the semantic attribute includes replacing the code related to the semantic attribute in the user query.
[0083] By using the above method, the code in the original user query can be replaced, and then sent to the database later. The database will then traverse the nodes according to the new code.
[0084] S103, based on the second query, provide an inference answer based on the labeled attribute graph data model.
[0085] After converting the user query into a second query, the query converter sends the second query to the database for execution, thereby obtaining a comprehensive and accurate reasoning answer.
[0086] In some embodiments, the data stored in the database may be in the form of a labeled attribute graph.
[0087] In some embodiments, the solution of this application can be described as follows: There are methods for implementing LPG structured data inference, such as converting data from LPG to RDF. For example, Neo4j supports exporting data and converting it to an SPO definition, then importing it into an RDF database for inference via SPARQL. Additionally, Apache Gremlin supports compiling SPARQL into LPG traversal to accept inference queries, but it only supports some basic operations of SPARQL 1.0, such as Union, Optional, Order-by, Group-by, etc. Currently, it remains disconnected, lacking interoperability between RDF and LPG.
[0088] This application addresses the aforementioned problems through two main aspects: 1. Extending the semantic attributes of LPG patterns. 2. Modifying traversal behavior to react to semantic attributes. A configuration-based approach is used, and automation is added to attribute definitions to accelerate preprocessing.
[0089] 1. Extend the semantic attributes of LPG mode
[0090] Symmetric, Transitive, and SimilarWith are some commonly used semantic attributes that need to be supported. This application will choose them as examples to illustrate how to extend LPG schemas to support semantic relations. In the use case below, Know is a typical symmetric relation, and this application adds the semantic attribute "Symmetric:yes" to this relation.
[0091] As shown in Figure 4, Jemmy Li knows Linary Li, and Zhonge Zhang knows Jemmy Li. Therefore, when querying who Jemmy Li knows, Zhonge Zhang should also appear, because knowing is a symmetric relation.
[0092] The mathematical description is as follows:
[0093] For if xRy, then yRx, so R is symmetric.
[0094] In the use case below, "colleague" is a transitive relation. This application adds the semantic attribute "transitive:yes" to this relation.
[0095] As shown in Figure 5, Bess Schrade's colleague is Matthias Broecheler, and Sarak Pratik is Matthias Broecheler's colleague, so Sarak Pratik should also be Bess Schrade's colleague. Furthermore, the colleague relationship is symmetric, so Stephen Mallette is also Bess Schrade's colleague. Mathematically, this would be...
[0096] For if xRy and yRz, then xRz, so R is transitive.
[0097] In the use case below, "Implement" and "Perform" are similar. This application adds the semantic attribute "SimilarWith" to the semantic attribute configuration because the definition of similarity differs across domains and is typically created based on domain knowledge. Therefore, preprocessing of the existing dataset is necessary to extract such semantic attributes.
[0098] As shown in Figure 6, TinkerPop is implemented by HugeGraph and also performed by Titan. Based on the aforementioned technical knowledge, the implementation should be similar to the execution. When querying "execution", the graph traversal should also include "implementation".
[0099] This application compares how RDF defines semantic properties and designs LPG semantic properties. RDF's definition is similar to the OWL (Web Ontology Language) schema, which defines symmetric properties, asymmetric properties, transitive properties, and reflexive properties. This application, if approved, adds inference properties to update the LPG schema.
[0100] An LPG is a tuple(V,E,ρ,λ,δ)where
[0101] V is a finite set of certices(or nodes)
[0102] ρ:E→(V×V)is a total function;
[0103] λ:(V∪E)→Labels is a total function;
[0104] σ: (V∪E)×Props→values is a partial function
[0105] σ′: (E×E)×Props→is an inference function
[0106] Mathematical inference properties include, for example, symmetric, asymmetric, and transitive properties.
[0107] The above explains how to extend LPG schemas using semantic attributes. Some semantic attributes are added directly to the attributes of a relation, while others are defined in the definition file based on domain knowledge.
[0108] 2. Modify traversal behavior to react to semantic attributes.
[0109] After defining semantic attributes in the relation, this application needs to modify the existing traversal behavior to respond to these attributes. Figure 7 is an overall architecture diagram showing how it works.
[0110] When a user submits a query to search for data from a graph database, the query converter checks for the existence of semantic attributes related to the query. If so, the query converter replaces the original Gremlin query execution plan with a new one based on the different attributes, and then passes the replaced Gremlin query to the graph database for execution. Relationship identification tools are used to extract semantic attributes based on domain knowledge.
[0111] The process view is as follows:
[0112] The relation identification tool will be based on domain knowledge and algorithms, adding semantic attributes, such as "SimilarWith," to the edges before any query, which this application refers to as preprocessing. The end user only needs to input a query, and the query converter will identify all relevant edges, or relevant connections, then match them with semantic attributes, and update the query if necessary. The updated query will then be sent to the database for execution.
[0113] Figure 4 illustrates how the query is updated when a symmetric property exists:
[0114] For knowledge relationships with symmetric properties, the query language will be updated to use both() instead of in() / out(), so that nodes in both directions will be retrieved.
[0115] Figure 5 illustrates how to update a query when there are transitive attributes:
[0116] For colleague relationships with transitive attributes, the query language will be updated to add `emit().repeat()` instead of `in / out()` for the current node in order to retrieve related nodes. Furthermore, if the relationship has multiple semantic attributes, it will apply multiple schemas and update the query together.
[0117] Figure 6 shows how to update the query when the SimilarWith property is present:
[0118] Since SimilarWith has already determined the relationship between implementation and execution, it will replace the query with ('implements', 'performs') when the query contains ('implements').
[0119] Using the method described above, this application leverages LPG natively to achieve inference capabilities, instead of using an RDF stack for transformation. Now, LPG offers fast query and inference capabilities. This approach is a lightweight solution because it does not require data copying or the introduction of new languages and stacks.
[0120] From a business perspective: LPG is widely used in graphical data querying. With this method, any solution based on LPG graphs can quickly acquire reasoning capabilities to perform root cause analysis, classification, and other analyses, thereby more effectively helping with decision-making.
[0121] From a technical perspective: Unlike existing solutions, this approach does not rely on the RDF stack and requires no conventional work. It is fully compiled with the LPG stack and offers higher performance compared to RDF. This approach can be easily applied to any LPG-based dataset. Relation recognition tools can easily update existing datasets to include semantic attributes without redefining them from scratch. This is also an exploration of unifying RDF and LPG capabilities into a single solution.
[0122] Examine the graph database schema, whether online or exported, to see if they use similar methods to define semantic attributes. You can also check the execution logs to see if the query language has been replaced using the same method (upgrade the Gremlin query language).
[0123] In addition, it's necessary to check whether any tools have subsequently added attributes representing semantic relationships. These are stored in YAML or JSON files.
[0124] It should be understood that although the steps in the flowchart of Figure 1 are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in Figure 1 may include multiple steps or multiple stages, which are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.
[0125] Figure 2 provides an inference implementation device 200 based on a labeled attribute graph data model, which includes:
[0126] The receiving module 201 is used to extract the keywords contained in the user query and the semantic attributes associated with the keywords;
[0127] The conversion module 202 is used to convert the user query into a second query based on the semantic attributes.
[0128] The implementation module 203 is used to provide a reasoning answer based on the labeled attribute graph data model according to the second query.
[0129] It should be noted that the device may contain more or fewer modules to implement the described functions. For example, at least one module in FIG2 may be further divided into a plurality of different sub-modules, each sub-module being used to perform at least a portion of the operations described herein in conjunction with the corresponding module. Furthermore, in some examples, device 200 may also include additional modules for performing other operations already described in the specification. Moreover, those skilled in the art will understand that the exemplary device 200 may be implemented using software, hardware, firmware, or any combination thereof.
[0130] Figure 3 provides a computer device. According to one embodiment, the computer device 300 may include a processor 302 that executes a computer program stored in a memory 304. When executed by the processor, the computer program implements the method described above.
[0131] Those skilled in the art will understand that the structure shown in Figure 3 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or may combine certain components, or may have different component arrangements.
[0132] Those skilled in the art will understand that all or part of the processes in the methods described above can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0133] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the above steps.
[0134] This application also provides a computer program product tangibly stored on a computer-readable medium and including computer-executable instructions that, when executed, cause at least one processor to perform the methods described above.
[0135] Furthermore, the computer program can be stored and run in the cloud to execute the method. Furthermore, the components of the program can be deployed on multiple devices or in the cloud; for example, corresponding steps can be deployed and run on a local computer, or run on different cloud devices, transmitting signals via communication connections, or they can also be deployed and run on a local computer. This application does not limit the described approach or method; corresponding technologies can be flexibly deployed and fully utilized to execute and complete the method using cloud computing, big data, supercomputing capabilities, and other equipment and technologies.
[0136] Some implementations of this disclosure may include an article of art. The article of art may include a storage medium for storing logic. Examples of storage media may include one or more types of computer-readable storage media capable of storing electronic data, including volatile or non-volatile memory, removable or non-removable memory, erasable or non-erasable memory, writable or rewritable memory, and so on. Examples of logic may include various software units, such as software components, programs, applications, computer programs, application programs, system programs, machine programs, operating system software, middleware, firmware, software modules, routines, subroutines, functions, methods, procedures, software interfaces, application programming interfaces (APIs), instruction sets, computational code, computer code, code segments, computer code segments, words, values, symbols, or any combination thereof. In some implementations, for example, the article of art may store executable computer program instructions that, when executed by a processor, cause the processor to perform the methods and / or operations described herein. Executable computer program instructions may include any suitable type of code, such as source code, compiled code, interpreted code, executable code, static code, dynamic code, and so on. Executable computer program instructions can be implemented according to a predefined computer language, method, or syntax used to command the computer to perform specific functions. These instructions can be implemented using any suitable high-level, low-level, object-oriented, visual, compiled, and / or interpreted programming language.
[0137] The examples described above include those of the disclosed architecture. It is certainly impossible to describe every conceivable combination of components and / or methods, but those skilled in the art will understand that many other combinations and arrangements are also possible. Therefore, this novel architecture is intended to cover all such alternatives, modifications, and variations that fall within the spirit and scope of the appended claims.
Claims
1. A method (100) for implementing reasoning based on a labeled property graph data model, wherein, comprising: extracting keywords contained in a user query and semantic attributes associated with the keywords; converting the user query into a second query according to the semantic attributes; providing an inference answer based on a labeled property graph data model according to the second query.
2. The method (100) of claim 1, wherein further comprising: adding the semantic attributes into a semantic attribute file according to a relationship identification tool.
3. The method (100) of claim 2, wherein adding the semantic attributes into a semantic attribute file according to a relationship identification tool, comprising: adding symmetric attributes, transitive attributes and similar attributes into the semantic attribute file according to a relationship identification tool.
4. The method (100) of claim 2, wherein adding the semantic attributes into a semantic attribute file according to a relationship identification tool, comprising: generating a JSON file according to the relationship identification tool, wherein the JSON file comprises relationship connections representing the keywords and semantic attributes associated with the keywords.
5. The method (100) of claim 4, wherein generating a JSON file according to the relationship identification tool, comprising: defining an inference attribute algorithm and domain knowledge, wherein the inference attribute algorithm and the domain knowledge are used to obtain the semantic attributes associated with the keywords; adding information of the inference attribute algorithm and the domain knowledge to a configuration file; running the relationship identification tool to generate the JSON file according to the configuration file.
6. The method (100) of claim 1, wherein the converting the user query into a second query according to the semantic attributes, comprising: replacing codes about the semantic attributes in the user query.
7. An inference implementation apparatus (200) based on a labeled property graph data model, wherein, comprising: an extracting module (201) configured to extract keywords contained in a user query and semantic attributes associated with the keywords; a converting module (202) configured to convert the user query into a second query according to the semantic attributes; an implementing module (203) configured to provide an inference answer based on a labeled property graph data model according to the second query.
8. A computer device comprising a memory and a processor, the memory storing a computer program, wherein, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 6.
9. A computer readable storage medium having stored thereon a computer program, wherein, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.
10. A computer program product tangibly stored on a computer readable medium and comprising computer executable instructions that, when executed, cause at least one processor to perform the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Knowledge reasoning method, device and equipment for attribute graph
CN112182251A
Knowledge graph data processing method and device based on attribute graph
CN112256927A
Intelligent construction site management method and management platform based on knowledge graph
CN115689470A
System and method for security planning with soft security constraints
US20080168529A1
Query semantic parsing in knowledge base question answering
WO2021257161A1