public class OWL2_Generator
extends java.lang.Object
OWL2_Generator class serves as the core application logic
within a Java framework for generating OWL/XML ontologies: It
leverages text files containing configuration details to
construct the ontology structure. This class acts as the
central controller, directing the overall process of ontology
generation based on user-provided configuration files.
Key Functionalities:
Processes Command Line Arguments: Evaluates user-provided arguments to determine the input/output directory for text files used during generation.
Controls Ontology Generation Sequence: Orchestrates the creation of the ontology by calling dedicated modules responsible for:
- Generating the OWL header
- Defining class structures
- Setting class disjointness
- Defining object property triplets (relationships between individuals)
Manages Configuration Files: Employs separate text files for each generation step, allowing for modularity and customization.
Logs Console Messages: Provides informative messages during execution to track progress.
Additional Notes:
The class utilizes pre-defined file paths and comments within the code, suggesting potential improvements for user-configurable settings.
The comments indicate the framework's reliance on external classes.
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/05/28
- Version:
- 1-001
- Author:
- Edit Hlaszny (https://www.hlaszny.eu/)
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringbaseURIThe base URI plays a significant role in managing namespaces, resolving references, and potentially aiding in disambiguation within OWL/XML encoded ontologies.private java.lang.StringclassAnnotationsText file name, which defines the ontologz OWL class names.private java.lang.StringcommentCharAny text following thecommentstring on the first position is ignored by this simple parser in the classprivate java.lang.StringdefaultIOdirNameThis app is a Java-based, text file controlled OWL2 ontology generator.private java.lang.StringdisjointClassNameFileText file name, which defines the disjoint OWL classesprivate java.lang.StringheaderDefFileText file name, which defines the parameters of the ontology headerprivate java.lang.StringindentedClassNamesText file name, which defines the ontologz OWL class names.private java.lang.StringIOdirectoryNameYou can overwrite this value with the 1st calling argument.private java.lang.StringkeyWord_CLASS_ANNOTATIONSprivate java.lang.StringkeyWord_CLASS_NAMEprivate java.lang.StringkeyWord_END_OF_DISJOINT_CLASS_SETprivate java.lang.StringkeyWord_END_OF_TRIPLET_SETprivate java.lang.StringkeyWord_START_OF_DISJOINT_CLASS_SETKeywords in the control filesprivate java.lang.StringkeyWord_START_OF_TRIPLET_SETprivate intleadingZeroesInNameSuffixThe OWL class individuals are with leading zeroes serial numbers suffixed.private java.lang.StringOWLresultFileText file name, which defines the name of the OWL2/XML encoded result fileprivate java.lang.StringrunableJarfileName of the JAR-file making the app stand alone runableprivate booleansilentModeSilent mode> no log messages will be displayedprivate java.lang.StringtripletDefFileText file name, which defines the triplets -
Constructor Summary
Constructors Constructor Description OWL2_Generator() -
Method Summary
Modifier and Type Method Description private voidevalCallingArgs(java.lang.String[] args)The method evaluates the calling arguments, and set the default directory, if it is set by the $1 arg.private voidgenerateOWL2ontology(java.lang.String[] args)The method controls the sequence of the ontology generation.voidlog(java.lang.String logEntry)Writes text message to the consolevoidLog(java.lang.String logEntry)static voidmain(java.lang.String[] args)The main method starts the app.
-
Field Details
-
baseURI
private final java.lang.String baseURIThe base URI plays a significant role in managing namespaces, resolving references, and potentially aiding in disambiguation within OWL/XML encoded ontologies.- See Also:
- Constant Field Values
-
commentChar
private final java.lang.String commentCharAny text following thecommentstring on the first position is ignored by this simple parser in the class- See Also:
- Constant Field Values
-
defaultIOdirName
private final java.lang.String defaultIOdirNameThis app is a Java-based, text file controlled OWL2 ontology generator. The text files should have a common directory where they are stored.- See Also:
- Constant Field Values
-
leadingZeroesInNameSuffix
private final int leadingZeroesInNameSuffixThe OWL class individuals are with leading zeroes serial numbers suffixed. TheleadingZeroesInNameSuffixdefines the length the serial number.- See Also:
- Constant Field Values
-
runableJarfile
private final java.lang.String runableJarfileName of the JAR-file making the app stand alone runable- See Also:
- Constant Field Values
-
disjointClassNameFile
private java.lang.String disjointClassNameFileText file name, which defines the disjoint OWL classes -
headerDefFile
private java.lang.String headerDefFileText file name, which defines the parameters of the ontology header -
indentedClassNames
private java.lang.String indentedClassNamesText file name, which defines the ontologz OWL class names. The file is TAB-indented, being able to use it to Protégé -
classAnnotations
private java.lang.String classAnnotationsText file name, which defines the ontologz OWL class names. The file is TAB-indented, being able to use it to Protégé -
OWLresultFile
private java.lang.String OWLresultFileText file name, which defines the name of the OWL2/XML encoded result file -
tripletDefFile
private java.lang.String tripletDefFileText file name, which defines the triplets -
IOdirectoryName
private java.lang.String IOdirectoryNameYou can overwrite this value with the 1st calling argument. See the method evalCallingArgs() -
keyWord_START_OF_DISJOINT_CLASS_SET
private final java.lang.String keyWord_START_OF_DISJOINT_CLASS_SETKeywords in the control files- See Also:
- Constant Field Values
-
keyWord_END_OF_DISJOINT_CLASS_SET
private final java.lang.String keyWord_END_OF_DISJOINT_CLASS_SET- See Also:
- Constant Field Values
-
keyWord_START_OF_TRIPLET_SET
private final java.lang.String keyWord_START_OF_TRIPLET_SET- See Also:
- Constant Field Values
-
keyWord_END_OF_TRIPLET_SET
private final java.lang.String keyWord_END_OF_TRIPLET_SET- See Also:
- Constant Field Values
-
keyWord_CLASS_NAME
private final java.lang.String keyWord_CLASS_NAME- See Also:
- Constant Field Values
-
keyWord_CLASS_ANNOTATIONS
private final java.lang.String keyWord_CLASS_ANNOTATIONS- See Also:
- Constant Field Values
-
silentMode
private final boolean silentModeSilent mode> no log messages will be displayed- See Also:
- Constant Field Values
-
-
Constructor Details
-
OWL2_Generator
public OWL2_Generator()
-
-
Method Details
-
main
public static final void main(java.lang.String[] args)The main method starts the app.- Parameters:
args- Java standard calling arguments
-
evalCallingArgs
private void evalCallingArgs(java.lang.String[] args)The method evaluates the calling arguments, and set the default directory, if it is set by the $1 arg.- Parameters:
args- Java standard calling arguments
-
generateOWL2ontology
private void generateOWL2ontology(java.lang.String[] args)The method controls the sequence of the ontology generation. The app consists of the following modules (each of them is controlled by the corresponding text parameter files):
1) generating the OWL-header
2) defining the class structures
3) setting class disjointness
4) defining triplets- Parameters:
args- Java standard calling arguments
-
log
public void log(java.lang.String logEntry)Writes text message to the console- Parameters:
logEntry- displayed message
-
Log
public void Log(java.lang.String logEntry)
-