Skip to content

Package: Option

Option

nameinstructionbranchcomplexitylinemethod
Option(String, int, String, String)
M: 0 C: 11
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
static {...}
M: 0 C: 131
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 17
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * JOPA
3: * Copyright (C) 2024 Czech Technical University in Prague
4: *
5: * This library is free software; you can redistribute it and/or
6: * modify it under the terms of the GNU Lesser General Public
7: * License as published by the Free Software Foundation; either
8: * version 3.0 of the License, or (at your option) any later version.
9: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library.
17: */
18: package cz.cvut.kbss.jopa.owl2java.cli;
19:
20: /**
21: * Command line options for configuring the transformation/vocabulary generation.
22: */
23: public enum Option {
24: /**
25: * Mapping file path.
26: * <p>
27: * Mapping file allows to map logical ontology IRI to its physical location (e.g. IRI to a local file path)
28: */
29: MAPPING_FILE("m", "mapping file"),
30: /**
31: * Name of context which should be processed by the tool.
32: * <p>
33: * Context is specified by annotating an axiom with {@link cz.cvut.kbss.jopa.owl2java.Constants#P_IS_INTEGRITY_CONSTRAINT_FOR}
34: * containing the name of the context. When it is specified, only axioms annotated with the context name are
35: * considered for transformation/vocabulary generation.
36: */
37: CONTEXT("c", "context name"),
38: /**
39: * Whether to generate vocabulary constants as instances of OWLAPI {@link org.semanticweb.owlapi.model.IRI}.
40: * <p>
41: * By default, they are String.
42: */
43: WITH_IRIS("w", "with OWLAPI IRIs"),
44: /**
45: * Output directory name.
46: * <p>
47: * Note that the generator will create subdirectories corresponding to the package into which the target classes are
48: * generated.
49: */
50: TARGET_DIR("d", "output directory"),
51: /**
52: * Target package for the generated classes.
53: * <p>
54: * Note that when generating the model, a {@link cz.cvut.kbss.jopa.owl2java.Constants#MODEL_PACKAGE} subpackage is
55: * put into the configured package for model classes. E.g., when generating into {@code cz.cvut.kbss}, the {@code
56: * Vocabulary} will be in this package, but the model classes will be in {@code cz.cvut.kbss.model}.
57: */
58: PACKAGE("p", "package"),
59: /**
60: * Whether to interpret the whole ontology as integrity constraints.
61: * <p>
62: * This supersedes {@link #CONTEXT} and processes all axioms in the ontology.
63: */
64: WHOLE_ONTOLOGY_AS_IC("i",
65: "interpret whole ontology as integrity constraints; this option supersedes the '-c' option."),
66: /**
67: * Whether to ignore failed imports.
68: * <p>
69: * By default, the transformation/vocabulary generation will fail if an import cannot be resolved.
70: */
71: IGNORE_FAILED_IMPORTS("f", "ignore failed ontology imports"),
72: /**
73: * Configures annotation whose value should be used as name of the target Java class.
74: * <p>
75: * By default, the Java class name is derived from the class IRI.
76: */
77: JAVA_CLASSNAME_ANNOTATION("jca", "java class name annotation"),
78: /**
79: * Configures whether properties with RDF langString range should be mapped to {@link
80: * cz.cvut.kbss.jopa.model.MultilingualString} typed fields.
81: * <p>
82: * Defaults to {@link cz.cvut.kbss.jopa.owl2java.config.Defaults#PREFER_MULTILINGUAL_STRINGS}. If false, the fields
83: * will have type {@link String}.
84: */
85: PREFER_MULTILINGUAL_STRINGS("langStrings", "prefer multilingual strings"),
86: /**
87: * Generic type of the {@link cz.cvut.kbss.jopa.model.annotations.Properties} attribute.
88: * <p>
89: * Possible options are {@link PropertiesType#string} for {@code <String, Set<String>>} or {@link
90: * PropertiesType#object} for {@code <String, Set<Object>>}.
91: */
92: PROPERTIES_TYPE("pt", "type of the @Properties map value set - string (default), object"),
93: /**
94: * Whether to generate Javadoc from values of {@code rdfs:comment} annotations.
95: * <p>
96: * By default, OWL2Java will generate Javadoc from the first rdfs:comment it finds for each axiom. This leads to
97: * documentation being created for classes, their attributes and vocabulary constants.
98: */
99: GENERATE_JAVADOC_FROM_COMMENT("doc", "generate Javadoc from rdfs:comment annotations"),
100:
101: /**
102: * Whether to automatically generate name ({@literal rdfs:label}) and description ({@literal dc:description})
103: * fields.
104: */
105: GENERATE_ANNOTATION_FIELDS("ann", "automatically generate rdfs:label and dc:description attributes for all entities"),
106:
107: /**
108: * Whether to automatically generate an entity class corresponding to {@literal owl:Thing}.
109: */
110: GENERATE_THING("thing", "automatically generate an entity class corresponding to owl:Thing"),
111:
112: /**
113: * Property whose value represents the ontology IRI prefix.
114: */
115: ONTOLOGY_PREFIX_PROPERTY("prefixProperty", "identifier of the property whose value represents the ontology IRI prefix"),
116:
117: /**
118: * Specifies whether to always use ontology prefix (if available) when generating vocabulary and model.
119: */
120: ALWAYS_USE_ONTOLOGY_PREFIX("usePrefixes", "whether to always use ontology prefix for generating vocabulary and model"),
121:
122: /**
123: * Specifies file containing ontology prefix mapping.
124: */
125: PREFIX_MAPPING_FILE("prefixFile", "file containing prefix mapping");
126:
127: public final String arg;
128: final String description;
129:
130: Option(String arg, String description) {
131: this.arg = arg;
132: this.description = description;
133: }
134: }