## 3 Methodology
### Ontology-Integrated Federated Unlearning (OFU-Ontology) Algorithm
#### 3.2.2 Ontology Construction and Integration  
Ontology construction and integration are critical components of the OFU-Ontology framework, enabling relevance-aware federated unlearning through structured domain knowledge. The ontology module serves as a domain-specific knowledge graph that represents entities, attributes, and semantic relationships. During unlearning, it assigns _relevance scores_ to data samples, guiding the selective forgetting of low-impact information while preserving high-value knowledge that supports model utility. In this work, ontologies were manually designed based on expert knowledge, publicly available schema definitions, and dataset-specific semantics to ensure interpretability and alignment with real-world logic. Each dataset domain leverages a customized ontology structure reflecting its inherent relationships. In this study, all ontologies were static (fixed before training), but the design explicitly supports future dynamic updates to incorporate new data, semantic drift, or client feedback. Each dataset-specific ontology was designed modularly, enabling easy replacement or customization for other domains without altering the core unlearning algorithm.  
For example, in healthcare-style data (e.g., UCI Adult dataset), the ontology models relationships between demographic attributes and health risk factors. A typical SPARQL query to retrieve high-risk attribute combinations might be  
```
SELECT?ageGroup?occupation?riskLevel WHERE{?personex:hasAgeGroup?ageGroup.?personex:hasOccupation?occupation.?personex:hasRiskLevel?riskLevel. FILTER(?riskLevel=\"High\") } This query helps identify and deprioritize neutral, less informative comments for unlearning. For network intrusion detection (e.g., KDDCup99 dataset), the ontology models relationships between attack types, protocols, and network services. A relevant SPARQL query might be
``` SELECT?attackType?service?protocol WHERE{?eventex:hasAttackType?attackType.?eventex:usesService?service.?eventusesProtocol?protocol. ```
FILTER(?attackType!= \"DoS\")  
These SPARQL queries are illustrative of how domain knowledge encoded in ontologies enables computing relevance scores \(R\left(d_{i,j}\right)\) for each data sample:  
\[R\left(d_{i,j}\right)\ \ )=f_{ontology}\left(d_{i,j}\right)\ \ ) \tag{5}\]  
where \(f_{ontology}\) is derived from ontology-based semantic rules. Low-relevance data points (low \(R\)) are targeted first during weighted gradient negation:  
\[\theta_{unlearned}^{(t+1)}=\theta^{(t+1)}+\eta\frac{n_{u}}{n}\sum_{j}R(d_{u,j}) \
abla L_{u,j}(\theta^{(t)}) \tag{6}\]  
While our experiments use static ontologies--knowledge graphs defined before training and unlearning--the framework supports future dynamic or evolving ontologies. These could be adapted based on new data, client feedback, or automated schema induction, ensuring long-term relevance and robustness against semantic drift. Scalability is achieved through a modular design, allowing each application domain or dataset to define its own ontology independently of the core unlearning algorithm. This modularity enables broad applicability across fields such as healthcare, text analysis, network security, image recognition, and e-commerce, ensuring that the OFU-Ontology framework generalizes effectively to diverse federated learning scenarios.