Package OWL2generator

Class WriteDisjointClassDefs

java.lang.Object
OWL2generator.WriteDisjointClassDefs

public class WriteDisjointClassDefs
extends java.lang.Object
The 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 class  WriteDisjointClassDefs.ClassEntity  
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private int countOfDCs  
    private int maxIndentation  
    private OWL2_Generator OWL2G  
    private SharedUtils shu  
    private java.io.FileWriter writer  
  • 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 int countIndentation​(java.lang.String line)  
    private void writeDisjointClasses​(java.util.List<java.util.List<java.lang.String>> disjointClassSet, java.lang.String dst)  
    private void writeDisjunctClassSet​(java.util.ArrayList<WriteDisjointClassDefs.ClassEntity> classList)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait