Annotation Interface Sparql
This annotation can be used for creating SPARQL queries directly on repository fields.
The field and query parameters cannot be of a primitive type.
Example:
@Sparql("PREFIX jopa:<http://krizik.felk.cvut.cz/ontologies/jopa/>\n" +
"SELECT ?stringAttribute WHERE {" +
"?this jopa:attributes#B-stringAttribute ?stringAttribute}")
private String stringQueryAttribute;
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
Whether to allow referencing other entity attributes in the query.IfFetchType.LAZY
is specified the attribute will not be initialized during entity construction but rather only when it is required by a getter method.
-
Element Details
-
query
String queryA native SPARQL query including any prefixes and parameters.
-
-
-
enableReferencingAttributes
boolean enableReferencingAttributesWhether to allow referencing other entity attributes in the query.If enabled, the provider will attempt to replace variables with names matching entity attributes with the attribute values.
Note that lazily loaded attribute values may not be used.
- Returns:
true
if variables referencing other entity attributes should be replaced in the query with the attribute values,false
otherwise
- Default:
- true
-
fetchType
FetchType fetchTypeIfFetchType.LAZY
is specified the attribute will not be initialized during entity construction but rather only when it is required by a getter method.- Default:
- EAGER
-