Heterogeneous ontology matching method and system based on BERT and graph contrastive learning

By using BERT and graph contrastive learning methods, semantic and structural features of heterogeneous ontology are extracted, which solves the problem of single-dimensional features ignoring structural relationships in existing technologies and achieves high-precision ontology matching.

WO2026129624A1PCT designated stage Publication Date: 2026-06-25CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
CHONGQING UNIV OF POSTS & TELECOMM
Filing Date
2025-07-07
Publication Date
2026-06-25

AI Technical Summary

Technical Problem

Existing ontology matching techniques mainly rely on single-dimensional features, ignoring complex structural relationships, and lack of unified standards leads to inaccurate matching results. Machine learning methods rely on high-quality training data and are difficult to adapt to heterogeneous ontology.

Method used

The BERT model is used to extract the contextual semantic features of entities and the ontology is converted into a graph structure. The semantic and structural features are fused by combining a graph encoder with graph contrastive learning. The encoder parameters are optimized using a graph sampling strategy and loss function to calculate entity similarity.

Benefits of technology

It achieves accurate matching of heterogeneous ontology, eliminates the dependence on training set, improves matching accuracy and robustness, and can effectively handle complex structural relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025107264_25062026_PF_FP_ABST
    Figure CN2025107264_25062026_PF_FP_ABST
Patent Text Reader

Abstract

The present invention belongs to the field in which a semantic web and deep learning are combined. The present invention relates to a heterogeneous ontology matching method and system based on BERT and graph contrastive learning. In the present invention, a semantic feature extraction module extracts internal triple information of an ontology to construct a corpus; the corpus is input into a BERT model for parameter fine-tuning, and the fine-tuned BERT model is used to generate a semantic feature vector of an entity; and then, a graph contrastive learning module executes graph sampling on the basis of a topological structure of an ontology graph, so as to generate two views. Training is implemented by selecting positive samples and negative samples and setting a loss function, so as to generate a comprehensive entity feature vector; and finally, a similarity calculation module is used to calculate final similarity scores of different entity pairs. The present invention can effectively use a topological structure of an ontology graph to extract structural features, so as to overcome the problem of traditional structural features being incapable of fully expressing complex structural relationships between entities, thereby improving the accuracy of matching.
Need to check novelty before this filing date? Find Prior Art

Description

A Heterogeneous Ontology Matching Method and System Based on BERT and Graph Comparison Learning Technical Field

[0001] This invention belongs to the field of semantic web and deep learning, and relates to a heterogeneous ontology matching method and system based on BERT and graph contrastive learning. Background Technology

[0002] Semantic Web is a vision for the next generation of the web. Its goal is to add computer-understandable metadata to documents on the internet, enabling computers to automatically comprehend web page information and exchange this information between different applications, thus achieving more efficient data sharing and interaction. Ontology, as a conceptual description and formal representation of knowledge, can assign clear meaning to data by defining domain-specific concepts, attributes, and relationships. It uses standardized language to describe these concepts and relationships, allowing machines to read and process data, achieving data integration and interoperability.

[0003] However, during ontology construction, due to the lack of unified standards and the influence of developers' subjectivity, situations arise where concepts are the same but descriptions differ, resulting in the generation of a large number of heterogeneous ontology. This creates difficulties for interaction between different systems and applications, and seriously hinders the implementation of language web.

[0004] Ontology matching is key to solving the aforementioned problems. It eliminates the heterogeneity issue by identifying and establishing similarity or equivalence relationships between concepts in heterogeneous ontologies. Early ontology matching techniques were primarily based on a single dimension. For example, string-based methods considered the similarity of concept names; vocabulary-based methods used dictionaries or lexical resources to assess concept similarity; and structure-based methods considered the position and hierarchy of concepts within the ontology. These methods were generally simple and fast, but because they only considered single-dimensional features, they might overlook some important information, leading to inaccurate matching results. Therefore, methods incorporating multi-dimensional features were proposed, comprehensively considering both textual and structural similarity of concepts. With the development of machine learning, some methods train models and comprehensively consider concept similarity from multiple perspectives. Although these methods have made progress, they all have some limitations:

[0005] (i) Existing structural features often only consider local structural information of the ontology, such as the degree of a node and the number of neighboring nodes a node has. This local structural information cannot fully express the complex structural relationships between concepts.

[0006] (ii) When considering multi-dimensional features, only simple weighted aggregation is used, without truly integrating textual and structural features. Furthermore, machine learning-based methods rely on high-quality training data, which poses a significant challenge for ontology lacking a unified standard. Summary of the Invention

[0007] In view of this, the purpose of this invention is to provide a heterogeneous ontology matching method and system based on BERT and graph contrastive learning. This invention effectively achieves heterogeneous ontology matching by extracting complex structural features between entities and simultaneously realizing the complete fusion of semantic and structural features. First, this invention uses the BERT model to extract semantic features of entities with contextual semantics. Simultaneously, it transforms the ontology into a graph structure, converting entities into nodes and relations into edges. Semantic feature vectors are used as node features, and through a graph encoder combined with graph contrastive learning, a vector representation possessing both semantic and structural features is obtained, thereby enabling ontology matching.

[0008] To achieve the above objectives, the present invention provides the following technical solution:

[0009] A heterogeneous ontology matching method based on BERT and graph contrastive learning, comprising the following steps:

[0010] S1. Read the ontology file, convert the Resource Description Framework (RDF) in the ontology file into a Directed Acyclic Graph (DAG), and traverse each node to build the ontology corpus.

[0011] S2. Fine-tune and optimize the BERT model based on the ontology corpus, and output entity semantic feature vectors through the fine-tuned and optimized BERT model;

[0012] S3. Using semantic feature vectors as node feature vectors, the final structure embedding is obtained through graph sampling strategy and graph encoding method;

[0013] S4. Construct two views, select positive and negative samples to calculate the loss function for the two views, optimize the encoder parameters through the minimum loss function, and finally output the comprehensive vector representation of each node.

[0014] S5. Calculate the similarity between entity pairs using the cosine similarity distance formula to obtain the final similarity score.

[0015] Furthermore, in step S1, the process of constructing the ontology corpus includes:

[0016] S11. Create an empty graph, traverse each entity in the Resource Description Framework (RDF) of the ontology file, and store the entity as a node in the graph.

[0017] S12. Then, examine the domain and value of each entity attribute and use them as the edge attributes of that entity to obtain the directed acyclic graph structure.

[0018] S13. Traverse all nodes in the directed acyclic graph structure. During the traversal phase, retrieve the relationship edges between each node and all its neighboring nodes, and construct a sentence sequence based on the relationship edges.

[0019] S14. All sentence sequences after traversal are used as the ontology corpus.

[0020] Furthermore, in step S2, the fine-tuned and optimized BERT model is used as an encoder, and the entity name is input to obtain a fixed-length vector, which is the entity semantic feature; the process of fine-tuning and optimizing the BERT model includes the following steps:

[0021] S21. Preprocess the sentence sequences in the corpus, including removing irrelevant characters and text segmentation.

[0022] S22. Label each sentence as a sequence, represented as Q{q1,q2,...q}. N}, and add labels to each sentence sequence, including [CLS], [SEP], and [MASK];

[0023] S23. The labeled sentence sequence is embedded into a vector of a preset length, and then transformed by several Transformer encoders in the BERT model to obtain the final output. Where L represents the total number of layers in BERT, and N represents the total number of elements;

[0024] S24. By training MLM with masking and NSP for the next sentence prediction, the parameters are adjusted to obtain the fine-tuned and optimized BERT model.

[0025] Furthermore, in step S23, the update process for each element in the final output K is represented as follows:

[0026] Among them, M e M b Let q represent the weight matrix and the bias matrix, respectively. i This represents the i-th element. This indicates the state of the l-th hidden layer of the i-th element. transformer(·) represents the encoding operation of the Transformer encoder, which includes a multi-head attention layer, a fully connected layer, and an output layer.

[0027] Furthermore, step S3 includes the following steps:

[0028] S31. Take the constructed directed acyclic graph structure as input, and use the semantic feature vector as the feature vector of the entity node.

[0029] S32. Generate comparison objects by randomly destroying the topology or node features of the graph for graph sampling. The graph sampling strategy includes a random edge deletion strategy and an attribute masking strategy.

