## 3 Research Methodology
### Creating Datasets  
In our methodology for fine-tuning LLMs for OE, a pivotal goal was to automate the dataset creation process as much as possible. This automation is essential not just for improving efficiency, but also for ensuring consistency and scalability in the training datasets. By automating this process, we aimed to minimize human error and standardize the data quality across various training sets, which is crucial for the effective training of the models. The rationale behind automating dataset creation includes several key factors:  
1. Scalability: Manual dataset creation is inherently labor-intensive and not scalable, particularly as the volume and complexity of source materials increase. Automation allows us to handle larger datasets efficiently, facilitating the development of models that can generalize across a broader spectrum of OE tasks. 2. Consistency: Manually created datasets can vary in quality and structure, depending on the individual's interpretation and method of data extraction. Automating this process with LLMs helps ensure a consistent format and quality across all datasets, thereby improving the reliability and effectiveness of the model training process. 3. Speed: Automation significantly accelerates the dataset creation process. LLMs can quickly process extensive texts, extracting relevant information and structuring it into the required format much faster than manual methods, thus saving valuable time and resources. 4. Resource Optimization: By automating routine data extraction and formatting tasks, valuable human resources can be redirected towards more complex and strategic tasks such as refining the models' architecture, configuring hyperparameters, and analyzing outcomes. To implement automated dataset creation, the process involves several steps:
5. Input and Segmentation: Selected foundational texts rich in OE content are fed into the LLMs, which automatically segmented them into manageable parts suitable for detailed processing. 6. Extraction and Structuring: The LLMs are tasked with extracting essential concepts, definitions, and relational data from the texts. The extracted information is then automatically structured into question-answer pairs, formatted specifically to aid in effective model training. 7. Validation and Refinement: Despite the automation, human oversight is essential. This phase involves validating and refining the LLM outputs to ensure that the data accurately reflects the required knowledge and is devoid of errors or irrelevant content. 8. Output in JSONL Format: The structured datasets are then output in JSONL format (a collection of JSON values, where each line is a valid JSON value, typically an object or array), which is ideal for handling large volumes of data and simplifies integration into the model training workflows. The selection of chapters from the foundational texts was guided by their relevance to core OE principles, OE methodologies and logical formalizations. We prioritized sections covering key topics such as ontology construction, class hierarchy definitions, object property constraints, and reasoning techniques. Chapters containing visual representations (diagrams, concept maps) were also selected to ensure that non-textual knowledge could be integrated into the dataset. These visual elements often encode relationships and taxonomies that are critical for domain representation but may not always be explicitly described in the text. In more detail, diagrams in OE textbooks frequently illustrate relationships between concepts, taxonomical structures, and logical constrains. Since fine-tuning LLMs requires text-based datasets, it was necessary to convert these visual elements into a structured textual representation compatible with Q&A format. To systematically translate visual elements into description logic, we employed a multi-step approach: diagrams were analyzed to extract fundamental ontological elements such as classes, relationships and axioms.