CN106649266A - Logical inference method for ontology knowledge - Google Patents

Logical inference method for ontology knowledge Download PDF

Info

Publication number
CN106649266A
CN106649266A CN201611075726.7A CN201611075726A CN106649266A CN 106649266 A CN106649266 A CN 106649266A CN 201611075726 A CN201611075726 A CN 201611075726A CN 106649266 A CN106649266 A CN 106649266A
Authority
CN
China
Prior art keywords
node
sim
reasoning
similarity
matched
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201611075726.7A
Other languages
Chinese (zh)
Inventor
曾广平
刘婷婷
陈榴
陈星宇
戴继勇
孙雷明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Science and Technology Beijing USTB
Original Assignee
University of Science and Technology Beijing USTB
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 University of Science and Technology Beijing USTB filed Critical University of Science and Technology Beijing USTB
Priority to CN201611075726.7A priority Critical patent/CN106649266A/en
Publication of CN106649266A publication Critical patent/CN106649266A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • 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

Abstract

The invention provides a logical inference method for ontology knowledge for increasing matching efficiency and accuracy. The method comprises following steps: S1, receiving an input inference request, wherein the inference request is ontology to be matched; S2, establishing a RDF graph for the ontology to be matched; S3, generating a tree for executing a matching algorithm according to the RDF graph of the ontology to be matched; S4, calculating a weighted average value of the semantic similarity between the nodes for generating the tree under the tree structure and related parent-child nodes to obtain the total similarity for the nodes, wherein the semantic similarity is determined by the similarity of forms of words and meanings of words; S5, matching all the nodes which generate the tree and outputting inference results according to the total similarity of the nodes. The method of the invention is applicable to the technical field of data intelligent analyzing and processing.

Description

