A data retrieval method based on ontology
Through the ontology-based data retrieval method, we analyze the data structure and characteristics, establish aggregation templates and design retrieval parameters, combine big data and natural language analysis, and directly search in the graph database, solving the low retrieval efficiency and cumbersome steps in the existing technology. problem, achieving an efficient and simplified data retrieval process.
Patent Information
- Application Number
- CN202111463663.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-12-03
AI Technical Summary
Existing data retrieval technology is inefficient when processing huge amounts of information, and retrieval of complex conditions requires multiple steps, making the retrieval process cumbersome.
Using an ontology-based data retrieval method, a tree structure aggregation template is established by analyzing the data structure and characteristics, combined with big data analysis and natural language parsing algorithms, the retrieval parameters are designed, and a retrieval is performed directly in the graph database.
It greatly improves the efficiency of data retrieval, simplifies the retrieval process, can obtain the expected results in one retrieval, accurately describes data relationships, and adapts to complex condition queries.
Smart Images

Figure CN114254162B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of data retrieval, and in particular relates to an ontology-based data retrieval method. Background Art
[0002] With the gradual development of information systems, combat data is also developing towards large scale, wide distribution, dynamic structure, and complex and diverse modes. As a result, the problem of low utilization is becoming increasingly serious while the application value of data is gradually increasing. At the same time, information retrieval technology has a natural and unique advantage in processing massive amounts of information. Therefore, using information retrieval technology to retrieve information system data can improve retrieval efficiency while promoting the development of information systems.
[0003] Ontology was originally a philosophical concept. The philosophical definition of ontology is "a systematic description of objective things in the world", a systematic explanation or description of "existence". In recent years, with the continuous development of information technology, ontology has been defined in the field of artificial intelligence as "the definition of the basic terms and relationships that constitute the vocabulary of related fields, and the definition of the rules that use philosophical terms and relationships to constitute the extension of philosophical vocabulary". Therefore, the hierarchical structure model of data can be described based on ontology, and the data can be quickly retrieved in combination with information retrieval technology, greatly improving the efficiency of data retrieval. Summary of the invention
[0004] Purpose of the invention: The technical problem to be solved by the present invention is to provide a data retrieval method based on ontology in view of the shortcomings of the prior art, including the following steps:
[0005] Step 1: Analyze data structure and data characteristics according to the ontology framework;
[0006] Step 2: Establish a tree structure aggregation template based on the data structure and data characteristics;
[0007] Step 3: Use big data analysis methods to analyze search habits and needs and abstract search conditions;
[0008] Step 4, design the search parameters using the build mode according to the obtained search conditions;
[0009] Step 5, adding data from a database, a text file or by inputting data according to the content of the aggregation template, and then extracting the corresponding data;
[0010] Step 6, combining the data with the parameters according to the search parameters to complete the data preprocessing;
[0011] Step 7, storing the preprocessed data into the graph database;
[0012] Step 8, parsing the input search statement according to a natural language parsing algorithm;
[0013] Step 9: Use the parsed search terms to search in the graph database.
[0014] Step 1 includes:
[0015] According to the ontology framework, the data structure and data characteristics are manually analyzed. The analysis focus should be consistent with the ontology framework structure and attributes, and the elements that conform to the ontology framework description are obtained and recorded.
[0016] In step 1, the ontology framework refers to a set of hierarchical relationships between definitions and concepts. The ontology framework structure and its attributes are defined according to the attributes of the ontology and the concept. Each type of ontology is divided into subclasses of more than two levels according to actual needs for expansion. After the levels are defined, the concepts' own attributes and restrictions are refined layer by layer according to the description of the concepts in the levels, thereby forming an aggregation template.
[0017] Step 2 includes:
[0018] The relationships between the data tables in the database and the features of the data tables are aggregated into a tree structure based on the elements obtained in step 1, thereby abstracting an aggregation template.
[0019] Step 3 includes:
[0020] Analyze search habits and needs, obtain search conditions, and abstractly describe the search conditions. The process of analyzing search habits and needs mainly includes analyzing people's daily search habits and search needs manually or using existing big data analysis methods; the abstract description of search conditions includes but is not limited to: the attribute value must be greater than (less than, equal to, contain, etc.) the expected value, the total number (average, sum, etc.) meets expectations, paging conditions (number of pages, number of items per page, etc.), sorting attributes (positive order, reverse order, etc.).
[0021] Step 4 includes:
[0022] The construction mode is used to summarize the abstract description information of the search conditions and form a tree structure of commonly used search conditions.
[0023] Step 5 includes:
[0024] The data is classified and extracted according to the aggregation template. The methods of extracting data include reading relevant data from a database, extracting relevant data from a file, or manually entering relevant data.
[0025] Step 6 includes:
[0026] According to the search parameters established in step 4, the data extracted in step 5 are combined with the search parameters to complete the data preprocessing.
[0027] Step 7 includes:
[0028] The preprocessed data is stored in the graph database. When storing the data, the aggregation template corresponding to the preprocessed data and the search parameters contained therein are also stored in the graph database.
[0029] Step 8 includes:
[0030] Use natural language parsing algorithms to segment search sentences. The natural language parsing algorithms used include dictionary-based segmentation methods and statistical-based segmentation methods. Synonyms are added and stop words are removed.
[0031] The word segmentation method based on the dictionary refers to establishing a dictionary table, and when the search term contains a field in the dictionary table, the word segmentation is preferentially performed according to the content in the dictionary table;
[0032] The statistical-based word segmentation method refers to statistically analyzing commonly used fields. When commonly used fields appear in the search terms, word segmentation is performed preferentially according to the fields with high statistical values. The commonly used fields include fields with high frequency in people's daily production and life obtained by analyzing the existing big data methods.
[0033] Adding synonyms refers to establishing a synonym table, and automatically replacing the participle with the synonym corresponding to the participle when a synonym appears during the word segmentation process;
[0034] The removal of stop words refers to establishing a stop word dictionary table, and not considering using the fields in the stop word dictionary table for word segmentation processing when performing word segmentation processing;
[0035] Step 9 includes:
[0036] When searching, the search terms are directly segmented using dictionary-based and statistics-based methods. The input search content is divided into word fields, which are then converted according to a synonym list or removed according to a stop word list. The processed word fields are searched in the graph database, and the search results are sorted and presented according to the degree of association with the words.
[0037] The biggest difference between the present invention and the traditional retrieval method is that the steps of data retrieval are optimized. Different from the traditional data retrieval method which searches multiple times in steps, the expected results can be obtained by searching once, which greatly improves the retrieval efficiency and simplifies the traditional data retrieval process.
[0038] The advantages of the present invention are: creating an aggregation template based on ontology, the aggregation template describes the connection between data and some characteristics of the data itself, and designing retrieval parameters using the construction mode according to actual needs, thereby constructing search conditions for data retrieval.
[0039] Specifically, compared with the prior art, the present invention has the following significant advantages:
[0040] 1. Create collection templates based on ontology to more accurately describe the relationship between data;
[0041] 2. Results can be obtained with one search, greatly improving data retrieval efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments, and the above and / or other advantages of the present invention will become more clear.
[0043] Figure 1 This is a data theme structure diagram.
[0044] Figure 2 This is a data table topology diagram.
[0045] Figure 3 It is a topological diagram of data tables and fields.
[0046] Figure 4 Construct a pattern graph for the parameter.
[0047] Figure 5 It is a flow chart of the steps of the present invention.
[0048] Figure 6 It is the aggregation template diagram. DETAILED DESCRIPTION
[0049] The traditional retrieval methods are as follows:
[0050] Set up a data topic structure such as Figure 1 As shown:
[0051] If you want to search for schools with clinical medicine teachers in East China, you should first search for clinical medicine information in the employee data table, and then search for school-related information based on the associated school information. This requires two steps.
[0052] If you want to search for schools with at least 2 professors of clinical medicine, you should first search for content with at least 2 professors in the faculty data table, then search for clinical medicine information in the employee table, and finally search for school information in the school table. This requires three steps to complete;
[0053] If you want to search for schools with clinical medicine professors with more than 20 years of service and at least 2 schools, you should first search for information with a service time greater than 20 and a number greater than 2 in the service time table, then search for professor information in the faculty table, then search for clinical medicine information in the employee table, and finally search for school information in the school table. A total of four steps are required to complete.
[0054] From the above examples, it can be found that the traditional data subject service retrieval process is relatively complicated. The more conditions there are, the more steps are required to retrieve the data. In order to solve this problem, the present invention proposes an ontology-based data retrieval method. For similar problems, results can be obtained with one query, which greatly improves the retrieval efficiency.
[0055] The present invention provides an ontology-based data retrieval method, comprising:
[0056] Step 1: Analyze data structure and data characteristics according to the ontology framework;
[0057] Step 2: Establish an aggregation template based on the data structure and data characteristics;
[0058] Step 3: Analyze search habits and needs and abstract search conditions;
[0059] Step 4, use the build mode to design the search parameters;
[0060] Step 5, extracting corresponding data according to the content of the aggregation template;
[0061] Step 6, complete data preprocessing according to the search parameters;
[0062] Step 7: Store the data into the graph database according to the aggregation template and search parameters;
[0063] Step 8, parsing the input search statement according to natural language;
[0064] Step 9: Use the parsed search terms to search in the graph database.
[0065] Furthermore, in one implementation, step 1 includes:
[0066] According to the ontology framework, analyze the data structure and data characteristics:
[0067] The ontology framework refers to a set of definitions and hierarchical relationships between concepts. Its structure, concepts, and relationships between concepts can be defined in a top-down, bottom-up, or a combination of the two. Each ontology can be subdivided into multiple levels of subclasses according to actual needs for expansion. After defining the hierarchy, the properties of the concepts themselves and their restrictions need to be refined layer by layer.
[0068] For example, there are four data tables A, B, C, D, and E. Each table has multiple fields (features). The five tables are related to each other and have certain dependencies. For the convenience of explanation, A is set as school, B as employees, C as students, D as teachers, and E as length of service. Obviously, A has the widest range, while B and C both depend on A, D depends on B, and E depends on D. Figure 2 The topology diagram shown;
[0069] In order to obtain the aggregation template, the data structure and data characteristics should be fully analyzed. Obviously, A, B, C, D, and E are one layer of the ontology framework. For the data in this layer, its subordinate data should have the ability to describe the upper-level data. Taking A (school) as an example, its subordinate data (data table fields) include but are not limited to region, area, number of students, school teaching ability, school evaluation, etc. These subordinate data can all be used as specific descriptions of the school. Therefore, when establishing the aggregation template in the subsequent steps, these subordinate attribute information should be fully considered.
[0070] Furthermore, in one implementation, step 2 includes:
[0071] After analyzing the data structure and data characteristics, an aggregation template should be established based on the data structure and data characteristics.
[0072] For the convenience of explanation, only one type of subordinate data is selected from each type of superior data.
[0073] There are five fields in the table, a, b, c, d, and e, which belong to the five tables A, B, C, D, and E respectively. For the convenience of explanation, assume that a is the region, b is the age, c is the gender, d is the job title, and e is the time. Then we get the following Figure 3 The topology diagram shown is:
[0074] The topology map obtained in this way is the abstracted aggregation template.
[0075] Furthermore, in one implementation, step 3 includes:
[0076] Analyze search habits and needs, and abstract search conditions.
[0077] In the above example, suppose the user needs to search for information about a certain school. Based on daily search habits and search needs, the search conditions that may be used include "within a certain area (inclusive)", "school establishment time is longer than 100 years (greater than expected value)", and "best school (sorting attribute)". Therefore, by abstracting these commonly used search conditions, the following search conditions can be obtained:
[0078] The attribute value must be greater than (less than, equal to, including, etc.) the expected value, the total (average, sum, etc.) must meet expectations, the paging conditions (number of pages, number of entries per page, etc.), and the sorting properties (ascending, descending, etc.).
[0079] Furthermore, in one implementation, step 4 includes:
[0080] The method of big data analysis is used to analyze people's daily search habits and search needs. The specific method used is the indicator analysis method, and the process is as follows:
[0081] (1) Use natural language parsing algorithms to segment people’s daily search content. That is, use natural language parsing algorithms to break down complete search sentences into words and remove meaningless conjunctions such as and, or, etc.
[0082] (2) Selecting the majority as an indicator of the big data analysis method, analyzing the data obtained in (1), and obtaining the results of the word arrangement from high to low according to the majority;
[0083] (3) Analyze the characteristics of common words and abstract the search conditions. For example, when the common words are "higher than" or "more than", the abstract search condition is that the attribute value must be greater than the expected value.
[0084] Furthermore, in one implementation, step 4 includes:
[0085] Use Build mode to design the retrieval parameters.
[0086] The construction mode is to separate the construction of a complex object from its representation, so that the same construction process can create different representations. For example, for the example of step 1, parameter information can be created such as Figure 4 As shown;
[0087] in,
[0088] QueryBuilder: collects all request parameter information;
[0089] NodeCondition: contains all conditions of a path, including attribute conditions and aggregation conditions;
[0090] Must: attribute filtering condition;
[0091] EqualsCondition: The property value must be equal to the expected value;
[0092] LagerThanCondition: The attribute value must be greater than the expected value;
[0093] LessThanCondition: The property value must be less than the expected value;
[0094] BetweenCondition: The attribute must be between the expected range;
[0095] LikeCondition: The attribute must contain the expected value;
[0096] LikeLeftCondition: The attribute must contain the expected value on the left;
[0097] LikeRightCondition: The attribute must contain the expected value on the right;
[0098] Aggregation: aggregation conditions;
[0099] CountCondition: The total number meets expectations;
[0100] SumCondition: The sum meets expectations;
[0101] AvgCondition: The average value meets expectations;
[0102] PageCondition: paging condition;
[0103] CurrentPage: current page number;
[0104] PageSize: the size of each page;
[0105] SortCondition: sorting parameters;
[0106] SortBy: sorting attribute;
[0107] SortType: sort type, ascending or descending.
[0108] Use the above methods to construct search conditions and design retrieval parameters to prepare for subsequent searches.
[0109] Furthermore, in one implementation, step 5 includes:
[0110] Extract corresponding data according to the content of the aggregation template. The data sources include data extracted from the data table, data extracted from the file, and data entered manually. Arrange these data according to the aggregation template, and add the relevant attributes required by the aggregation template. For example, in the above example, taking school A and region a as an example, the school data obtained in the database is classified and sorted according to the region attributes and reserved for subsequent operations.
[0111] Furthermore, in one implementation, step 6 includes:
[0112] Complete data preprocessing based on the retrieval parameters.
[0113] In the above example, taking school A and region a as an example, attributes are added such as region a belongs to a certain country, or a certain region in a certain country. This information is pre-processed according to the search parameters before subsequent operations are performed.
[0114] Furthermore, in one implementation, step 7 includes:
[0115] Store the data into the graph database based on the aggregation template and retrieval parameters.
[0116] The data processed in step 5 and step 6 are stored in a graph database. The graph database used in the present invention is Neo4j graph database. Neo4j is a high-performance NOSQL graph database that stores structured data on a graph and has all the characteristics of a mature database, as well as the advantages of high performance and light weight. Therefore, compared with the traditional method, using Neo4j database for storage and query has higher performance.
[0117] Furthermore, in one implementation, step 8 includes:
[0118] Parse the input search statement based on natural language.
[0119] The natural language algorithm is used to analyze the input search statement. For example, if the input search statement is "the best school in North China", the natural language algorithm is first used to analyze it, and a series of words obtained are "North China", "region", "best", and "school". The search information parsed at this time includes "attribute must contain expected value", "region: North China", "sort attribute: in descending order of quality", and "search content: school".
[0120] Furthermore, in one implementation, step 9 includes:
[0121] Use the parsed search terms to search in the graph database.
[0122] Set the search information obtained in step 8 as the search conditions, use these conditions to search in the graph database, and finally get the required information. Taking the Neo4j graph database as an example, the search information obtained in the above step 8 example is "the attribute must contain the expected value", "region: North China", "sort attribute: in reverse order of quality", "search content: school", then design the cypher statement "match (n: school)-[region: North China] return n order by "school quality" desc", use this cypher statement to query in the Neo4j database to get the best school ranking results in North China.
[0123] The example of the present invention discloses an ontology-based data retrieval method, which is applied to the data retrieval process.
[0124] like Figure 5 As shown, the ontology-based data retrieval method described in this embodiment includes:
[0125] Step 1: Analyze data structure and data characteristics according to the ontology framework;
[0126] Step 2: Establish an aggregation template based on the data structure and data characteristics;
[0127] Step 3: Analyze search habits and needs and abstract search conditions;
[0128] Step 4, use the build mode to design the search parameters;
[0129] Step 5, extracting corresponding data according to the content of the aggregation template;
[0130] Step 6, complete data preprocessing according to the search parameters;
[0131] Step 7: Store the data into the graph database according to the aggregation template and search parameters;
[0132] Step 8, parsing the input search statement according to natural language;
[0133] Step 9: Use the parsed search terms to search in the graph database.
[0134] For example, if you want to search for schools in North China that have at least five female professors with more than 20 years of working experience, the first step is to analyze the data structure and data characteristics in the database. In order to search for information, you should know information such as the school, region, employee, gender, faculty, title, length of work, and time.
[0135] The second step is to establish a Figure 6 The aggregation template shown.
[0136] The third step is to abstract the search conditions into attribute filtering conditions, aggregation conditions, and paging conditions according to search habits and needs.
[0137] The fourth step is to design the search parameters so that the attribute filtering condition must contain the expected value, the aggregation condition is that the total number meets the expectations, and the paging condition is 20 pieces of information per page.
[0138] Step 5: According to Figure 6 The established template extracts corresponding data from relevant databases, texts or through manual entry. The data mainly include: school region data, employee gender data, faculty title data, and length of service time data.
[0139] Step 6. Add relevant information of the search parameters to the data extracted in step 5 according to the search parameters.
[0140] Step 7: Store the data obtained in step 6 into the Neo4j graph database.
[0141] Step 8. Parse the search statement and obtain "Search content: school", "Region: must be included in North China", "Employee: gender must include female", "Teacher: title must include professor", "Quantity: total number is not less than 5", "Length of service: more than 20 years".
[0142] Step 9: Use the above information as search conditions to search in the graph database, and the results will be displayed in the form of 20 data per page.
[0143] The present invention provides a data retrieval method based on ontology. There are many methods and ways to implement the technical solution. The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the protection scope of the present invention. All components not specified in this embodiment can be implemented by existing technologies.
Claims
1. A data retrieval method based on ontology, characterized in that: The steps include: Step 1: Analyze data structure and data characteristics according to the ontology framework; Step 2: Establish a tree structure aggregation template based on the data structure and data characteristics; Step 3: Use big data analysis methods to analyze search habits and needs and abstract search conditions; Step 4, design the search parameters using the build mode according to the obtained search conditions; Step 5, adding data from a database, a text file or by inputting data according to the content of the aggregation template, and then extracting the corresponding data; Step 6, combining the data with the parameters according to the search parameters to complete the data preprocessing; Step 7, storing the preprocessed data into the graph database; Step 8, parsing the input search statement according to a natural language parsing algorithm; Step 9, using the parsed search terms to search in the graph database; Step 1 includes: According to the ontology framework, the data structure and data characteristics are analyzed to obtain the elements that conform to the description of the ontology framework and record the elements; In step 1, the ontology framework refers to a set of hierarchical relationships between definitions and concepts. The ontology framework structure and its attributes are defined according to the attributes of the ontology and the concept. Each ontology is divided into subclasses of more than two levels according to actual needs for expansion. After the levels are defined, the properties and restrictions of the concepts are refined layer by layer according to the description of the concepts in the levels, thereby forming an aggregation template. Step 8 includes: Use natural language parsing algorithms to segment search sentences. The natural language parsing algorithms used include dictionary-based segmentation methods and statistical-based segmentation methods. Synonyms are added and stop words are removed. The word segmentation method based on the dictionary refers to establishing a dictionary table, and when the search term contains a field in the dictionary table, the word segmentation is preferentially performed according to the content in the dictionary table; The statistical-based word segmentation method refers to performing statistics on commonly used fields. When commonly used fields appear in the search terms, word segmentation is performed preferentially according to the fields with high statistics. Adding synonyms refers to establishing a synonym table, and automatically replacing the participle with the synonym corresponding to the participle when a synonym appears during the word segmentation process; The removal of stop words refers to establishing a stop word dictionary table, and not considering using the fields in the stop word dictionary table for word segmentation processing when performing word segmentation processing; Step 9 includes: When searching, the search terms are directly segmented using dictionary-based and statistics-based methods. The input search content is divided into word fields, which are then converted according to a synonym list or removed according to a stop word list. The processed word fields are searched in the graph database, and the search results are sorted and presented according to the degree of association with the words.
2. The method according to claim 1, characterized in that Step 2 includes: The relationships between the data tables in the database and the features of the data tables are aggregated into a tree structure based on the elements obtained in step 1, thereby abstracting an aggregation template.
3. The method according to claim 2, characterized in that Step 3 includes: Utilize big data analysis methods to analyze search habits and needs, obtain search conditions, and describe the search conditions in an abstract manner.
4. The method according to claim 3, characterized in that Step 4 includes: The construction mode is used to summarize the abstract description information of the search conditions and form a tree structure of commonly used search conditions.
5. The method according to claim 4, characterized in that Step 5 includes: The data is classified and extracted according to the aggregation template. The methods of extracting data include reading relevant data from a database, extracting relevant data from a file, or entering relevant data.
6. The method according to claim 5, characterized in that Step 6 includes: According to the search parameters established in step 4, the data extracted in step 5 are combined with the search parameters to complete the data preprocessing.
7. The method according to claim 6, characterized in that Step 7 includes: The preprocessed data is stored in the graph database. When storing the data, the aggregation template corresponding to the preprocessed data and the search parameters contained therein are also stored in the graph database.
Citation Information
Patent Citations
Relational database information retrieval method and device based on ontology semantic index
CN104021198A
System and method for extracting semantic metadata based on ontology
KR1020090061844A