[0030] S33. Highway-GCN is used as a graph encoder. The node representation is updated by continuously aggregating neighbor node information, and then the final structure embedding is obtained.

[0031] Furthermore, in step S32, a random edge deletion strategy is first adopted by using a random mask matrix. Randomly remove edges from the original ontology graph. Conforms to Bernoulli distribution p r Let A be the probability of an edge being removed; let A be the original adjacency matrix of the graph, then:

[0032] In the formula, It represents the Hadamah accumulation. This represents the adjacency matrix after randomly deleting edges.

[0033] Secondly, an attribute masking strategy is adopted, using context information to recover the attributes of the masked vertices, and using random vectors. Randomly mask the node features, where f represents the dimension of the feature vector, and each dimension of this random vector follows a Bernoulli distribution.

[0034] In the formula, s1, s2, ..., s N This represents the feature vector of a node, and N represents the number of nodes. This represents the feature matrix after random attribute masking.

[0035] Furthermore, in step S33, the l-th layer of the HGCN graph encoder constructs a feature matrix using semantic embeddings. As input, its update rules are as follows:

[0036] in, A is an adjacency matrix, consisting of the relationships between nodes, and I is the identity matrix. yes The degree matrix, σ is the weight matrix shared among layers l, and σ{·} is the ReLU activation function;

[0037] A highway network is added after each layer of the GCN network to avoid gradient explosion, and structural embedding calculations are performed:

[0038] Where T(·) is the transform gate and C(·) is the carry gate, the resulting final structure embedding is represented as V = HGCN(S). Further, in step S4, the two resulting views are represented as follows:

[0039] In the formula, Represents the original ontology graph. These represent the random edge deletion function and the random attribute masking function, respectively. These represent all nodes in the first view and all nodes in the second view, respectively. These are the sets of relationships between nodes in the first and second views, respectively. These are the feature matrices for the first view and the second view, respectively;

[0040] Subsequently, a comparison group was established, including positive and negative samples. The positive samples included: Each node ν in i With The corresponding anchor node u i , In the view ν i The neighboring nodes, and Anchor node u in the view i Neighboring nodes; negative samples include: ν in the same view i Non-neighboring nodes and u in another view i Non-neighboring nodes;

[0041] Define contrast loss:

[0042] in Indicates v i The number of neighboring nodes, Indicate u i The number of neighboring nodes, θ(·) represents the vector dot product, τ represents the temperature coefficient; i, j represent different node indices respectively;

[0043] The objective is to minimize the overall contrastive loss, where the overall contrastive loss is defined as the average of all positive sample pairs, as shown in the following equation:

[0044] The encoder parameters are updated by minimizing the equality loss objective.

[0045] Furthermore, in step S5, the cosine distance formula is used to calculate the entity similarity from different ontologies:

[0046] In the formula, e1 and e2 represent the vector representations of entities c1 and c2, respectively, and c1 and c2 are different entities; the final matching result is obtained based on the similarity.

[0047] This invention also proposes a matching system for performing the aforementioned heterogeneous ontology matching method based on BERT and graph contrastive learning. This system includes a semantic feature extraction module, a graph contrastive learning module, and a similarity calculation module; wherein,

[0048] The semantic feature extraction module is used to read ontology files, build a corpus, fine-tune the BERT model, and obtain semantic feature vectors of entities.

[0049] The graph contrastive learning module is used to train an encoder that can obtain unique structural features using contrastive learning, and output a comprehensive representation of the entity.

[0050] The similarity calculation module uses the cosine similarity distance formula to calculate the similarity between the comprehensive representations of entities from different ontologies, and obtains the final matching result.

[0051] The beneficial effects of this invention are as follows:

[0052] (i) Existing matching methods rely on the local structural information of the ontology for structural features, but this local information cannot fully represent the structure of the entity in the ontology. This invention uses the topological structure of the graph to extract richer global structural features through graph contrastive learning. At the same time, the semantic feature vector of the entity is used as the feature vector of the corresponding node and put into contrastive learning to achieve complete feature fusion.

[0053] (II) Some existing machine learning matching methods rely on training sets to achieve matching results. This invention uses only internal ontology information in the corpus extraction stage and generates comparison objects from the original ontology graph for training in the contrastive learning stage, without requiring any external resources or training sets. This eliminates the problem of matching accuracy being affected by the training set.

[0054] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description

[0055] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:

[0056] Figure 1 is a schematic diagram of the overall architecture of the heterogeneous matching method based on BERT and graph contrastive learning according to an embodiment of the present invention;

[0057] Figure 2 is a flowchart of the graph comparison learning module execution in an embodiment of the present invention;

[0058] Figure 3 is a structural diagram of the BERT model according to an embodiment of the present invention;

[0059] Figure 4 is a schematic diagram of the comparative learning of positive and negative samples in an embodiment of the present invention. Detailed Implementation

[0060] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0061] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0062] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0063] Please refer to Figures 1 to 4, which illustrate a heterogeneous ontology matching method and system based on BERT and graph contrastive learning.

[0064] Example

[0065] This embodiment first provides a detailed structural description of a heterogeneous ontology matching method based on BERT and graph contrastive learning, as shown in the overall architecture diagram in Figure 1. The method includes the following steps:

[0066] S1. Read the ontology file, convert the RDF into a directed acyclic graph, and traverse the nodes to build the ontology corpus;

[0067] S2. Input the corpus into BERT and fine-tune it to obtain the fine-tuned BERT model. Output the entity semantic feature vector through the fine-tuned BERT model.

[0068] S3. Using semantic feature vectors as node feature vectors, subgraphs are obtained through two graph sampling strategies.

[0069] S4. Select positive and negative sample pairs, encode them using H-GCN, calculate the loss function, optimize the encoder parameters using the minimum loss function, and finally output the comprehensive vector representation of each node.

[0070] S5. Calculate the similarity between entity pairs using the cosine similarity distance formula to obtain the final similarity score.

[0071] In step S1 of this embodiment, the main corpus is constructed: the structure of the ontology can be viewed as a directed acyclic graph, where each entity represents a node in the graph structure, and there are many different types of relationships between the nodes. Therefore, we construct the corpus through the following process: First, an empty graph is created, and each entity in the Resource Description Framework (RDF) of the ontology file is traversed, storing the entity as a node in the graph. Then, the domain and value range of the entity's attributes are retrieved, and edge attributes are added. After obtaining the ontology graph structure, these nodes are traversed accordingly. During the traversal phase, all neighboring nodes and the relationship edges of each node are retrieved to construct sentence sequences, and all sentence sequences are used as the corpus.

[0072] In step S2 of this embodiment, BERT is fine-tuned and optimized using the constructed corpus: First, the sentence sequences in the corpus are preprocessed, including removing irrelevant characters and text segmentation. Then, each sentence is sequence-labeled, represented as Q{q1,q2,...q}. N The input sequence is labeled with [CLS], [SEP], and [MASK]. Each element in the input sequence is embedded into a vector of length 768. These vectors are then passed through each Transformer encoder, undergoing the corresponding transformations to obtain the final output representation. L represents the total number of layers in BERT, as shown in Figure 3. The element state of the i-th element in the l-th layer is then represented as:

[0073] Among them, M e M b Let q represent the weight matrix and the bias matrix, respectively. i This represents the i-th element. This represents the state of the i-th element and the l-th hidden layer. `transformer(·)` represents the encoding operation of the Transformer encoder, which includes a multi-head attention layer, a fully connected layer, and an output layer. Furthermore, through MLM (masking training) and NSP (next-sentence prediction), the M... e M b And adjust the parameters in the transformer.

[0074] Meanwhile, the fine-tuned BERT model is used as an encoder, and the name of the input entity is used to obtain a fixed-length vector, which represents the semantic features of the entity.

[0075] In step S3 of this embodiment, the main focus is on extracting the structural information of entities and outputting a comprehensive representation. The aim is to obtain different views by adopting different sampling strategies. Within these views, the contrastive learning framework maximizes the consistency of the generation perspective for the same instance and minimizes the consistency of the generation perspective for different instances to train the model. The vectors output by this model have strong robustness, can withstand changes in the graph structure, and yield rich entity structural features. The process is shown in Figure 2, and the specific execution flow is as follows:

[0076] S31. Input ontology graph structure and semantic feature vectors. To achieve complete fusion of semantic and structural features, this invention uses the ontology graph structure obtained during the corpus construction phase as input, and semantic features as feature vectors for entity nodes.

[0077] S32. Graph Sampling: Graph sampling generates comparison objects by randomly disrupting the topology or node features of a graph. The method is as follows:

[0078] Randomly delete edges by using a random mask matrix. Randomly remove edges from the original ontology graph. Conforms to Bernoulli distribution p r Let A be the probability of an edge being removed. Let A be the original adjacency matrix of the graph. If A... ij =1, then R ij Set it to 0. Then the adjacency matrix can be calculated as follows.

[0079] Attribute masking. Attribute masking prompts the model to recover the vertex attributes of the mask using its contextual information (i.e., remaining attributes). The basic assumption is that missing some vertex attributes will not significantly affect the model's predictions. This is achieved by using random vectors. Randomly mask the node features, where f represents the dimension of the feature vector, and each dimension of the random vector follows a Bernoulli distribution.

[0080] In the formula, s1, s2, ..., s N The feature vector representing a node. This represents the feature matrix after random attribute masking.

[0081] S33. Graph Encoding: Highway-GCN is used as the graph encoder. GCN updates node representations by continuously aggregating neighbor node information. The input to the l-th layer GCN is a feature matrix composed of semantic embeddings. The update rules are as follows.

[0082] in, A is an adjacency matrix, consisting of the relationships between nodes, and I is the identity matrix. yes The degree matrix, W e (l) σ is the weight matrix shared between layers l, and σ{·} is the ReLU activation function. The gradient explosion problem caused by increasing the number of neural network layers is solved by adding a highway network. A network is added after each GCN layer for structural embedding. The calculation is as follows: S e (l+1) =T(S) e (l) )·S e (l+1) +C(S e (l) )·S e (l)

[0083] T is the transform gate, C is the carry gate, and C = 1 - T. The final structure embedding is V = HGCN(S).

[0084] In step S4 of this embodiment, positive and negative sample training is performed: the resulting two views are represented as follows:

[0085] In the formula, Represents the original ontology graph. These represent the random edge deletion function and the random attribute masking function, respectively. These represent all nodes in view 1 and all nodes in view 2, respectively. These are the sets of relationships between nodes in View 1 and View 2, respectively. These are the feature matrices for view 1 and view 2, respectively.

[0086] Subsequently, a comparison group was established, including positive and negative samples, as shown in Figure 4. Specifically, the positive samples mainly consist of three parts, firstly... Each node ν in i With The corresponding anchor node u i Secondly, considering the relationships contained in neighboring nodes within the ontology, in In the view, ν i The neighboring nodes are considered positive samples. Meanwhile, the anchor node u... i Neighboring nodes are considered positive samples. Negative samples mainly consist of two parts: the first part consists of nodes in the same view. i The non-neighboring nodes. Secondly, in another view, u i The non-neighbor nodes. The contrastive loss is defined as follows:

[0087] in Indicates v i The number of neighboring nodes, Indicate u i The number of neighboring nodes, θ(·) represents the vector inner product, and τ represents the temperature coefficient.

[0088] The two generated views are represented as follows and Since the two views are symmetrical, the loss for the other view is defined in the same way. The overall contrast objective to be minimized is defined as the average of all positive sample pairs, as follows:

[0089] In summary, in each training epoch, two views of graph G are first generated. and Obtained using the H-GCN graph encoder and The nodes represent V and U. Finally, the encoder parameters are updated by minimizing the equality loss objective.

[0090] In step S5 of this embodiment, the cosine distance formula is used to calculate the entity similarity from different entities. The calculation formula is:

[0091] In the formula, e1 and e2 represent the vector representations of entities c1 and c2, respectively, where c1 and c2 are different entities. The similarity score obtained here is between 0 and 1, with the value closer to 1 indicating greater similarity between the two entities. The final matching result is obtained based on the similarity score.

[0092] This embodiment provides a matching method based on the above-mentioned matching system, which includes a semantic feature extraction module, a graph comparison learning module, and a similarity calculation module; wherein...

[0093] The semantic feature extraction module is used to read ontology files, build a corpus, fine-tune the BERT model, and obtain semantic feature vectors of entities.

