Skip to content

Commit

Permalink
[Feature #53] Add simpleLiteral attribute to OWL(Annotation/Data)Prop…
Browse files Browse the repository at this point in the history
…erty to mark attributes mapped to RDF simple literals.
  • Loading branch information
ledsoft committed Jul 15, 2019
1 parent 2520760 commit 01b6f2c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/**
* Marks an attribute mapped to an OWL annotation property.
*
* <p>
* This means that the attribute can contain a literal or a reference to another object.
*/
@Documented
Expand All @@ -38,7 +38,7 @@
FetchType fetch() default FetchType.EAGER;

/**
* Marks an attribute whose value is a lexical form of a literal value.
* (Optional) Marks an attribute whose value is a lexical form of a literal value.
* <p>
* This parameter should be used on {@code String} attributes, as literal lexical form is always a string. Lexical
* form of a literal of any datatype can be loaded. However, saving the lexical form is forbidden to prevent
Expand All @@ -48,4 +48,16 @@
* {@code String} is a valid identifier mapping type.
*/
boolean lexicalForm() default false;

/**
* (Optional) Whether the value should be stored as a <a href="https://www.w3.org/TR/rdf11-concepts/">simple
* literal</a>, i.e. {@code xsd:string}.
* <p>
* Note that if the value being loaded is an identifier, it will still be loaded, because it is not a literal and
* {@code String} is a valid identifier mapping type. However, updates will replace the original with a {@code
* xsd:string} value.
*
* @return Whether the mapped value is a simple literal
*/
boolean simpleLiteral() default false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

/**
* Marks an attribute mapped to an OWL datatype property.
*
* <p>
* This means that literal values are expected for such attributes.
*
* <p>
* Note that for use with RDF(S), attributes annotated with this annotation are expected to reference literals.
*/
@Documented
Expand All @@ -41,11 +41,19 @@
FetchType fetch() default FetchType.EAGER;

/**
* Marks an attribute whose value is a lexical form of a literal value.
* (Optional) Marks an attribute whose value is a lexical form of a literal value.
* <p>
* This parameter should be used on {@code String} attributes, as literal lexical form is always a string. Lexical
* form of a literal of any datatype can be loaded. However, saving the lexical form is forbidden to prevent
* unintentional change of the data type.
*/
boolean lexicalForm() default false;

/**
* (Optional) Whether the value should be stored as a <a href="https://www.w3.org/TR/rdf11-concepts/">simple
* literal</a>, i.e. {@code xsd:string}.
*
* @return Whether the mapped value is a simple literal
*/
boolean simpleLiteral() default false;
}

0 comments on commit 01b6f2c

Please sign in to comment.