Skip to content

Package: OWLDataProperty

OWLDataProperty

Coverage

1: /**
2: * Copyright (C) 2022 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.jopa.model.annotations;
16:
17: import java.lang.annotation.*;
18:
19: /**
20: * Marks an attribute mapped to an OWL datatype property.
21: * <p>
22: * This means that literal values are expected for such attributes.
23: * <p>
24: * Note that for use with RDF(S), attributes annotated with this annotation are expected to reference literals.
25: */
26: @Documented
27: @Retention(RetentionPolicy.RUNTIME)
28: @Target(ElementType.FIELD)
29: public @interface OWLDataProperty {
30:
31: /**
32: * IRI of the data property
33: *
34: * @return IRI of the data property
35: */
36: String iri();
37:
38: /**
39: * (Optional) Whether the association should be lazily loaded or must be eagerly fetched.
40: *
41: * @return Fetch type of this property
42: */
43: FetchType fetch() default FetchType.EAGER;
44:
45: /**
46: * (Optional) Marks an attribute whose value is a lexical form of a literal value.
47: * <p>
48: * This parameter should be used on {@code String} attributes, as literal lexical form is always a string. Lexical
49: * form of a literal of any datatype can be loaded.
50: * <p>
51: * Saving the lexical form is forbidden to prevent unintentional change of the data type, unless {@link #datatype()}
52: * is explicitly specified.
53: */
54: boolean lexicalForm() default false;
55:
56: /**
57: * (Optional) Whether the value should be stored as a <a href="https://www.w3.org/TR/rdf11-concepts/">simple
58: * literal</a>, i.e. {@code xsd:string}.
59: *
60: * @return Whether the mapped value is a simple literal
61: */
62: boolean simpleLiteral() default false;
63:
64: /**
65: * IRI of the datatype to use when storing values of this property.
66: * <p>
67: * If specified, the value of the attribute is treated as the lexical form of the literal (and should be a {@code String}).
68: *
69: * @return Datatype IRI
70: */
71: String datatype() default "";
72: }