A kind of logic reasoning of ontology knowledge
Technical field
The present invention relates to intelligent data analysis processing technology field, particularly relates to a kind of reasoning from logic side of ontology knowledge Method.
Background technology
In recent years, natural language processing is that in artificial intelligence field is difficult while noticeable research class Topic, its desired result can exactly make computer understand as people, analyze natural language, so as to solve text classification, sentence The practical problems such as method analysis, semantic understanding, emotion recognition, semantic reasoning.For example, in a specific professional domain, how The fact that will be existing and rule formatization description, be converted into computer it will be appreciated that language, and then complete patrolling for ontology knowledge Reasoning is collected, effective the reasoning results are drawn.
But, in prior art, do not establish effective method to solve the problems, such as the knowledge reasoning that body is supported.
The content of the invention
The technical problem to be solved in the present invention is to provide a kind of logic reasoning of ontology knowledge, to solve prior art It is existing without the effective method of establishment solving the problems, such as the knowledge reasoning that body is supported.
To solve above-mentioned technical problem, the embodiment of the present invention provides a kind of logic reasoning of ontology knowledge, including:
S1, the reasoning request of receives input, wherein, the reasoning request is body to be matched;
S2, builds the RDF graph of the body to be matched;
S3, according to the RDF graph of the body to be matched, generates a tree for being used to perform matching algorithm;
S4, calculates the semantic similarity of the node in the relative father and son's node of tree structure lower node itself of spanning tree Weighted mean, obtain node overall similarity, wherein, the semantic similarity is true by morphology similarity and acceptation similarity It is fixed;
S5, according to the node overall similarity for obtaining, matches to each node of spanning tree, output reasoning knot Really.
Further, the S2 includes:
Extract subject, predicate and the object of the body to be matched;
Subject, predicate and object according to the body described to be matched for extracting, builds the RDF graph of the body to be matched;
Wherein, the subject and object as RDF graph node, side of the predicate as RDF graph.
Further, the S3 includes:
S31, builds the RDF graph of another body to be matched;
S32, obtains the root node of the RDF graph of two bodies to be matched, and get two root nodes are merged into generation Pairing, using the matching to the root node as spanning tree;
S33, in the RDF graph of two bodies to be matched, searches respectively the side of respective root node;
S34, it is if the predicate corresponding to side is identical, the corresponding terminal node merging generation matching in the side is right, will be eventually Only node merges the matching for generating to as the child node of the spanning-tree root node, and connects the spanning tree with the side Root node and the child node;
S35, if the predicate corresponding to side is differed, skips the terminal node;
S36, according to the mode of S33, S35, S34, travels through successively all nodes in the RDF graph of two bodies to be matched, A tree for being used to perform matching algorithm is generated after the completion of all node traverses.
Further, if present node is e, the node overall similarity is expressed as:
Wherein, SimsRepresent the overall similarity of the node e of spanning tree, Sime(e1,e2) represent spanning tree node e bags The two entity e for containing1、e2Between semantic similarity, Simfl(e1,e2) represent spanning tree node e father and son's node semanteme Semantic similarity after Similarity-Weighted summation.
Further, the Sime(e1,e2) be expressed as:
Sime(e1,e2)=α Simd(e1,e2)+βSimw(e1,e2)
Wherein, Simd(e1,e2) it is two entity e1、e2Between editing distance similarity, Simd(e1,e2) represent generation Two entity e that the node e of tree is included1、e2Between morphology similarity, α represents Simd(e1,e2) weights, Simw(e1,e2) Represent two entity e that the node e of spanning tree is included1、e2Between acceptation similarity, β represents Simw(e1,e2) weights.
Further, the Simd(e1,e2) be expressed as:
Wherein, distance (e1,e2) represent two entity e1、e2String editing distance;Max(|e1|,|e2|) table Show two entity e1、e2The maximum of character string absolute growth;
The Simw(e1,e2) be expressed as:
Wherein, len (e1,e2) represent two entity e1、e2Most short path, depth in dictionary TongYiCi CiLin Presentation class height of tree degree.
Further, the Simfl(e1,e2) be expressed as:
Simfl(e1,e2)=p1Sime(f(e1,e2))+p2Sime(l(e1,e2))
Wherein, Sime(f(e1,e2)) represent spanning tree node e father node semantic similarity, Sime(l(e1,e2)) For the maximum of semantic similarity in all child nodes of the node e of spanning tree, p1、p2It is respectively Sime(f(e1,e2))、Sime (l(e1,e2)) weights;
The Sime(l(e1,e2)) be expressed as:
Wherein, Sime(li(e1,e2)) represent spanning tree node e the i-th child node semantic similarity.
Further, the S5 includes:
S51, the node overall similarity and the threshold value set in advance that obtain are compared;
S52, if the node overall similarity for obtaining is more than threshold value set in advance, two in present node reality Body sets up matching mapping relations, and the matching mapping relations set up are exported in result set;
S53, otherwise, then abandons present node;
Other nodes of spanning tree according to the mode of S51, S52, S53, are traveled through, all sections to spanning tree by S54 After the completion of point traversal, output result collection is used as the reasoning results.
Further, methods described also includes:
S2-S5 is performed, judges that the fact that whether reasoning is asked with fact knowledge storehouse matches;
If it fails to match for the fact that the reasoning is asked with the fact that pre-set knowledge base, according to rule-based knowledge base In inference rule, extract the premise and sub- reasoning target of reasoning request, perform S2-S5 and make inferences, if premise and son All the match is successful for reasoning target, then output result collection is used as the reasoning results;Otherwise, then reasoning failure is returned;
If the fact that in the reasoning request and fact knowledge storehouse, the match is successful, reasoning success is returned.
Further, methods described also includes:
If matching in reasoning process when there is conflict between a plurality of inference rule or inference rule, according to matching at first The inference rule of the highest priority of work(makes inferences;
Wherein, each inference rule in the rule-based knowledge base has different priority.
The above-mentioned technical proposal of the present invention has the beneficial effect that:
In such scheme, asked by the reasoning of receives input, wherein, the reasoning request is body to be matched;Using RDF format in body is indicated to the reasoning request being input into, and builds a tree for performing matching algorithm, from the meaning of a word Similarity and the aspect computing semantic similarities of morphology similarity two, on this basis, calculate tree structure lower node itself with The weighted mean of the semantic similarity of father and son's node of the node, obtains node overall similarity, and the node for obtaining Overall similarity, matches to each node of spanning tree, the reasoning results is exported, so, from acceptation similarity and morphology phase The calculating of semantic similarity is carried out like two aspects of degree, it is possible to increase matching efficiency and accurate rate.
Description of the drawings
Fig. 1 is the schematic flow sheet of the logic reasoning of ontology knowledge provided in an embodiment of the present invention;
Fig. 2 is the RDF graph of structure provided in an embodiment of the present invention;
Fig. 3 is the RDF graph of body to be matched provided in an embodiment of the present invention;
Fig. 4 is the RDF graph of another body to be matched provided in an embodiment of the present invention;
Fig. 5 is the tree for performing matching algorithm provided in an embodiment of the present invention;
Fig. 6 is the detailed process schematic diagram of the logic reasoning of ontology knowledge provided in an embodiment of the present invention;
Fig. 7 is the idiographic flow schematic diagram of the logic reasoning of ontology knowledge provided in an embodiment of the present invention.
Specific embodiment
To make the technical problem to be solved in the present invention, technical scheme and advantage clearer, below in conjunction with accompanying drawing and tool Body embodiment is described in detail.
The present invention does not establish effective method to solve the problems, such as the knowledge reasoning that body is supported for existing, there is provided one Plant the logic reasoning of ontology knowledge.
Embodiment one
Referring to shown in Fig. 1, the logic reasoning of ontology knowledge provided in an embodiment of the present invention, including:
S1, the reasoning request of receives input, wherein, the reasoning request is body to be matched;
S2, build the body to be matched resource description framework (Resource Description Framework, RDF) figure;
S3, according to the RDF graph of the body to be matched, generates a tree for being used to perform matching algorithm;
S4, calculates the semantic similarity of the node in the relative father and son's node of tree structure lower node itself of spanning tree Weighted mean, obtain node overall similarity, wherein, the semantic similarity is true by morphology similarity and acceptation similarity It is fixed;
S5, according to the node overall similarity for obtaining, matches to each node of spanning tree, output reasoning knot Really.
The logic reasoning of the ontology knowledge described in the embodiment of the present invention, is asked by the reasoning of receives input, wherein, The reasoning request is body to be matched;The reasoning request being input into is indicated using the RDF format in body, and builds one For performing the tree of matching algorithm, the computing semantic similarity in terms of acceptation similarity and morphology similarity two, in this base On plinth, the weighted mean of the semantic similarity of father and son's node of tree structure lower node itself and the node is calculated, saved Point overall similarity, and the node overall similarity for obtaining, match to each node of spanning tree, output reasoning knot Really, so, the calculating of semantic similarity is carried out in terms of acceptation similarity and morphology similarity two, it is possible to increase matching efficiency And accurate rate.
In the present embodiment, RDF graph is built up by the reasoning request by input, then RDF graph is built into into tree structure, and Spanning tree is calculated with top-down order (referred to as:Tree) in each node overall similarity, so as to come realize body it Between matching.
The present embodiment exists, and when the RDF graph of the body to be matched is built, need to perform following behaviour to the reasoning request being input into Make:
A11, body parsing, specifically:Reasoning of product J ena to being input into of increasing income that Apache foundations can be utilized is asked Asking carries out body parsing, it is therefore an objective to remove some to matching useless structure, it is to avoid affect matching result and efficiency;
A122, feature extraction, extract the feature (subject, predicate, object) for calculating similarity, these features by with It is used as calculating object.
In the present embodiment, used as an alternative embodiment, the RDF graph (S2) of the structure body to be matched includes:
Extract subject, predicate and the object of the body to be matched;
Subject, predicate and object according to the body described to be matched for extracting, builds the RDF graph of the body to be matched;
Wherein, the subject and object as RDF graph node, side of the predicate as RDF graph.
In the present embodiment, for example, the knowledge description form in ontology knowledge base is RDF, and RDF is subject, predicate, object group Into triple form.
In the present embodiment, it is assumed that body to be matched is " tropical rainy climate is high temperature and rainy ", then can be by " the torrid zone Rain forest climate is high temperature and rainy " it is expressed as RDF graph as shown in Figure 2, wherein " tropical rain forest " and " high temperature and rainy " is respectively Knowledge subject and object, " attribute-of " is predicate.
In the specific embodiment of the logic reasoning of aforementioned ontology knowledge, further, treat described in the basis The RDF graph of matching body, generating a tree (S3) for being used to perform matching algorithm includes:
S31, builds the RDF graph of another body to be matched;
S32, obtains the root node of the RDF graph of two bodies to be matched, and get two root nodes are merged into generation Pairing, using the matching to the root node as spanning tree;
S33, in the RDF graph of two bodies to be matched, searches respectively the side of respective root node;
S34, it is if the predicate corresponding to side is identical, the corresponding terminal node merging generation matching in the side is right, will be eventually Only node merges the matching for generating to as the child node of the spanning-tree root node, and connects the spanning tree with the side Root node and the child node;
S35, if the predicate corresponding to side is differed, skips the terminal node;
S36, according to the mode of S33, S35, S34, travels through successively all nodes in the RDF graph of two bodies to be matched, A tree for being used to perform matching algorithm is generated after the completion of all node traverses.
In the present embodiment, the RDF graph of body to be matched is generated into one by predetermined rule is used to perform matching algorithm Tree.Specific rules are as follows:
B11, analyzes the RDF graph of two bodies to be matched, and two roots are found in the RDF graph of two bodies to be matched (root) node, it is right with the two root nodes one matchings of composition, then with this matching to as the root node of spanning tree;
B12, searches the side on the root summit of two RDF graphs, i.e. predicate corresponding to side, if predicate is consistent, by two RDF Terminal node in figure corresponding to side constitutes a child node of spanning-tree root node, and connects the spanning-tree root section with the side Point and the child node, so as to the first branch of spanning tree;
B13, if the predicate corresponding to side is inconsistent, skips this terminal node, continues traversal downwards.
B14, travels through successively in this way all nodes of two RDF graphs, and one is generated after the completion of all node traverses For performing the tree of matching algorithm.
As shown in Fig. 3, Fig. 4, Fig. 5, it is assumed that Fig. 3 and Fig. 4 are the RDF graph of two bodies to be matched, Fig. 5 is by above-mentioned The tree for being used to perform matching algorithm that rule is generated.First it is to find root node E, the E' in Fig. 3 and Fig. 4, by two roots Node merges one matching of generation to node (E, E'), then allows the node (E, E') as the root node of spanning tree;At two Search for the statement based on E and E' in the RDF graph of body to be matched respectively, the predicate of two of which statement is identical, is P1, Then using its object (terminal node) F and F' composition matching to as child node, i.e. (F, F') for root node (E, E') child node, And with predicate P1 as two nodes (E, E') of connection, the side of (F, F').Travel through remaining node successively in the same manner, generate one and be used for holding The tree of row matching algorithm.
In the present embodiment, the RDF graph of described two bodies to be matched, one is according to the ontological construction to be matched being input into , another is the knowledge architecture in ontology knowledge base.
In the specific embodiment of the logic reasoning of aforementioned ontology knowledge, further, if present node is e, The node overall similarity is expressed as:
Wherein, SimsRepresent the overall similarity of the node e of spanning tree, Sime(e1,e2) represent spanning tree node e bags The two entity e for containing1、e2Between semantic similarity, Simfl(e1,e2) represent spanning tree node e father and son's node semanteme Semantic similarity after Similarity-Weighted summation.
In the specific embodiment of the logic reasoning of aforementioned ontology knowledge, further, the Sime(e1,e2) It is expressed as:
Sime(e1,e2)=α Simd(e1,e2)+βSimw(e1,e2)
Wherein, Simd(e1,e2) it is two entity e1、e2Between editing distance similarity, Simd(e1,e2) represent generation Two entity e that the node e of tree is included1、e2Between morphology similarity, α represents Simd(e1,e2) weights, Simw(e1,e2) Represent two entity e that the node e of spanning tree is included1、e2Between acceptation similarity, β represents Simw(e1,e2) weights.
In the present embodiment, the semantic similarity Sim between two entities including of node of spanning tree is calculatede(e1,e2) be Determine in terms of morphology and the meaning of a word two, with e present node, e are represented1、e2Represent two entities that node e is included.
In the present embodiment, the method that can adopt editing distance calculates two entity e that the node e of spanning tree is included1、e2 Between morphology similarity Simd(e1,e2):
Wherein, distance (e1,e2) represent two entity e1、e2String editing distance;Max(|e1|,|e2|) table Show two entity e1、e2The maximum of character string absolute growth;
In the present embodiment, the method for editing distance is primarily directed to the character string of two inputs, related using Dynamic Programming Algorithm calculated, be turned into edit operation number that another character string spent to judge word according to a character string Shape similarity, the fewer editing distance of operand is bigger.
In the present embodiment, two entity e that the node e of spanning tree is included can be determined by WordNet with the help of a dictionary1、e2Between Acceptation similarity Simw(e1,e2):
Wherein, len (e1,e2) represent two entity e1、e2Most short path, depth in dictionary TongYiCi CiLin Presentation class height of tree degree.
Then to Simd(e1,e2) and Simw(e1,e2) summation is weighted, obtain two that the node e of spanning tree is included Entity e1、e2Between semantic similarity Sime(e1,e2):
Sime(e1,e2)=α Simd(e1,e2)+βSimw(e1,e2)
Wherein, α represents Simd(e1,e2) weights, Simw(e1,e2) represent two entities that the node e of spanning tree is included e1、e2Between acceptation similarity, β represents Simw(e1,e2) weights.It is similar with morphology from acceptation similarity in the present embodiment Two aspect computing semantic similarities of degree, it is possible to increase matching efficiency and accurate rate, it is to avoid simple to carry out from one side Timing can miss it is many matching to problem.In the specific embodiment of the logic reasoning of aforementioned ontology knowledge, enter one Step ground, Simfl(e1,e2) be expressed as:
Simfl(e1,e2)=p1Sime(f(e1,e2))+p2Sime(l(e1,e2))
Wherein, Sime(f(e1,e2)) represent spanning tree node e father node semantic similarity, Sime(l(e1,e2)) For the maximum of semantic similarity in all child nodes of the node e of spanning tree, p1、p2It is respectively Sime(f(e1,e2))、Sime (l(e1,e2)) weights;
The Sime(l(e1,e2)) be expressed as:
Wherein, Sime(li(e1,e2)) represent spanning tree node e the i-th child node semantic similarity.
In the present embodiment, the two entity e included with the node e for calculating spanning tree1、e2Between semantic similarity be base Plinth, calculates the semantic similarity Sim of the father node of the node e of spanning treee(f(e1,e2)) and spanning tree node e child node Semantic similarity Sime(l(e1,e2)), then asked by giving the semantic similarity weighting of father and son's node of weight computing node e Semantic similarity Sim afterwardsfl(e1,e2):
Simfl(e1,e2)=p1Sime(f(e1,e2))+p2Sime(l(e1,e2))
Wherein, p1、p2It is respectively Sime(f(e1,e2))、Sime(l(e1,e2)) weights.
In the present embodiment, due to each node only one of which father node in spanning tree, but child node is not unique, institute To take the maximum during the node has the similarity of all child nodes when the similarity of child node is calculated, that is to say, that institute State Sime(l(e1,e2)) for spanning tree node e all child nodes in semantic similarity maximum;The Sime(l(e1, e2)) be expressed as:
Wherein, Sime(li(e1,e2)) represent spanning tree node e the i-th child node semantic similarity.
In the present embodiment, finally by calculating Sime(e1,e2) and Simfl(e1,e2) average, obtain the total body phase of node Like degree Sims
In the specific embodiment of the logic reasoning of aforementioned ontology knowledge, further, what the basis was obtained The node overall similarity, matches to each node of spanning tree, and output the reasoning results (S5) includes:
S51, the node overall similarity and the threshold value set in advance that obtain are compared;
S52, if the node overall similarity for obtaining is more than threshold value set in advance, two in present node reality Body sets up matching mapping relations, and the matching mapping relations set up are exported in result set;
S53, otherwise, then abandons present node;
Other nodes of spanning tree according to the mode of S51, S52, S53, are traveled through, all sections to spanning tree by S54 After the completion of point traversal, output result collection is used as the reasoning results.
In the present embodiment, the node overall similarity Sim of each node by obtainingsThe respective nodes of spanning tree are carried out Matching, obtains matching mapping relations;Specifically:If node overall similarity SimsHigher than threshold value t set in advance, then the node Two interior entities set up matching mapping relations, and the matching mapping relations set up are exported in result set;Otherwise, then abandon The node, is not output in result set.After the completion of traveling through to each node of spanning tree, matching process terminates, output Final result set is used as the reasoning results.
In the specific embodiment of the logic reasoning of aforementioned ontology knowledge, further, methods described also includes:
S2-S5 is performed, judges that the fact that whether reasoning is asked with fact knowledge storehouse matches;
If it fails to match for the fact that the reasoning is asked with the fact that pre-set knowledge base, according to rule-based knowledge base In inference rule, extract the premise and sub- reasoning target of reasoning request, perform S2-S5 and make inferences, if premise and son All the match is successful for reasoning target, then output result collection is used as the reasoning results;Otherwise, then reasoning failure is returned;
If the fact that in the reasoning request and fact knowledge storehouse, the match is successful, reasoning success is returned.
As shown in Figure 6 and Figure 7, in the present embodiment, user propose reasoning request, first, perform S2-S5, judge described in push away The fact that whether reason request is with fact knowledge storehouse matches, if it fails to match, directly returns reasoning failure;If the match is successful, The premise of reasoning request is then extracted, S2-S5 is performed, the premise to extracting makes inferences, if the match is successful, continue to extract reasoning The sub- reasoning target of request, the sub- reasoning target to extracting carries out recurrence reasoning, if all the match is successful for premise and sub- reasoning target, Then reasoning success, otherwise, then returns reasoning failure.
In the present embodiment, the fact knowledge storehouse and the rule-based knowledge base are obtained based on ontology knowledge base.
In the specific embodiment of the logic reasoning of aforementioned ontology knowledge, further, methods described also includes:
If matching in reasoning process when there is conflict between a plurality of inference rule or inference rule, according to matching at first The inference rule of the highest priority of work(makes inferences;
Wherein, each inference rule in the rule-based knowledge base has different priority.
As shown in fig. 7, in the present embodiment, Strategy of Conflict Resolution mainly completes to match a plurality of inference rule in reasoning process (rule in rule-based knowledge base), or select most suitable inference rule to make inferences when there is conflict between inference rule. The Strategy of Conflict Resolution that the present embodiment is adopted is highest priority matching strategy at first, and each as in rule-based knowledge base pushes away Reason rule gives different priority, by highest priority and identical rule is placed in same domain, according at first the match is successful The inference rule of highest priority make inferences.
In the present embodiment, based on the logic reasoning of the ontology knowledge described in the present embodiment, realize one kind towards college entrance examination The comprehensive logic inference system solved a problem of text, in being applied to basic education field, the logic inference system includes:The data of bottom Layer, the reasoning from logic layer of centre and the client layer on upper strata;Wherein,
(1) data Layer:Data Layer is mainly domain knowledge library module, is a critically important mould in the logic inference system Block, the use of data Layer runs through whole system, and the data Layer includes:Fact knowledge storehouse and rule-based knowledge base, are reasoning from logic The data supporting of layer offer bottom.
In the present embodiment, in order to realize the logic inference system solved a problem comprehensive towards college entrance examination text, first, structure college entrance examination text is comprehensive to be known The corpus of knowledge, the fact that will be existing and rule formatization storage is to ontology knowledge base, based on the ontology knowledge base, by rule Then extended method, obtains the inference rule contained in body, obtains rule-based knowledge base;Based on the ontology knowledge base, to body Carry out the fact and be converted to fact knowledge storehouse, that is to say, that fact knowledge storehouse and rule-based knowledge base are to carry out true turning by body Change or Rule Extended after convert thereof into the knowledge composition represented by language.
In the present embodiment, Rule Extended using semantic net rule language (Semantic Web Rule Language, SWRL) extension rule, directly using class, the attribute in network ontology language (Web Ontology Language, OWL) body Enter line discipline definition with example.For example, if depositing relation between objects in body:HasParent (x, y) and hasBrother (z, y), by the semantic description of body, it is known that be set membership between x and y, is brotherhood between z and y, according to both It is uncle and nephew relation that relation can be released between x and z is, using SWRL extension rules hasUncle (x, z) is obtained.
(2) reasoning from logic layer is matched by knowledge, conflict resolution, ontology inference composition;Reasoning from logic layer adopts semantic similitude Degree calculates the matching for realizing knowledge in reasoning request and ontology knowledge base, using the reasoning from logic of backward implementation of inference body, and Using highest priority, at first matching strategy solves the problems, such as rule conflict in reasoning process or matches a plurality of inference rule;With Family layer realizes the interaction between user and system;
(3) client layer:Client layer is made up of user management module, and the submission of reasoning request, is by the reasoning of user input Request submission system, is that early-stage preparations are done in subsequent logic reasoning, and the question sentence of input is nature declarative sentence.
In the present embodiment, by taking a specific example as an example, it is assumed that the reasoning of user input request is:Mount Taibai northern foot It is natural zone temperate deciduous broadleaved band.
Description in fact knowledge storehouse includes:
1 is located at (waist, Mount Taibai north slope the foot of a mountain in the north slope of Mount Taibai);
2 is (Mount Taibai northern foot, trees are high and close);
3 are located at (Qinling Mountains, China)
4 are located at (Mount Taibai northern foot, mountain area)
5 basic natural zones (tropical monsson climate, rain forest region)
6 basic natural zones (subtropical monsoon climate, monsoon rainforest band)
7 are located at (tropical monsson climate, Mountain vertical zonation)
8 are located at (subtropical monsoon climate, Mountain vertical zonation)
9 is climate zone (Mount Taibai northern foot, monsoon climate of medium latitudes)
10 basic natural zones (monsoon climate of medium latitudes, evergreen broad-leaved forest belt)
11 are located at (monsoon climate of medium latitudes, Mountain vertical zonation)
Description in rule-based knowledge base includes:
1, it is natural zone (x, sparse grassland):-
Positioned at (x, the torrid zone),
It is not (being located at (x, China)).
2, it is natural zone (x, y):-
2.1 are located at (x, mountain area),
2.2 search climate zone (x, z),
2.3 basic natural zones (z, c),
2.4 are located at (c, Mountain vertical zonation)
2.5 be natural zone (x, c | z).
3, search weather:-
It is climate zone (x, y).
Concrete reasoning process includes:
Fact matching:(Mount Taibai northern foot is natural zone temperate deciduous broadleaved band) is asked according to the reasoning of input, according to S2-S5 is matched, and the fact is not directly matched in fact knowledge storehouse, then proceed rule match.
The matching of rule:
Rule 1, extracts premise " being natural zone (Mount Taibai northern foot, sparse grassland) ", it is impossible to match with the fact, so matching Failure, wherein, premise is regular head, specially:“:- " before rule.
Rule 2, extracts premise " be natural zone (Mount Taibai northern foot, y) ", and y can be arbitrary, so the match is successful;Before Carry after the match is successful, extract sub- reasoning target, " being located in (x, mountain area), lookup weather (x, z), basic natural zone (z, c), position In (c, Mountain vertical zonation) " carry out recurrence reasoning as sub- reasoning target;Obtain:2.1 match with true 4, and 2.2. passes through Recurrence matching can obtain " being climate zone (Mount Taibai northern foot, (z) monsoon climate of medium latitudes) ", and 2.3 obtain " base by 2.2 result This natural zone ((z) monsoon climate of medium latitudes, (c) evergreen broad-leaved forest belt) ", 2.4 and 11 the match is successful, so rule 2 the match is successful, The conclusion for obtaining for " be natural zone (Mount Taibai northern foot, temperate zone evergreen broad-leaved forest belt), reasoning success, reasoning request be it is wrong, Wherein, sub- reasoning target for ":- " before rule.
The above is the preferred embodiment of the present invention, it is noted that for those skilled in the art For, on the premise of without departing from principle of the present invention, some improvements and modifications can also be made, these improvements and modifications Should be regarded as protection scope of the present invention.

Claims (10)

1. a kind of logic reasoning of ontology knowledge, it is characterised in that include:
S1, the reasoning request of receives input, wherein, the reasoning request is body to be matched;
S2, builds the RDF graph of the body to be matched;
S3, according to the RDF graph of the body to be matched, generates a tree for being used to perform matching algorithm;
S4, calculate spanning tree node the relative father and son's node of tree structure lower node itself semantic similarity add Power average, obtains node overall similarity, wherein, the semantic similarity is determined by morphology similarity and acceptation similarity;
S5, according to the node overall similarity for obtaining, matches to each node of spanning tree, exports the reasoning results.
2. the logic reasoning of ontology knowledge according to claim 1, it is characterised in that the S2 includes:
Extract subject, predicate and the object of the body to be matched;
Subject, predicate and object according to the body described to be matched for extracting, builds the RDF graph of the body to be matched;
Wherein, the subject and object as RDF graph node, side of the predicate as RDF graph.
3. the logic reasoning of ontology knowledge according to claim 1, it is characterised in that the S3 includes:
S31, builds the RDF graph of another body to be matched;
S32, obtains the root node of the RDF graph of two bodies to be matched, and get two root nodes merging generation matchings are right, Using the matching to the root node as spanning tree;
S33, in the RDF graph of two bodies to be matched, searches respectively the side of respective root node;
S34, it is if the predicate corresponding to side is identical, the corresponding terminal node merging generation matching in the side is right, by terminal node Point merges the matching for generating to as the child node of the spanning-tree root node, and connects the root section of the spanning tree with the side Point and the child node;
S35, if the predicate corresponding to side is differed, skips the terminal node;
S36, according to the mode of S33, S35, S34, travels through successively all nodes in the RDF graph of two bodies to be matched, works as institute Have and a tree for being used to perform matching algorithm is generated after the completion of node traverses.
4. the logic reasoning of ontology knowledge according to claim 1, it is characterised in that described if present node is e Node overall similarity is expressed as:
Sim s = Sim e ( e 1 , e 2 ) + Sim f l ( e 1 , e 2 ) 2
Wherein, SimsRepresent the overall similarity of the node e of spanning tree, Sime(e1,e2) represent the node e of spanning tree is included two Individual entity e1、e2Between semantic similarity, Simfl(e1,e2) represent spanning tree node e father and son's node semantic similarity Semantic similarity after weighted sum.
5. the logic reasoning of ontology knowledge according to claim 4, it is characterised in that the Sime(e1,e2) represent For:
Sime(e1,e2)=α Simd(e1,e2)+βSimw(e1,e2)
Wherein, Simd(e1,e2) it is two entity e1、e2Between editing distance similarity, Simd(e1,e2) represent spanning tree Two entity e that node e is included1、e2Between morphology similarity, α represents Simd(e1,e2) weights, Simw(e1,e2) represent Two entity e that the node e of spanning tree is included1、e2Between acceptation similarity, β represents Simw(e1,e2) weights.
6. the logic reasoning of ontology knowledge according to claim 5, it is characterised in that the Simd(e1,e2) represent For:
Sim d ( e 1 , e 2 ) = 1 - d i s tan c e ( e 1 , e 2 ) M a x ( | e 1 | , | e 2 | )
Wherein, distance (e1,e2) represent two entity e1、e2String editing distance;Max(|e1|,|e2|) represent two Individual entity e1、e2The maximum of character string absolute growth;
The Simw(e1,e2) be expressed as:
Sim w ( e 1 , e 2 ) = - l o g l e n ( e 1 , e 2 ) + 1 2 d e p t h
Wherein, len (e1,e2) represent two entity e1、e2The most short path in dictionary TongYiCi CiLin, depth is represented Classification tree height.
7. the logic reasoning of ontology knowledge according to claim 4, it is characterised in that Simfl(e1,e2) be expressed as:
Simfl(e1,e2)=p1Sime(f(e1,e2))+p2Sime(l(e1,e2))
Wherein, Sime(f(e1,e2)) represent spanning tree node e father node semantic similarity, Sime(l(e1,e2)) make a living The maximum of semantic similarity, p in all child nodes of the node e of Cheng Shu1、p2It is respectively Sime(f(e1,e2))、Sime(l (e1,e2)) weights;
The Sime(l(e1,e2)) be expressed as:
Sim e ( l ( e 1 , e 2 ) ) = M a x [ ∪ i = 1 n Sim e ( l 1 ( e 1 , e 2 ) ) ]
Wherein, Sime(li(e1,e2)) represent spanning tree node e the i-th child node semantic similarity.
8. the logic reasoning of ontology knowledge according to claim 1, it is characterised in that the S5 includes:
S51, the node overall similarity and the threshold value set in advance that obtain are compared;
S52, if the node overall similarity for obtaining is more than threshold value set in advance, two in present node entity is built Vertical matching mapping relations, and the matching mapping relations set up are exported in result set;
S53, otherwise, then abandons present node;
Other nodes of spanning tree according to the mode of S51, S52, S53, are traveled through, all nodes time to spanning tree by S54 After the completion of going through, output result collection is used as the reasoning results.
9. the logic reasoning of ontology knowledge according to claim 1, it is characterised in that methods described also includes:
S2-S5 is performed, judges that the fact that whether reasoning is asked with fact knowledge storehouse matches;
If it fails to match for the fact that the reasoning is asked with the fact that pre-set knowledge base, according in rule-based knowledge base Inference rule, extracts the premise and sub- reasoning target of the reasoning request, performs S2-S5 and makes inferences, if premise and sub- reasoning All the match is successful for target, then output result collection is used as the reasoning results;Otherwise, then reasoning failure is returned;
If the fact that in the reasoning request and fact knowledge storehouse, the match is successful, reasoning success is returned.
10. the logic reasoning of ontology knowledge according to claim 1, it is characterised in that methods described also includes:
If presence conflict between a plurality of inference rule or inference rule is matched in reasoning process, according to what at first the match is successful The inference rule of highest priority makes inferences;
Wherein, each inference rule in the rule-based knowledge base has different priority.
CN201611075726.7A 2016-11-29 2016-11-29 Logical inference method for ontology knowledge Pending CN106649266A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611075726.7A CN106649266A (en) 2016-11-29 2016-11-29 Logical inference method for ontology knowledge

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611075726.7A CN106649266A (en) 2016-11-29 2016-11-29 Logical inference method for ontology knowledge

Publications (1)

Publication Number Publication Date
CN106649266A true CN106649266A (en) 2017-05-10

Family

ID=58813197

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611075726.7A Pending CN106649266A (en) 2016-11-29 2016-11-29 Logical inference method for ontology knowledge

Country Status (1)

Country Link
CN (1) CN106649266A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107832319A (en) * 2017-06-20 2018-03-23 北京工业大学 A kind of heuristic enquiry expanding method based on semantic relationship network
CN108153736A (en) * 2017-12-28 2018-06-12 南开大学 A kind of relative mapping method based on vector space model
CN108595413A (en) * 2018-03-22 2018-09-28 西北大学 A kind of answer extracting method based on semantic dependent tree
CN110457485A (en) * 2019-07-02 2019-11-15 厦门美域中央信息科技有限公司 A kind of body of data logic reasoning based on Inductive Logic Programming
CN111241841A (en) * 2018-11-13 2020-06-05 第四范式(北京)技术有限公司 Semantic analysis method and device, computing equipment and readable medium
CN111739595A (en) * 2020-07-24 2020-10-02 湖南创星科技股份有限公司 Medical big data sharing analysis method and device
CN112084311A (en) * 2019-06-14 2020-12-15 腾讯科技(深圳)有限公司 Event processing method and device, storage medium and electronic device
CN117196043A (en) * 2023-11-07 2023-12-08 北京大数据先进技术研究院 Ontology-based knowledge reasoning method and system and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722569A (en) * 2012-05-31 2012-10-10 浙江理工大学 Knowledge discovery device based on path migration of RDF (Resource Description Framework) picture and method
CN102999640A (en) * 2013-01-09 2013-03-27 公安部第三研究所 Video and image retrieval system and method based on semantic reasoning and structural description

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722569A (en) * 2012-05-31 2012-10-10 浙江理工大学 Knowledge discovery device based on path migration of RDF (Resource Description Framework) picture and method
CN102999640A (en) * 2013-01-09 2013-03-27 公安部第三研究所 Video and image retrieval system and method based on semantic reasoning and structural description

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
张悦 等: "基于改进相似度传播算法的本体匹配", 《计算机应用》 *
李慧颖: "基于关键词的RDF数据查询方法", 《东南大学学报(自然科学版)》 *
王颖 等: "一种基于RDF图的本体匹配方法", 《计算机应用》 *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107832319B (en) * 2017-06-20 2021-09-17 北京工业大学 Heuristic query expansion method based on semantic association network
CN107832319A (en) * 2017-06-20 2018-03-23 北京工业大学 A kind of heuristic enquiry expanding method based on semantic relationship network
CN108153736A (en) * 2017-12-28 2018-06-12 南开大学 A kind of relative mapping method based on vector space model
CN108595413A (en) * 2018-03-22 2018-09-28 西北大学 A kind of answer extracting method based on semantic dependent tree
CN108595413B (en) * 2018-03-22 2021-11-09 西北大学 Answer extraction method based on semantic dependency tree
CN111241841B (en) * 2018-11-13 2024-04-05 第四范式(北京)技术有限公司 Semantic analysis method and device, computing device and readable medium
CN111241841A (en) * 2018-11-13 2020-06-05 第四范式(北京)技术有限公司 Semantic analysis method and device, computing equipment and readable medium
CN112084311B (en) * 2019-06-14 2023-08-25 腾讯科技(深圳)有限公司 Event processing method and device, storage medium and electronic device
CN112084311A (en) * 2019-06-14 2020-12-15 腾讯科技(深圳)有限公司 Event processing method and device, storage medium and electronic device
CN110457485A (en) * 2019-07-02 2019-11-15 厦门美域中央信息科技有限公司 A kind of body of data logic reasoning based on Inductive Logic Programming
CN111739595A (en) * 2020-07-24 2020-10-02 湖南创星科技股份有限公司 Medical big data sharing analysis method and device
CN117196043A (en) * 2023-11-07 2023-12-08 北京大数据先进技术研究院 Ontology-based knowledge reasoning method and system and electronic equipment
CN117196043B (en) * 2023-11-07 2024-02-06 北京大数据先进技术研究院 Ontology-based knowledge reasoning method and system and electronic equipment

Similar Documents

Publication Publication Date Title
CN106649266A (en) Logical inference method for ontology knowledge
CN104199857B (en) A kind of tax document hierarchy classification method based on multi-tag classification
CN107122340B (en) A kind of similarity detection method of the science and technology item return based on synonym analysis
CN109062939A (en) A kind of intelligence towards Chinese international education leads method
CN109472024A (en) A kind of file classification method based on bidirectional circulating attention neural network
CN112883738A (en) Medical entity relation extraction method based on neural network and self-attention mechanism
CN107766324A (en) A kind of text coherence analysis method based on deep neural network
CN103207856A (en) Ontology concept and hierarchical relation generation method
CN109101235A (en) A kind of intelligently parsing method of software program
CN106295186A (en) A kind of method and system of aided disease diagnosis based on intelligent inference
CN107679110A (en) The method and device of knowledge mapping is improved with reference to text classification and picture attribute extraction
CN103440287A (en) Web question-answering retrieval system based on product information structuring
CN102662931A (en) Semantic role labeling method based on synergetic neural network
Tang et al. Medium-and long-term precipitation forecasting method based on data augmentation and machine learning algorithms
CN106446162A (en) Orient field self body intelligence library article search method
CN103886030B (en) Cost-sensitive decision-making tree based physical information fusion system data classification method
CN107463658A (en) File classification method and device
CN108520166A (en) A kind of drug targets prediction technique based on multiple similitude network wandering
Lin et al. Deep structured scene parsing by learning with image descriptions
CN104331523B (en) A kind of question sentence search method based on conceptual object model
Zhang et al. Prediction of daily smoking behavior based on decision tree machine learning algorithm
CN110929933A (en) Rice disease prediction and diagnosis method based on knowledge map
Sifa et al. Towards contradiction detection in german: a translation-driven approach
CN108021682A (en) Open information extracts a kind of Entity Semantics method based on wikipedia under background
Sadr et al. Unified topic-based semantic models: A study in computing the semantic relatedness of geographic terms

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170510