public class WriteDisjointClassDefs
extends java.lang.Object
WriteDisjointClassDefs class processes
a text file containing disjoint class definitions and generates
corresponding OWL code snippets for inclusion in an
OWL/XML ontology. This class contributes to the ontology
generation process by defining disjointness relationships
between classes within the ontology. These constraints
ensure that specific classes are mutually exclusive.
Key Functionalities:
Reads Disjoint Class Definitions: Parses a text file structured with indentation levels to identify disjoint class groups.
Identifies Disjoint Class Groups: Analyzes indentation to group class names that belong to the same disjoint set.
Generates OWL Disjoint Class Axioms: Writes OWL code representing disjointness constraints, specifying that certain classes cannot have overlapping instances.
Handles File I/O: Manages file reading and writing operations.
Additional Notes:
The class relies on pre-defined file paths and utilizes comments within the code, suggesting potential improvements for user-configurable settings.
The code showcases functionalities for reading disjoint class definitions and generating OWL code. The actual implementation might handle additional logic for handling potential errors or complex indentation structures in the input file. *
Environment:
- IDE: Eclipse IDE for Java Developers
- Version: 2021-12 (4.22.0)
- Build id: 20211202-1639
- HW Model Name: iMac, MacOS Monterey, 12.5.1
- Processor Name: Quad-Core Intel Core i5
- Processor Speed: 3.2 GHz
- Memory: 32 GB 1867 MHz DDR3
- Disk: APPLE SSD SM0256G
- Serial: DGKRC080GG7V
- Since:
- 2024/06/17
- Version:
- 1-001
- Author:
- Edit Hlaszny (https://www.hlaszny.eu/ edithlaszny@gmail.com)
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classWriteDisjointClassDefs.ClassEntity -
Field Summary
Fields Modifier and Type Field Description private intcountOfDCsprivate intmaxIndentationprivate OWL2_GeneratorOWL2Gprivate SharedUtilsshuprivate java.io.FileWriterwriter -
Constructor Summary
Constructors Constructor Description WriteDisjointClassDefs(java.lang.String src, java.lang.String dst, java.lang.String baseURI, java.lang.String sectionStartToken, java.lang.String sectionEndToken, java.lang.String comment) -
Method Summary
Modifier and Type Method Description private intcountIndentation(java.lang.String line)private voidwriteDisjointClasses(java.util.List<java.util.List<java.lang.String>> disjointClassSet, java.lang.String dst)private voidwriteDisjunctClassSet(java.util.ArrayList<WriteDisjointClassDefs.ClassEntity> classList)
-
Field Details
-
countOfDCs
private int countOfDCs -
maxIndentation
private int maxIndentation -
OWL2G
-
shu
-
writer
private java.io.FileWriter writer
-
-
Constructor Details
-
WriteDisjointClassDefs
WriteDisjointClassDefs(java.lang.String src, java.lang.String dst, java.lang.String baseURI, java.lang.String sectionStartToken, java.lang.String sectionEndToken, java.lang.String comment)
-
-
Method Details
-
writeDisjointClasses
private void writeDisjointClasses(java.util.List<java.util.List<java.lang.String>> disjointClassSet, java.lang.String dst) -
countIndentation
private int countIndentation(java.lang.String line) -
writeDisjunctClassSet
private void writeDisjunctClassSet(java.util.ArrayList<WriteDisjointClassDefs.ClassEntity> classList) throws java.io.IOException- Throws:
java.io.IOException
-