[0094] The graph contrastive learning module is used to train an encoder that can obtain unique structural features using contrastive learning, and output a comprehensive representation of the entity.

[0095] The similarity calculation module uses the cosine similarity distance formula to calculate the similarity between the comprehensive representations of entities from different ontologies, and obtains the final matching result.

[0096] In summary, through detailed implementation instructions, those skilled in the art can clearly understand the implementation steps and thus implement this invention independently using the required software and hardware platforms. This invention designs a heterogeneous ontology matching system and method based on BERT and graph contrastive learning. The system first parses the ontology file and converts it into a graph structure. Simultaneously, it parses and obtains triple sentences as a corpus to fine-tune BERT, obtaining semantic representations of entities in the ontology through the fine-tuned BERT. These representations are then used as feature vectors for nodes in the graph structure. Leveraging the graph's topological structure, random edge deletion and node feature masking sampling operations are performed on the ontology graph, resulting in two views. Positive and negative samples are selected, and a loss function is defined for training. In this way, the model learns an encoder, making the output embedding highly robust, able to withstand changes in the graph structure, and obtaining a unique encoded representation. Finally, the obtained representation is used as a comprehensive entity representation integrating semantic and structural features. The final similarity score is obtained by calculating the similarity between pairs of entities, completing the ontology matching task.

[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A heterogeneous ontology matching method based on BERT and graph contrastive learning, characterized in that: The method includes the following steps: S1. Read the ontology file, convert the Resource Description Framework (RDF) in the ontology file into a Directed Acyclic Graph (DAG), and traverse each node to build the ontology corpus. S2. Fine-tune and optimize the BERT model based on the ontology corpus, and output entity semantic feature vectors through the fine-tuned and optimized BERT model; S3. Using semantic feature vectors as node feature vectors, the final structure embedding is obtained through graph sampling strategy and graph encoding method; S4. Construct two views, select positive and negative samples to calculate the loss function for the two views, optimize the encoder parameters through the minimum loss function, and finally output the comprehensive vector representation of each node. S5. Calculate the similarity between entity pairs using the cosine similarity distance formula to obtain the final similarity score.

2. The heterogeneous ontology matching method based on BERT and graph contrastive learning according to claim 1, characterized in that: In step S1, the process of constructing the ontology corpus includes: S11. Create an empty graph, traverse each entity in the Resource Description Framework (RDF) of the ontology file, and store the entity as a node in the graph. S12. Then, examine the domain and value of each entity attribute and use them as the edge attributes of that entity to obtain the directed acyclic graph structure. S13. Traverse all nodes in the directed acyclic graph structure. During the traversal phase, retrieve the relationship edges between each node and all its neighboring nodes, and construct a sentence sequence based on the relationship edges. S14. All sentence sequences after traversal are used as the ontology corpus.

3. The heterogeneous ontology matching method based on BERT and graph contrastive learning according to claim 1, characterized in that: In step S2, the fine-tuned BERT model is used as the encoder, and the entity name is input to obtain a fixed-length vector, which is the entity semantic feature. The process of fine-tuning the BERT model includes the following steps: S21. Preprocess the sentence sequences in the corpus, including removing irrelevant characters and text segmentation. S22, sequence labeling is performed on each sentence, denoted as Q{q1, q2,...q N}, and a label is added to each sentence sequence, including [CLS], [SEP], [MASK]; S23, the marked sentence sequence is embedded into a vector of a preset length, and then converted through a plurality of Transformer encoders in the BERT model to obtain a final output Where L represents the total number of layers in BERT, and N represents the total number of elements; S24. By training MLM with masking and NSP for the next sentence prediction, the parameters are adjusted to obtain the fine-tuned and optimized BERT model.

4. The heterogeneous ontology matching method based on BERT and graph contrastive learning according to claim 3, characterized in that: In step S23, the update process for each element of the final output K is represented as: wherein M e ,M b respectively represent a weight matrix and a bias matrix, q i denotes the i-th element, This indicates the state of the l-th hidden layer of the i-th element. transformer(·) represents the encoding operation of the Transformer encoder, which includes a multi-head attention layer, a fully connected layer, and an output layer.

5. The heterogeneous ontology matching method based on BERT and graph contrastive learning according to claim 1, characterized in that: Step S3 includes the following steps: S31. Take the constructed directed acyclic graph structure as input, and use the semantic feature vector as the feature vector of the entity node. S32. Generate comparison objects by randomly destroying the topology or node features of the graph for graph sampling. The graph sampling strategy includes a random edge deletion strategy and an attribute masking strategy. S33. Highway-GCN is used as a graph encoder. The node representation is updated by continuously aggregating neighbor node information, and then the final structure embedding is obtained.

6. The heterogeneous ontology matching method based on BERT and graph contrastive learning according to claim 5, characterized in that: In step S32, first, a random edge removal strategy is adopted, by using a random mask matrix Randomly removing edges in the original ontology graph, Complying with Bernoulli distribution p r is the probability of the removed edge; let A be the original adjacency matrix of the graph, then: In the formulae, denotes a Hadamard product, This represents the adjacency matrix after random deletion; Secondly, the attribute occlusion strategy is adopted, and the occluded vertex attributes are recovered by using context information through the use of random vectors randomly masking the node features, where f denotes the dimension of the feature vector, each dimension of the random vector is according to a Bernoulli distribution, In the formula, s1, s2,..., s N representing the node feature vector, This represents the feature matrix after attribute masking.

7. The heterogeneous ontology matching method based on BERT and graph contrastive learning according to claim 6, characterized in that: In step S33, the i-th layer of the HGCN graph encoder updates the feature matrix composed of semantic embeddings As input, its update rule is as follows: wherein A is an adjacency matrix, composed of the relationships between the nodes, I is the identity matrix, is matrix of degrees, σ is the weight matrix shared among layers l, and σ{·} is the ReLU activation function; A highway network is added after each layer of the GCN network to avoid gradient explosion, and structural embedding calculations are performed: S e (l+1) = T(S e (l) ) · S e (l+1) + C(S e (l) ) · S e (l) where T(·) is the transform gate and C(·) is the carry gate, and the final structure embedding is denoted as V=HGCN(S).

8. The heterogeneous ontology matching method based on BERT and graph contrastive learning according to claim 7, characterized in that: In step S4, the two resulting views are represented as: In the formulae, representing the original ontology graph, respectively denote a random edge deletion function, a random attribute masking function, all nodes in the first view and all nodes in the second view, respectively, a set of relationships between nodes in the first view and the second view, respectively, The feature matrix of the first view and the second view, respectively; Subsequently, a contrast object is established, including positive samples and negative samples, wherein the positive samples include: each node v in V i with the corresponding to the anchor node u i , View in v i of the neighbor nodes, and u i 's neighbors in the same view; negative samples include: non-neighbors of u i in the same view and non-neighbors of u i in the other view; Define contrastive loss: wherein represents v i number of neighbor nodes of v, Indicate u i The number of neighboring nodes, θ(·) represents the vector dot product, τ represents the temperature coefficient, and i and j represent different node indices; Minimizing the overall contrastive loss, where the overall contrastive loss is defined as the average of all positive sample pairs, as follows: The parameters of the encoder are updated by minimizing the loss objective of the equation.

9. The heterogeneous ontology matching method based on BERT and graph contrastive learning according to claim 8, characterized in that: In step S5, the similarity of entities from different ontologies is calculated using the cosine distance formula: In the formula, e1 and e2 represent the vector representation of c1 and c2 entities respectively, and c1 and c2 are different entities; and the final matching result is obtained according to the similarity.

10. A matching system for performing the method of BERT and graph contrastive learning-based heterogeneous ontology matching according to any one of the preceding claims 1-9, characterized in that: The system comprises a semantic feature extraction module, a graph contrast learning module and a similarity calculation module. Wherein, The semantic feature extraction module is used to read the ontology file, construct a corpus and fine-tune the BERT model to obtain the semantic feature vector of the entity. The graph contrast learning module is used to train an encoder capable of obtaining unique structure features using contrast learning, and outputs the comprehensive representation of the entity. The similarity calculation module calculates the similarity between the comprehensive representations of entities from different ontologies using the cosine similarity distance formula to obtain the final matching result.