# Combining Semantic and Structural Features for Reasoning on Patent Knowledge Graphs
## 2 Methodology
### Patent Knowledge Graph Reasoning Method Based on Graph Structure Feature Learning
To extract semantic information from the image, a search is first conducted for the target head and tail entities within the patent knowledge graph. Subsequently, entity and relationship information of the target nodes is extracted using related algorithms, followed by an update of the model parameters. For extracting structural information, an improved Graph SAGE network is employed to capture the structure of the surrounding nodes of the target in the knowledge graph. Past structural information is then utilized to predict information collection tasks for unknown relationships within the knowledge graph. A feature of the knowledge graph is that the target node combined with its surrounding nodes forms a complete graph. Based on this, part of the structural information around the target node is filtered, and the number of hops and the distance between nodes are assessed. If the number of hops is excessive or the distance is too great, that part of the information is discarded. Using isomorphic information theory, positive samples in the dataset are processed by combining the head entity, tail entity, and correct relationships to form an overall subgraph structure, which disregards spatial positioning. When dealing with negative samples, those that do not form an overall subgraph structure are excluded, meaning that the structural information of that part of the data is not learned. In the task of extracting structural information, only the features of relevant nodes are extracted, rather than the features of the entire graph, as represented in Equations (5) and (6):  
\[a_{u}^{k}=AGGREGATE^{k}\Big{(}\Big{\{}h_{u^{\prime}}^{k-1}:u^{\prime}\in N(u), h_{v}^{k-1}\Big{\}}\Big{)} \tag{5}\]  
\[h_{u}^{k}=CONCAT^{k}\Big{(}h_{u}^{k-1},a_{u}^{k}\Big{)} \tag{6}\]  
where \(a_{u}^{k}\) represents the aggregated information from node \(u\) at layer \(k\), and \(N(u)\) represents the set of neighbor nodes for node \(u\). The nodes within this range are referred to as the L-hop neighborhood of node \(u\), set to 3. \(AGGREGATE^{k}\) is the aggregation function that combines the features of neighboring nodes at layer \(k\). \(h_{u}^{k}\) denotes the hidden information  
Figure 4: Graph convolutional network model architecture for knowledge graph relation reasoning. at layer \(k\), calculated by combining information from the previous layer's hidden state with the current layer's aggregated information, providing a new feature representation for node \(u\) at layer \(k\). \(CONCAT^{k}\) is the concatenation function that merges the current feature representation of node \(u\) with the aggregated information of its neighbors at layer \(k\). The AGGREGATE computation in Equation (5) is defined as shown in Equation (7):  
\[a_{u}^{k}=\sum_{r=1}^{R}\sum_{v\in N_{r}(u)}\alpha_{rr_{uv}}^{k}W_{r}^{k}h_{v} ^{k-1} \tag{7}\]  
where \(R\) represents the total number of known relationships within the knowledge graph, and \(N_{r}(u)\) denotes the set of neighbor nodes for node \(u\), where these neighbors share a relationship \(r\) with node \(u\). \(W_{r}^{k}\) is the transformation matrix for relationship \(r\) at layer \(k\), utilized for transforming node features. \(\alpha_{rr_{uv}}^{k}\) indicates the weight matrix associated with the relationships surrounding the node, \(W_{r}^{k}\) is the weight matrix for node \(r\) at layer \(k\), and \(h_{v}^{k-1}\) represents the hidden information of node \(v\) at layer \(k-1\). The CONCAT method referred to in Equation (6) is defined as shown in Equation (8):  
\[h_{u}^{k}=\text{ReLU}\left(W_{self}^{k}h_{u}^{k-1}+\alpha_{u}^{k}\right) \tag{8}\]  
where \(W_{self}^{k}\) denotes the self-loop weight matrix at layer \(k\), which is used for the transformation of its own features, specifically the self-connection weight.