Ontology generation method, device and equipment based on implicit superclass mining
By determining high-frequency columns and subclass relational data tables based on the implicit superclass mining method in the relational database, and generating a relational data ontology, the problem of missing implicit semantics in the existing technology is solved, and the accuracy rate is improved.
Patent Information
- Application Number
- CN202410441883.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-12
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-04-12
AI Technical Summary
The existing ontology generation method for relational databases only considers the basic ontology semantics and cannot mine the implicit semantics that are not directly expressed in the metadata, resulting in the generated ontology losing some information, which is low accuracy.
Using an implicit superclass mining method, we obtain column names of multiple relational data tables from the relational database, determine the high-frequency column names through the number of occurrences, eliminate interfering columns, calculate the standard deviation to determine the target column name, and then determine the sub- Class relationship data table, generate relational data ontology.
Improve the accuracy of ontology generation, avoid semantic omissions, obtain a more accurate ontology, and can mine the implicit superclass and subclass relationships between multiple relational data tables.
Smart Images

Figure CN118503440B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an ontology generation method, device and equipment based on implicit superclass mining. Background Art
[0002] Ontology refers to the standardized semantic description of the concept set and its internal logical relationship in a specific field, which provides a basic classification framework and association description mechanism for domain data, and then rationally organizes the semantics contained in the data. Ontology technology provides a standard semantic description for domain concepts and their relationships, and is the basis for data semantic integration and knowledge sharing.
[0003] Automatically generating ontologies from relational databases (RDBs) has always been a hot topic in the field of semantic ontology. However, existing ontology generation methods for relational databases only consider the most basic ontology semantics in relational databases, such as table names corresponding to class names and foreign key names corresponding to object attributes. They are unable to mine implicit semantics that are not directly expressed by metadata, causing the generated ontology to lose some ontology semantic information. Therefore, it is necessary to develop an ontology generation method, device and equipment based on implicit superclass mining to improve the accuracy of the generated ontology. Summary of the invention
[0004] In view of the above problems, the embodiments of the present application provide an ontology generation method, apparatus and device based on implicit superclass mining, so as to overcome the above problems or at least partially solve the above problems.
[0005] In a first aspect of an embodiment of the present application, a method for ontology generation based on implicit superclass mining is provided, the method comprising:
[0006] Acquire multiple relational data tables to be processed from a relational database;
[0007] Extracting the column name of each data column in the plurality of relational data tables, and obtaining the occurrence number information of each column name in the plurality of relational data tables;
[0008] Determine a target column name according to the occurrence count information, where the target column name represents a high-frequency column name that appears in the plurality of relational data tables;
[0009] Determine a subclass relationship data table from the plurality of relationship data tables according to the target column name;
[0010] The data column corresponding to the target column name is used as the data column of the implicit superclass, and the class corresponding to the subclass relationship data table is used as the subclass of the implicit superclass; the implicit superclass represents the main features between the multiple relationship data tables;
[0011] A relational data ontology for the plurality of relational data tables is generated according to the implicit superclass.
[0012] In a possible implementation, determining the target column name according to the occurrence count information includes:
[0013] Eliminate interfering column names in the column names of each data column according to the occurrence number information;
[0014] Arrange the remaining column names in descending order of their occurrence frequency to obtain a candidate sequence;
[0015] For any column name in the candidate sequence, obtain its two adjacent column names to form a candidate array;
[0016] Calculate the standard deviation of each candidate array in descending order of occurrence;
[0017] According to the standard deviation of each of the candidate arrays, the column names in the candidate arrays that meet the first condition are determined as the target column names.
[0018] In a possible implementation manner, the interference column name includes at least: a first interference column name and a second interference column name, and excluding the interference column name in the column name of each data column according to the occurrence number information includes:
[0019] According to the occurrence count information, the column names whose occurrence counts are greater than or equal to the maximum occurrence count threshold are excluded as first interference column names;
[0020] According to the occurrence count information, the column name with an occurrence count of 1 is excluded as the second interference column name.
[0021] In a possible implementation, determining, according to the standard deviation of each candidate array, a column name in the candidate array that meets the first condition as the target column name includes:
[0022] When the standard deviation of the candidate array is greater than a preset standard deviation threshold, it is determined that the candidate array does not meet the first condition, and the standard deviation of the next candidate array is calculated in descending order of the number of occurrences;
[0023] When the standard deviation of the candidate array is less than or equal to the preset standard deviation threshold, determining that the candidate array satisfies the first condition, and determining the column name in the candidate array that satisfies the first condition as the target column name;
[0024] When the standard deviation of the candidate array is greater than the preset standard deviation threshold again, or when the calculation of the standard deviations of all candidate arrays is completed, the calculation of the standard deviations of subsequent candidate arrays is stopped.
[0025] In a possible implementation, determining the subclass relationship data table from the multiple relationship data tables according to the target column name includes:
[0026] Put the data column corresponding to the target column name into the target array;
[0027] Calculating the number of columns of data in the target array contained in each relational data table in the plurality of relational data tables;
[0028] A relational data table whose column quantity is greater than or equal to a preset column quantity threshold is determined as the subclass relational data table.
[0029] In a possible implementation manner, after eliminating the interfering column name, the method further includes:
[0030] When the maximum number of occurrences of the remaining column names is less than or equal to the minimum frequency threshold, the operation of searching for the target column is stopped, and it is determined that the multiple relational data tables do not contain the implicit superclass.
[0031] In a possible implementation, generating a relational data ontology for the plurality of relational data tables according to the implicit superclass includes:
[0032] For the multiple relational data tables, respectively create corresponding ontology classes;
[0033] According to the implicit superclass, a parent-child class relationship is created between the implicit superclass and the entity class corresponding to the subclass relationship data table;
[0034] For each data column of the implicit superclass, create a data attribute with the same name in the corresponding ontology, so that its domain is the implicit superclass and its value range is the SQL data type of the data column;
[0035] For each primary key in the relational data table, for each data column in the primary key, a data attribute with the same name is created in the ontology, with its domain being the corresponding ontology class and its value range being the SQL data type of the data column.
[0036] A second aspect of an embodiment of the present application provides an ontology generation device based on implicit superclass mining, the device comprising:
[0037] A data acquisition module is used to acquire multiple relational data tables to be processed from a relational database;
[0038] An occurrence number information acquisition module, used to extract the column name of each data column in the multiple relational data tables, and obtain the occurrence number information of each column name in the multiple relational data tables;
[0039] A target column name determination module, used to determine a target column name according to the occurrence count information, wherein the target column name represents a high-frequency column name that appears in the plurality of relational data tables;
[0040] A subclass relationship data table determination module, configured to determine a subclass relationship data table from the plurality of relationship data tables according to the target column name;
[0041] An implicit superclass generation module is used to use the data column corresponding to the target column name as the data column of the implicit superclass, and use the class corresponding to the subclass relationship data table as the subclass of the implicit superclass; the implicit superclass represents the main features between the multiple relationship data tables;
[0042] The ontology creation module is used to generate a relational data ontology for the plurality of relational data tables according to the implicit superclass.
[0043] In a possible implementation, the target column name determination module includes:
[0044] An interference column name exclusion submodule, used to exclude interference column names in the column names of each data column according to the occurrence number information;
[0045] The candidate sequence generation submodule is used to arrange the remaining column names in descending order of the number of occurrences to obtain a candidate sequence;
[0046] A candidate array generation submodule is used to obtain two adjacent column names for any column name in the candidate sequence to form a candidate array;
[0047] The standard deviation calculation submodule is used to calculate the standard deviation of each candidate array in descending order of the number of occurrences;
[0048] The target column name determination submodule is used to determine the column name in the candidate array that meets the first condition as the target column name according to the standard deviation of each candidate array.
[0049] In a possible implementation manner, the interference column name includes at least: a first interference column name and a second interference column name, and the interference column name exclusion submodule includes:
[0050] A first excluding unit, configured to exclude, according to the occurrence count information, column names whose occurrence counts are greater than or equal to a maximum occurrence count threshold as first interference column names;
[0051] The second excluding unit is used to exclude the column name with a number of occurrence of 1 as the second interference column name according to the number of occurrence information.
[0052] In a possible implementation, the target column name determination submodule includes:
[0053] A first target column name determination unit is used to determine that the candidate array does not meet the first condition if the standard deviation of the candidate array is greater than a preset standard deviation threshold, and continue to calculate the standard deviation of the next candidate array in descending order of the number of occurrences;
[0054] a second target column name determining unit, configured to determine, when the standard deviation of the candidate array is less than or equal to the preset standard deviation threshold, that the candidate array satisfies the first condition, and determine the column name in the candidate array that satisfies the first condition as the target column name;
[0055] The stopping unit is used to stop calculating the standard deviation of subsequent candidate arrays when the standard deviation of the candidate array is greater than the preset standard deviation threshold again, or when the standard deviation calculation of all candidate arrays is completed.
[0056] In a possible implementation, the subclass relationship data table determination module includes:
[0057] A target array creation submodule is used to put the data column corresponding to the target column name into the target array;
[0058] A column quantity calculation submodule, used to calculate the column quantity of data columns in the target array contained in each relational data table in the plurality of relational data tables;
[0059] The subclass relationship data table determination submodule is used to determine a relationship data table whose column quantity is greater than or equal to a preset column quantity threshold as the subclass relationship data table.
[0060] In a possible implementation, the device further includes:
[0061] The stop determination module is used to stop performing the operation of searching for the target column after excluding the interfering column names and determine that the multiple relational data tables do not contain the implicit superclass when the maximum number of occurrences of the remaining column names is less than or equal to the minimum frequency threshold.
[0062] In a possible implementation, the ontology creation module includes:
[0063] A first creation submodule is used to create corresponding ontology classes for the plurality of relational data tables respectively;
[0064] A second creation submodule is used to create a parent-child class relationship between the implicit superclass and the entity class corresponding to the subclass relationship data table according to the implicit superclass;
[0065] A third creation submodule is used to create a data attribute with the same name in the corresponding ontology for each data column of the implicit superclass, so that its definition domain is the implicit superclass and its value range is the SQL data type of the data column;
[0066] The fourth creation submodule is used to create a data attribute with the same name in the ontology for each data column in the primary key in each relational data table, with its definition domain being the corresponding ontology class and its value range being the SQL data type of the data column.
[0067] The third aspect of the embodiments of the present application also provides an electronic device, including a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to implement the steps in the ontology generation method based on implicit superclass mining described in the first aspect of the embodiments of the present application.
[0068] The fourth aspect of the embodiment of the present application also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps in the ontology generation method based on implicit superclass mining described in the first aspect of the embodiment of the present application are implemented.
[0069] The fifth aspect of the embodiments of the present application further provides a computer program product, which, when running on an electronic device, enables a processor to implement the steps in the ontology generation method based on implicit superclass mining as described in the first aspect of the embodiments of the present application.
[0070] An embodiment of the present application provides an ontology generation method based on implicit superclass mining, the method comprising: obtaining multiple relational data tables to be processed from a relational database; extracting the column names of each data column in the multiple relational data tables, and obtaining the number of occurrences of each column name in the multiple relational data tables; determining a target column name based on the number of occurrences, the target column name representing a high-frequency column name that appears in the multiple relational data tables; determining a subclass relational data table from the multiple relational data tables based on the target column name; using the data column corresponding to the target column name as the data column of an implicit superclass, and using the class corresponding to the subclass relational data table as a subclass of the implicit superclass; the implicit superclass represents the main features between the multiple relational data tables; and generating a relational data ontology for the multiple relational data tables based on the implicit superclass.
[0071] The specific beneficial effects are:
[0072] Compared with directly taking the column name with the highest frequency, the embodiment of the present application determines the high-frequency column names that appear in multiple relational data tables as the target column names based on the number of occurrences information, so as to exclude a part of the column names that represent invalid information and widely appear in each relational data table (for example, ID column, etc.). In addition, the target column names found have a certain correlation (multiple column names often appear in a relational data table).
[0073] Therefore, the embodiment of the present application determines the subclass relationship data table where the target column names appear in a plurality of relationship data tables according to the target column names, that is, the subclass relationship data table contains more common data columns, indicating that there are some identical attributes (data columns corresponding to the target column names) between the subclass relationship data tables. Thus, the data columns corresponding to the target column names are used as the data columns possessed by the implicit superclass, and the classes corresponding to the subclass relationship data table are used as the subclasses of the implicit superclasses. Then, according to the virtual superclasses, the ontology generation rules are applied to generate multiple relational data ontologies, so as to mine the reasonable implicit superclasses (i.e., implicit semantics) in the relationship data tables, avoid semantic omissions, and obtain more accurate ontologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0075] Figure 1 It is a flowchart of the steps of an ontology generation method based on implicit superclass mining provided in an embodiment of the present application;
[0076] Figure 2 It is a structural schematic diagram of an ontology generation device based on implicit superclass mining provided in an embodiment of the present application;
[0077] Figure 3 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0078] The exemplary embodiments of the present application will be described in more detail below in conjunction with the accompanying drawings in the embodiments of the present application. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to enable the scope of the present application to be fully communicated to those skilled in the art.
[0079] Currently, relational databases are widely used to store and manage large amounts of data in various fields and industries. However, due to the weak knowledge representation capabilities of relational data models, semantic integration, knowledge mining, understanding and interactive operations based on relational databases are very challenging.
[0080] Ontology refers to the standardized semantic description of the concept set and its internal logical relationship in a specific domain. It can provide a basic classification framework and association description mechanism for domain data, and then reasonably organize the semantics contained in the data. Ontology can be regarded as a digital abstraction of the semantic framework of human knowledge. It is a knowledge bridge between humans and machines, and has the advantages of being easy to query, expand, understand, and share. The currently popular knowledge graph is also an intelligent application based on ontology technology. Ontology modeling refers to the use of ontology-based knowledge representation methods to model knowledge. Its core task is to clarify the concepts, attributes, constraints, and hierarchical relationships between concepts in the domain. It usually includes: domain analysis and overview, definition of concepts and relationships, establishment of classes and instances, definition of rules and constraints, etc. Specifically, it is a process of describing knowledge by defining a set of ontology axioms. Ontology technology provides a standard semantic description for domain concepts and their relationships, and is the basis for data semantic integration and knowledge sharing.
[0081] Ontology generation, also known as dynamic ontology generation, is a technology that uses computer programs or algorithms to automatically complete ontology modeling. Dynamic ontology means that the ontology content can be flexibly expanded, modified or deleted according to the adjustment, addition or deletion of the underlying data source when the system is running. This makes it possible to work in a constantly changing environment and quickly integrate and associate with other ontologies. Correspondingly, dynamic ontology generation refers to the system's ability to automatically and agilely generate an ontology based on the structure and content of a given data source. The ontology generation method proposed in this application belongs to a dynamic ontology generation method, which is a method for automatically modeling or generating "concepts" or "classes" in an ontology.
[0082] Automatically converting relational databases into ontology can add semantics to data, achieve interoperability with other systems and applications, support reasoning about data, and create more flexible knowledge representation. Currently, there is a great demand for the use of ontology to perform semantic modeling on relational databases. Automatically generating ontologies from relational databases has always been a research hotspot in the field of semantic ontology. In order to improve the efficiency of relational data ontology modeling, academia and industry have proposed a variety of automatic ontology generation algorithms for relational data. For a given relational data source, such algorithms are responsible for automatically parsing ontology semantic features from the features of the relational database and generating ontology axioms.
[0083] Ontology modeling in the traditional sense is a relatively labor-intensive task, especially in the current big data era. The content and structure of data sources in many fields are in dynamic change. There is an urgent need for a method and tool that can complete ontology construction in an agile and dynamic manner.
[0084] However, the data source content and structure in relational databases are complex and diverse, which makes the applicability of existing ontology modeling technology limited. It is easy to miss the implicit semantics in relational data tables, resulting in a high error rate in the generated ontology. Specifically, the existing relational database ontology generation method only considers the most basic ontology semantics in relational databases, the correspondence between relational database tables, fields, primary and foreign keys, etc. and ontology axioms, such as the table name corresponds to the class name, and the foreign key name corresponds to the object attribute. This will lose some ontology information and has limited applicability. How to discover implicit classes and implicit relationships that are not explicitly expressed in metadata in relational databases is also an area worthy of research.
[0085] In view of the above problems, the embodiment of the present application proposes an ontology generation method based on implicit superclass mining to generate a more accurate relational data ontology. The ontology generation method based on implicit superclass mining provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through some embodiments and their application scenarios.
[0086] The first aspect of the embodiment of the present application provides an ontology generation method based on implicit superclass mining, referring to Figure 1 , Figure 1 A flowchart of a method for generating an ontology based on implicit superclass mining provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0087] Step S101, obtaining a plurality of relational data tables to be processed from a relational database.
[0088] In this embodiment, the relational database may be any database for storing and managing relational data. For example, the relational database may be a material transportation information relational database, which is mainly used to store material transportation relational data (such as the facility ID, facility category code, height, length and width of the transportation facility). In step S101, multiple relational data tables T1-T1 are extracted from the relational database. n .
[0089] Step S102: extract the column name of each data column in the plurality of relational data tables, and obtain the occurrence number information of each column name in the plurality of relational data tables.
[0090] For the extracted multiple relational data tables T1-T nFirst, for each relational data table, extract the column name of each data column in the relational data table. For example, the i-th table T i The column name of the j-th data column is C ij Then, based on the column name, calculate the number of columns in multiple relational data tables T1-T n The occurrence number information is obtained by calculating the number of occurrences of each column name in multiple relational data tables. According to the occurrence number information, the distribution of the data columns with the same name in each relational data table in the relational database can be known.
[0091] Step S103, according to the occurrence frequency information, determine the target column name, the target column name represents the high-frequency column name that appears in the multiple relational data tables. Specifically, the data column corresponding to the target column name is the data column that appears frequently and concentratedly in multiple relational data tables at the same time, that is, the common data column of multiple relational data tables (the number of occurrences in multiple relational data tables is high, and often multiple data columns appear together). Each data column of each relational data table is used to represent a corresponding attribute or feature, and the data column corresponding to the target column name represents the same attribute or common feature of multiple relational data tables.
[0092] In the related art, the common data columns (i.e., data columns with the same name) in a relational database are often scattered in various data tables in large quantities, and when different data table sets are taken as the objects of investigation, the common data columns contained in each set may also be different. For example, some data table sets have more common data columns, while other data table sets have fewer common data columns. Therefore, for multiple relational data tables in a relational database, it is necessary to determine the data columns that appear in a plurality of relational data tables and have the same column names as common data columns based on the column names of each data column, thereby extracting one or more common data columns to generate a reasonable implicit superclass. In an embodiment of the present application, in order to find the common data columns between multiple relational data tables by the same column names, it is necessary that the format of the relational data tables has a high degree of uniformity and can represent the corresponding domain characteristics to a certain extent, that is, there is a relatively fixed unified naming standard for the various column names of the multiple relational data tables in the relational database.
[0093] However, if all common data columns are directly extracted from multiple relational data tables based on the same column name, multiple implicit superclasses with different information granularities will be obtained. For example, for different data table subsets in multiple tables as candidate subclasses, superclasses with different information granularities will be extracted, and some superclasses may be completely worthless. For this reality, how to automatically discover superclasses with appropriate granularity is a challenging technical problem.
[0094] To solve the above problems, the present application proposes a sequence standard deviation algorithm based on ant colony optimization pheromone. The algorithm is adapted to the distribution of data columns with the same name in the relational data table, and the data column corresponding to the target column name is found therefrom, and then the corresponding subclass relational data table is obtained to construct a reasonable implicit superclass. Specifically, the purpose of ant colony optimization is to simulate the continuous secretion of pheromones by ants during the foraging process to mark the return path after successfully finding food (corresponding to a certain relational data table T currently found). i ), as the pheromone on the shortest return path to the food source continues to accumulate rapidly, its concentration must be higher than that of other return paths (other relationship data table T j ), and guide the subsequent ants to continue to forage along this route through pheromones. Therefore, it can be said that the high pheromone path (consisting of multiple tables with certain high-frequency data columns) i The composition of a superpath (i.e., an implicit superclass T) is a virtual superpath with certain characteristics created by ants to complete their foraging purposes. When the food is eaten up, the pheromone concentration on the foraging route will continue to decrease over time, and when a new food source (new application scenario) appears, the pheromone concentration will rise (the implicit characteristics of the new food source will be highlighted), resulting in the generation of a new superpath (the implicit superclass under the new application scenario).
[0095] The definition of the concept of "pheromone concentration" corresponds to a relational data table with some of the same attribute columns. The specific calculation of "pheromone concentration" can be calculated using the frequency of the column name appearing in each table, that is, the number of occurrences. "High concentration" means that the column name has a high cumulative number of occurrences. Since this "high concentration" is "contributed" by multiple relational data tables with certain characteristics, there will naturally be multiple column names with a high cumulative number of occurrences, and the number of occurrences of these column names is closer in order of magnitude to the number of occurrences of other column names.
[0096] In this embodiment, according to the concept of pheromone in ant colony optimization, the number of occurrences of column names is used as pheromone to discover the distribution of data columns with the same name in multiple relational data tables. According to the number of occurrences information, all column names that appear frequently and concentratedly in the multiple relational data tables are found, and then these column names are determined as target column names. Compared with directly taking the column name that appears with the highest frequency, the embodiment of the present application determines the high-frequency column names that appear concentratedly in multiple relational data tables as the target column names according to the number of occurrences information, so as to exclude a part of the column names (such as ID columns, etc.) that represent invalid information and appear widely in each relational data table. In addition, the target column names found have a certain correlation (multiple column names often appear concentratedly in the relational data table). The embodiment of the present application uses the data column corresponding to the target column name as the data column of the implicit superclass, and determines the relational data table where the target column name appears concentratedly as the subclass relational data table, so as to construct a reasonable implicit superclass to reflect the main characteristics of multiple relational data tables.
[0097] In a possible implementation, the step S103, determining the target column name according to the occurrence count information, includes:
[0098] Step S301: Eliminate interference column names in the column names of each data column according to the occurrence number information.
[0099] In a possible implementation manner, the interference column name includes at least: a first interference column name and a second interference column name, and excluding the interference column name in the column name of each data column according to the occurrence number information includes:
[0100] According to the occurrence count information, the column names whose occurrence count is greater than or equal to the maximum occurrence count threshold are excluded as the first interference column names. In order to exclude common data columns such as ID data columns that have no feature recognition function and are widely distributed in relational data tables, it is necessary to exclude column names with too high occurrence counts as interference items (i.e., first interference column names, indicating common column names without feature recognition function). Exemplarily, column names whose occurrence count is greater than or equal to n*80% are excluded as the first interference column names, where n represents the total number of relational data tables. The maximum occurrence count threshold can be set according to the actual application scenario and is not limited in the embodiments of the present application.
[0101] According to the occurrence information, the data column with an occurrence of 1 is excluded as the second interference data column. Specifically, for column names with too low occurrences (i.e., isolated columns with an occurrence of 1), which also do not meet the requirements of being a high-frequency data column name (do not meet the definition that the implicit superclass is composed of common data columns contained in multiple relational data tables), they can be directly excluded.
[0102] In a possible implementation manner, after eliminating the interfering column name, the method further includes:
[0103] When the maximum number of occurrences of the remaining column names is less than or equal to the minimum frequency threshold, the operation of searching for the target column is stopped, and it is determined that the multiple relational data tables do not contain the implicit superclass.
[0104] Exemplarily, the minimum frequency threshold is set to n*20%, where n represents the total number of relational data tables. After excluding interfering column names (column names with a number of occurrence greater than or equal to n*80%, and column names with a number of occurrence of 1), when the maximum number of occurrences among the remaining column names is still less than or equal to n*20%, it is determined that multiple relational data tables do not contain implicit superclasses, then subsequent operations are stopped (i.e., implicit superclasses are not created), and a relational data ontology is generated directly based on the multiple relational data tables obtained in step S101.
[0105] Step S302: Arrange the remaining column names in descending order of their occurrence frequency to obtain a candidate sequence {N m , ..., N1}. N represents the number of occurrences of the corresponding column name, and m represents the total number of all remaining column names.
[0106] Step S303: for any column name in the candidate sequence, obtain its two adjacent column names to form a candidate array.
[0107] Specifically, for the candidate sequence {N m , ..., N1}, every three column names are grouped as a group (i.e., candidate array), that is, in descending order of the number of occurrences, from the second column name to the second to last column name, for each column name, two adjacent column names are selected to form a candidate array. The first candidate array is (N m , N m-1 , N m-2 ), the second candidate array is (N m-1 , N m-2 , N m-3 ), ..., the i-th candidate array is (N m-i+1 , N m-i , N m-i-1 ), the last candidate array is (N3, N2, N1).
[0108] Step S304, the standard deviation of each candidate array is calculated in descending order of the number of occurrences. Specifically, the size of the preset standard deviation threshold can be set according to the actual application situation, for example, the preset standard deviation threshold is 1. Based on the set preset standard deviation threshold, the standard deviation of each candidate array is calculated according to the number of occurrences of each column name in the candidate array.
[0109] Step S305 : determining the column names in the candidate arrays that meet the first condition as the target column names according to the standard deviation of each of the candidate arrays.
[0110] Compared to directly taking the column name with the highest frequency, the present application first excludes the interference column names in multiple relational data tables (e.g., column names with a frequency greater than or equal to n*80%) based on the number of occurrences, so as to exclude a portion of column names that represent invalid information and widely appear in various relational data tables (e.g., ID columns, etc.). In addition, the present application embodiment can determine the column names that appear in multiple relational data tables by calculating the standard deviation of each candidate array, thereby determining them as target column names, so that the target column names found have a certain correlation (multiple column names often appear in relational data tables).
[0111] In a possible implementation, determining, according to the standard deviation of each candidate array, a column name in the candidate data satisfying the first condition as the target column name includes:
[0112] When the standard deviation of the candidate array is greater than a preset standard deviation threshold, it is determined that the candidate array does not satisfy the first condition, and the standard deviation of the next candidate array is calculated in descending order of the number of occurrences.
[0113] For example, when the i-th candidate array (N m-i+1 , N m-i , N m-i-1 ) is greater than 1 (the preset standard deviation threshold), it is determined that the candidate array does not meet the first condition (the standard deviation of the candidate array is less than or equal to the preset standard deviation threshold), and is an unqualified array, and step S304 is continued to calculate the i+1th candidate array (N m-i , N m-i-1 , N m-i-2 )’s standard deviation.
[0114] When the standard deviation of the candidate array is less than or equal to the preset standard deviation threshold, it is determined that the candidate array satisfies the first condition, and the column name in the candidate array that satisfies the first condition is determined as the target column name. m-i+1 , N m-i , N m-i-1) is less than or equal to 1 (the preset standard deviation threshold), then it is determined that the candidate array meets the first condition and is a qualified array. m-i+1 , N m-i , N m-i-1 ) is determined as the target column name. m-i+1 , N m-i , N m-i-1 ) The corresponding data column C in each relational data table m-i+1 , C m-i , C m-i-1 Extract it and add it to the target array C S middle.
[0115] Then, continue to execute step S304 to calculate the i+1th candidate array (N m-i , N m-i-1 , N m-i-2 )’s standard deviation.
[0116] When the standard deviation of the candidate array is greater than the preset standard deviation threshold again, or when the calculation of the standard deviations of all candidate arrays is completed, the calculation of the standard deviations of subsequent candidate arrays is stopped.
[0117] Target array C S The data columns in the final result are composed of the data columns corresponding to the column names in all qualified arrays that meet the first condition, that is, C S ={C k , ..., C k-p}, (m≥k>p≥1), C k is the first candidate array (C k , C k-1 , C k-2 ) in the first row of data, C k-p When the standard deviation of the candidate array is greater than the preset standard deviation threshold again, the previous candidate array (C k-p+2 , C k-p+1 , C k-p ) is the third data column, so C s The number of data columns in is p+1.
[0118] If no data column that meets the above requirements is extracted, k , ..., C k-p}, that is, the target array C S When the last is empty, subsequent operations are stopped to determine that the multiple relationship data tables do not contain the implicit superclass.
[0119] Step S104, according to the target column name, determine the subclass relationship data table from the multiple relationship data tables. Specifically, the subclass relationship data table represents multiple relationship data tables in which the data columns corresponding to the target column name appear in a set. Exemplarily, there are 10 types of target column names. For the multiple relationship data tables obtained in step S101, relationship data table A contains data columns corresponding to 3 types of target column names, and relationship data table B contains data columns corresponding to 8 types of target column names. Therefore, compared with relationship data table A, relationship data table B (the table in which the target column names appear in a set) is more in line with the attributes or features implicit in multiple relationship data tables that are concentratedly reflected by the target column names.
[0120] In a possible implementation, determining the subclass relationship data table from the multiple relationship data tables according to the target column name includes:
[0121] Put the data column corresponding to the target column name into the target array;
[0122] Calculating the number of columns of data in the target array contained in each relational data table in the plurality of relational data tables;
[0123] A relational data table whose column quantity is greater than or equal to a preset column quantity threshold is determined as the subclass relational data table.
[0124] When the preset standard deviation threshold is set to 1, according to the data calculation characteristics, the array T sub Each subclass relationship data table in the table should contain at least the target array C s ={C k , ..., C k-p}, (m≥k>p≥1), p-1 data columns in it, that is, it can contain at most C s So, first according to the target array C s The data column corresponding to the target column name in {C k , ..., C k-p}, calculate the number of data columns in the target array contained in each relational data table in the database, and then find a relational data table containing at least p-1 data columns from these relational data tables, determine it as a subclass relational data table, and form an array T sub .
[0125] In an embodiment of the present application, the number of times each column name appears in multiple relational data tables conforms to the normal distribution. According to its discrete type, in order to find high-value items (i.e., data columns corresponding to target column names) that are more concentrated in order of magnitude, the embodiment of the present application can first arrange the occurrences from large to small based on the number of occurrences information, and then use the standard deviation (for example, the standard deviation is less than or equal to 1) to find densely distributed target column names with a high cumulative number of occurrences, and then find the data columns corresponding to the target column names, as well as the subclass relational data tables containing these data columns.
[0126] Step S105, taking the data column corresponding to the target column name as the data column of the implicit superclass, and taking the class corresponding to the subclass relationship data table as the subclass of the implicit superclass; the implicit superclass represents the main features between the multiple relationship data tables.
[0127] Through the above steps S301 to S305, the embodiment of the present application utilizes the principle of pheromone accumulation in ant colony optimization. Through the concept of "concentration", in multiple relational data tables, when there are relational data tables with certain identical attribute columns (i.e., having common characteristics), a virtual superclass (composed of these identical attribute columns) that can display the characteristics can be constructed, and the relational data tables (tables with these identical attribute columns) that contribute to this "concentration" can be used as subclasses of the virtual superclass (i.e., subclass relational data tables).
[0128] Step S106: Generate a relational data ontology for the plurality of relational data tables according to the implicit superclass.
[0129] In related technologies, database ontology generation methods mainly consider the most basic ontology semantics in relational databases, and mainly rely on tables, fields, primary and foreign keys as basic units to set rules that are common to all databases, for example, table names correspond to class names, and foreign key names correspond to object attributes. However, in actual application scenarios, the semantics expressed by relational data features often exist not only in the form of a single table, but there are some common attributes or common features between multiple relational data tables, expressing certain semantics and acting as an ontology. The embodiment of the present application not only considers the correspondence between the relational database tables, fields, primary keys, foreign keys, etc. in the extracted relational data features and the ontology axioms, but also determines the target column name and the data column corresponding to the target column name (the common data column between the multiple relational data tables) and the subclass relational data table corresponding to the data column from multiple relational data tables through steps S102-S105 based on the ant colony optimization principle, and then generates an implicit superclass, thereby applying the corresponding ontology generation rules to discover and reconstruct the common features (implicit semantics) between the multiple relational data tables that are directly expressed, so as to obtain a new ontology containing implicit semantics and related relationships, generate a relational data ontology, and finally store the ontology in common ontology file formats such as OWL to improve the effectiveness and accuracy of the generated ontology.
[0130] In a possible implementation, the step S106, generating a relational data ontology for the plurality of relational data tables according to the implicit superclass, includes:
[0131] Step S1061: Create corresponding ontology classes for the multiple relational data tables respectively.
[0132] Specifically, first define an ontology class for the entity table. For each relational data table (i.e., entity table) T1-T2 obtained in step S101, n , create the corresponding ontology class C T1 ~C Tn .
[0133] Step S1062: creating a parent-child class relationship between the implicit superclass and the entity class corresponding to the subclass relationship data table according to the implicit superclass.
[0134] Specifically, according to the implicit superclass C constructed Cs , the ontology class C obtained from step S1051 T1 ~C Tn Find the entity class C corresponding to the subclass relationship data table Tsub1 ~C Tsubm , and make it a subclass, creating a parent-child class relationship between the two, that is, C Cs With C Tsub1 ~C Tsubm The parent-child class relationship of each subclass in .
[0135] Step S1063: create a data attribute with the same name in the corresponding ontology for each data column of the implicit superclass, with its domain being the implicit superclass and its value range being the SQL data type of the data column.
[0136] Specifically, define data attributes for each data column in the implicit superclass, that is, the implicit superclass C Cs Each data column in R Cs1 ~R Csp , create a data attribute with the same name in the ontology, and make the domain of the data column the implicit superclass C Cs , whose value range (Range) is the SQL data type dt of the data column.
[0137] Step S1064, for each primary key in the relational data table, for each data column in the primary key, create a data attribute with the same name in the ontology, with its domain being the corresponding ontology class and its value range being the SQL data type of the data column.
[0138] Specifically, for each relational data table, the relational data features are extracted, and the relational data features include the primary key of the table and the data columns in the primary key. For each data column in the primary key of each relational data table, a key data attribute is defined, that is, for the ontology class C created in step S1061, T1 ~C Tn Each ontology class C in Tx The primary key of each data column R in the primary key x1 , ..., R xm Create a data attribute with the same name in the ontology, and make its domain the ontology class C to which it belongs. Tx , whose value range (Range) is the SQL data type dt of the data column. Then add a key axiom (key axiom) for the data attribute of the same name.
[0139] The embodiment of the present application is mainly applied to scenarios where the item types are highly uniform and can represent the characteristics of a certain field to a certain extent. In this embodiment, the relational data table is mainly a partially structured data table with a high degree of uniformity, and can represent the characteristics of a certain field to a certain extent. That is, the column names of various tables have a relatively fixed unified naming standard, and the types of all entities are not many, and the main type characteristics are relatively distinct, that is, high-frequency column names appear continuously and concentratedly.
[0140] As follows, an example is used to illustrate the scheme of mining implicit class concepts and implicit relationships of multiple relational data tables through the relational data ontology generation method proposed in the above-mentioned embodiment of the present application. For supermarket A, it is necessary to plan the layout of various types of goods on the shelves, and put the goods of the same type together to facilitate purchase, so as to increase the overall sales volume of the supermarket and increase profits. However, sometimes after customers choose goods, when they give up buying halfway, there is a situation where the goods are placed at random positions on the shelves. In this case, it is necessary to classify and rearrange the goods that do not belong to the same category, that is, it is necessary to analyze the relevant commodity data information. According to the relational data ontology generation method proposed in the embodiment of the present application, relying on the ontology concept, a relational data table is established for a single commodity, the main column name describing the commodity in the relational data table is extracted, and the main selling commodity category (implicit superclass) of the supermarket shelf is mined. On the one hand, by screening out other commodities in a certain type of commodity display area and replacing them with the corresponding type of commodity display area, the overall sales volume of commodities can be increased and the overall profit of the supermarket can be increased. On the other hand, when it is found that the display volume of a certain type of commodity far exceeds the purchasing power of customers, that is, supply exceeds demand, some of the commodities of this type can be replaced and the shelf space can be left for other types of commodities that are in short supply, which can also increase the overall sales volume of commodities and increase the overall profit of the supermarket.
[0141]
[0142] Table 1
[0143]
[0144] Table 2
[0145] Exemplarily, Table 1 and Table 2 show the commodity list information of a shelf area. As shown in Table 1 and Table 2 below, there are 20 commodities (commodity 1-commodity 20) in the shelf area of Supermarket A, and the information of each commodity is stored in the form of a relational data table in a relational database. Each commodity corresponds to a relational data table, and each column in Table 1 and Table 2 corresponds to a commodity, which is used to store the column names contained in the relational data table of the commodity. Exemplarily, for the first column in Table 1 is commodity 1, the data column contains the column names contained in the relational data table of commodity 1: name, QR code, price, taste, ingredients, bar shape, nutritional ingredients, storage method, production date, production address, shelf life and net content.
[0146] According to the relational data ontology generation method proposed in the embodiment of the present application, through steps S101 and S102, the column names of each data column in multiple relational data tables (as shown in Table 1 and Table 2) and the number of occurrences of each column name in multiple relational data tables are obtained: the number of occurrences of "name", "QR code", "price" and "production address" is 20 times; the number of occurrences of "net content" is 19 times; the number of occurrences of "production date" is 17 times; the number of occurrences of "storage method" is 16 times; the number of occurrences of "shelf life" is "Nutritional ingredients" appears 14 times; "Nutritional ingredients" appears 13 times; "How to use", "Allergen information", "Noodles", and "Vegetable packs" appear 10 times; "Seasoning pack" appears 9 times; "Fragrance" appears 5 times; "Suitable for the crowd" appears 4 times; "Taste", "Ingredients", "Raw materials", "Alcohol" and "Function" appear 3 times; "Production batch number", "Expiration date", "Bar shape", "Formula" and "Active ingredient" appear 2 times; The remaining column names appear once.
[0147] According to the occurrence information, exclude the interference column names in the column names of each data column. That is, exclude the first interference column name whose occurrence is greater than or equal to the highest occurrence threshold (set to 20*80%=16), that is, the column names with occurrences of 20, 19, 17, and 16; then exclude the second interference column name with an occurrence of 1. According to Table 1, the order of the occurrence of the remaining column names from large to small is: 14, 13, 10, 10, 10, 10, 9, 5, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2. Among them, the maximum occurrence (14) is greater than the minimum frequency threshold (set to 20*20%=4), and continue to execute the subsequent steps.
[0148] Sort the remaining column names in descending order of the number of occurrences to obtain a candidate sequence. For any column name in the candidate sequence, obtain its two adjacent column names to form a candidate array. First, take the three candidate arrays with the number of occurrences of 14, 13, and 10 as a group, and calculate the standard deviation to be 1.6997, which is greater than 1 (that is, the preset standard deviation threshold). If it does not meet the first condition (the standard deviation is less than or equal to the preset standard deviation threshold), it will be determined as an unqualified array, and continue to calculate the next candidate array 13, 10, 10, and calculate the standard deviation to be 1.4142, which is greater than 1. The standard deviation of the candidate array 10, 10, 10 is calculated to be 0 less than or equal to 1, and it is determined that the candidate array meets the first condition, and the candidate array is determined to be a qualified array. The column names in the candidate array are determined as target column names, and the data columns corresponding to the column names in the qualified array (method of consumption, allergen information, and pancakes) are placed in the target array. The algorithm continues to execute until 10, 9, and 5 appear, and the standard deviation is 2.1602, which is greater than 1 again. This meets the algorithm's criteria for ending column name extraction, and the column name "Fragrance" is no longer extracted.
[0149] The target column names finally calculated include: method of consumption, allergen information, noodle cake, vegetable package, and seasoning package. The data columns corresponding to the above five column names are used to construct an implicit superclass (instant noodles).
[0150] According to the target column name, the subclass relationship data table is determined from multiple relationship data tables, and the subclass relationship data table is used as a subclass of the implicit superclass. Specifically, Goods 7 to 15 all contain these 5 columns and can be used as subclasses of the implicit superclass (instant noodles). Goods 16 lacks a column of seasoning packet and only contains 4 columns, but it also meets the requirement of containing no less than 3 columns (assuming the preset column quantity threshold is 5-2=3), and can be used as a subclass of the implicit superclass (instant noodles). However, Goods 1 and 2 contain less than 3 of these 5 columns and cannot be used as subclasses of the implicit superclass (instant noodles). The relationship data tables corresponding to other goods do not meet the requirement of containing more than 3 of these 5 columns, and cannot be used as subclasses of the implicit superclass (instant noodles). Finally, there are 10 subclasses of the implicit superclass (instant noodles), namely Goods 7 to 16.
[0151] In summary, by using the implicit superclass (instant noodles), we can conclude that the main type of goods sold in the shelf area of supermarket A is instant noodles. If there are corresponding shelf areas for goods that do not meet this type, they should be moved to the relevant areas to increase the overall sales of the supermarket, thereby mining the semantics of the main types of goods sold implicitly in the relational database constructed by the goods on the shelves of supermarket A.
[0152] For a given relational data source, the relevant technology is responsible for automatically parsing the semantic features of the ontology from the features of the relational database and generating ontology axioms. However, the existing ontology generation method only considers the ontology content clearly expressed in the relational data, such as the correspondence between metadata such as relational database tables, fields, primary and foreign keys, and ontology axioms, but cannot mine the implicit semantics not expressed by the metadata, such as the implicit ontology relationships such as superclasses and subclasses between multiple relational data tables (used to represent the common features between multiple relational data tables). The embodiment of the present application is based on multiple relational data tables, and according to the column names of each data column therein, the occurrence number information of each column name is obtained, so as to determine the distribution of the data columns with the same name in each relational data table. According to the occurrence number information, the target column names (high-frequency and concentrated column names) in the multiple relational data tables are determined, and the data columns corresponding to the target column names (i.e., common data columns) characterize the common features of multiple relational data tables, indicating that there are some identical attributes between multiple relational data tables. Therefore, the data column corresponding to the target column name is taken as the data column of the implicit superclass, and the class corresponding to the subclass relationship data table (the table in which the data column corresponding to the target column name appears) is taken as the subclass of the implicit superclass. Then, based on the virtual superclass, the ontology generation rules are applied to generate multiple relational data ontologies to mine reasonable implicit superclasses (i.e., implicit semantics) in the relational data table, avoid semantic omissions, and obtain a more accurate ontology.
[0153] The second aspect of the embodiment of the present application provides an ontology generation device based on implicit superclass mining, referring to Figure 2 , Figure 2 A schematic diagram of the structure of an ontology generation device based on implicit superclass mining is shown in FIG. Figure 2 As shown, the device comprises:
[0154] A data acquisition module is used to acquire multiple relational data tables to be processed from a relational database;
[0155] An occurrence number information acquisition module, used to extract the column name of each data column in the multiple relational data tables, and obtain the occurrence number information of each column name in the multiple relational data tables;
[0156] A target column name determination module, used to determine a target column name according to the occurrence count information, wherein the target column name represents a high-frequency column name that appears in the plurality of relational data tables;
[0157] A subclass relationship data table determination module, configured to determine a subclass relationship data table from the plurality of relationship data tables according to the target column name;
[0158] An implicit superclass generation module is used to use the data column corresponding to the target column name as the data column of the implicit superclass, and use the class corresponding to the subclass relationship data table as the subclass of the implicit superclass; the implicit superclass represents the main features between the multiple relationship data tables;
[0159] The ontology creation module is used to generate a relational data ontology for the plurality of relational data tables according to the implicit superclass.
[0160] In a possible implementation, the target column name determination module includes:
[0161] An interference column name exclusion submodule, used to exclude interference column names in the column names of each data column according to the occurrence number information;
[0162] The candidate sequence generation submodule is used to arrange the remaining column names in descending order of the number of occurrences to obtain a candidate sequence;
[0163] A candidate array generation submodule is used to obtain two adjacent column names for any column name in the candidate sequence to form a candidate array;
[0164] The standard deviation calculation submodule is used to calculate the standard deviation of each candidate array in descending order of the number of occurrences;
[0165] The target column name determination submodule is used to determine the column name in the candidate array that meets the first condition as the target column name according to the standard deviation of each candidate array.
[0166] In a possible implementation manner, the interference column name includes at least: a first interference column name and a second interference column name, and the interference column name exclusion submodule includes:
[0167] A first excluding unit, configured to exclude, according to the occurrence count information, column names whose occurrence counts are greater than or equal to a maximum occurrence count threshold as first interference column names;
[0168] The second excluding unit is used to exclude the column name with a number of occurrence of 1 as the second interference column name according to the number of occurrence information.
[0169] In a possible implementation, the target column name determination submodule includes:
[0170] A first target column name determination unit is used to determine that the candidate array does not meet the first condition if the standard deviation of the candidate array is greater than a preset standard deviation threshold, and continue to calculate the standard deviation of the next candidate array in descending order of the number of occurrences;
[0171] a second target column name determining unit, configured to determine, when the standard deviation of the candidate array is less than or equal to the preset standard deviation threshold, that the candidate array satisfies the first condition, and determine the column name in the candidate array that satisfies the first condition as the target column name;
[0172] The stopping unit stops calculating the standard deviation of subsequent candidate arrays when the standard deviation of the candidate array is greater than the preset standard deviation threshold again or when the standard deviation calculation of all candidate arrays is completed.
[0173] In a possible implementation, the subclass relationship data table determination module includes:
[0174] A target array creation submodule is used to put the data column corresponding to the target column name into the target array;
[0175] A column quantity calculation submodule, used to calculate the column quantity of data columns in the target array contained in each relational data table in the plurality of relational data tables;
[0176] The subclass relationship data table determination submodule is used to determine a relationship data table whose column quantity is greater than or equal to a preset column quantity threshold as the subclass relationship data table.
[0177] In a possible implementation, the device further includes:
[0178] The stop determination module is used to stop performing the operation of searching for the target column after excluding the interfering column names and determine that the multiple relational data tables do not contain the implicit superclass when the maximum number of occurrences of the remaining column names is less than or equal to the minimum frequency threshold.
[0179] In a possible implementation, the ontology creation module includes:
[0180] A first creation submodule is used to create corresponding ontology classes for the plurality of relational data tables respectively;
[0181] A second creation submodule is used to create a parent-child class relationship between the implicit superclass and the entity class corresponding to the subclass relationship data table according to the implicit superclass;
[0182] A third creation submodule is used to create a data attribute with the same name in the corresponding ontology for each data column of the implicit superclass, so that its definition domain is the implicit superclass and its value range is the SQL data type of the data column;
[0183] The fourth creation submodule is used to create a data attribute with the same name in the ontology for each data column in the primary key in each relational data table, with its definition domain being the corresponding ontology class and its value range being the SQL data type of the data column.
[0184] The present application also provides an electronic device, referring to Figure 3 , Figure 3 Schematic diagram of an electronic device proposed in an embodiment of the present application. Figure 3 As shown, the electronic device 100 includes: a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus communication. A computer program is stored in the memory 110. The computer program can be run on the processor 120 to implement the steps in the ontology generation method based on implicit superclass mining disclosed in the embodiment of the present application.
[0185] The embodiment of the present application also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps in the ontology generation method based on implicit superclass mining as disclosed in the embodiment of the present application are implemented.
[0186] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the processor is enabled to implement the steps of the ontology generation method based on implicit superclass mining as disclosed in the embodiment of the present application.
[0187] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0188] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0189] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0190] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0191] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0192] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0193] The above is a detailed introduction to the ontology generation method, device and equipment based on implicit superclass mining provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for ontology generation based on implicit superclass mining, characterized in that: The method comprises: Acquire multiple relational data tables to be processed from a relational database; Extracting the column name of each data column in the plurality of relational data tables, and obtaining the occurrence number information of each column name in the plurality of relational data tables; Determine a target column name according to the occurrence count information, where the target column name represents a high-frequency column name that appears in the plurality of relational data tables; Determine a subclass relationship data table from the plurality of relationship data tables according to the target column name; The data column corresponding to the target column name is used as the data column of the implicit superclass, and the class corresponding to the subclass relationship data table is used as the subclass of the implicit superclass; the implicit superclass represents the main features between the multiple relationship data tables; generating a relational data ontology for the plurality of relational data tables according to the implicit superclass; Determine the target column name according to the occurrence count information, including: Eliminate interfering column names in the column names of each data column according to the occurrence number information; Arrange the remaining column names in descending order of their occurrence frequency to obtain a candidate sequence; For any column name in the candidate sequence, obtain its two adjacent column names to form a candidate array; Calculate the standard deviation of each candidate array in descending order of occurrence; According to the standard deviation of each candidate array, determining the column name in the candidate array that meets the first condition as the target column name; The interference column names at least include: a first interference column name and a second interference column name. According to the occurrence number information, excluding the interference column names in the column names of each data column includes: According to the occurrence count information, the column names whose occurrence counts are greater than or equal to the maximum occurrence count threshold are excluded as first interference column names; According to the occurrence count information, the column name with an occurrence count of 1 is excluded as the second interference column name; Determining a subclass relationship data table from the plurality of relationship data tables according to the target column name includes: Put the data column corresponding to the target column name into the target array; Calculating the number of columns of data in the target array contained in each relational data table in the plurality of relational data tables; Determine a relational data table whose number of columns is greater than or equal to a preset column number threshold as the subclass relational data table; The step of generating a relational data ontology for the plurality of relational data tables according to the implicit superclass includes: For the multiple relational data tables, respectively create corresponding ontology classes; According to the implicit superclass, a parent-child class relationship is created between the implicit superclass and the entity class corresponding to the subclass relationship data table; For each data column of the implicit superclass, create a data attribute with the same name in the corresponding ontology, so that its domain is the implicit superclass and its value range is the SQL data type of the data column; For each primary key in the relational data table, for each data column in the primary key, a data attribute with the same name is created in the ontology, with its domain being the corresponding ontology class and its value range being the SQL data type of the data column.
2. The ontology generation method based on implicit superclass mining according to claim 1 is characterized in that: According to the standard deviation of each candidate array, determining the column name in the candidate array that meets the first condition as the target column name includes: When the standard deviation of the candidate array is greater than a preset standard deviation threshold, it is determined that the candidate array does not meet the first condition, and the standard deviation of the next candidate array is calculated in descending order of the number of occurrences; When the standard deviation of the candidate array is less than or equal to the preset standard deviation threshold, determining that the candidate array satisfies the first condition, and determining the column name in the candidate array that satisfies the first condition as the target column name; When the standard deviation of the candidate array is greater than the preset standard deviation threshold again, or when the calculation of the standard deviations of all candidate arrays is completed, the calculation of the standard deviations of subsequent candidate arrays is stopped.
3. The ontology generation method based on implicit superclass mining according to claim 1 is characterized in that: After eliminating the interfering column names, the method further includes: When the maximum number of occurrences of the remaining column names is less than or equal to the minimum frequency threshold, the operation of searching for the target column is stopped, and it is determined that the multiple relational data tables do not contain the implicit superclass.
4. An ontology generation device based on implicit superclass mining, characterized in that: Applied to executing the ontology generation method based on implicit superclass mining according to any one of claims 1 to 3, the device comprises: A data acquisition module is used to acquire multiple relational data tables to be processed from a relational database; An occurrence number information acquisition module, used to extract the column name of each data column in the multiple relational data tables, and obtain the occurrence number information of each column name in the multiple relational data tables; A target column name determination module, used to determine a target column name according to the occurrence number information, wherein the target column name represents a high-frequency column name that appears in the plurality of relational data tables; A subclass relationship data table determination module, configured to determine a subclass relationship data table from the plurality of relationship data tables according to the target column name; An implicit superclass generation module is used to use the data column corresponding to the target column name as the data column of the implicit superclass, and use the class corresponding to the subclass relationship data table as the subclass of the implicit superclass; the implicit superclass represents the main features between the multiple relationship data tables; The ontology creation module is used to generate a relational data ontology for the plurality of relational data tables according to the implicit superclass.
5. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor is executed, the steps in the ontology generation method based on implicit superclass mining described in any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium, characterized in that: A computer program / instruction is stored, and when the computer program / instruction is executed by a processor, the steps in the ontology generation method based on implicit superclass mining described in any one of claims 1 to 3 are implemented.
