Class JsonQueryQueryTemplate
QueryTemplate entity.
A QueryTemplate is a flat, standalone entity with no graph relations to
traverse: it is always the entry point of the query, never nested inside (nor
traversing into) another query element — hence extending JsonQueryElement
directly rather than JsonQueryERElement,
which is reserved for Resources/Facets/Relations that actually participate in graph
traversal.
Lives in the standalone package rather than entities: QueryTemplate
is its own top-level AccessType category, not an ENTITY (Resource/Facet),
so grouping it alongside JsonQueryResource/JsonQueryFacet would misrepresent
its taxonomy — the same category error originally made with the ER-element inheritance.
QueryTemplate.TEMPLATE_PROPERTY and QueryTemplate.TEMPLATE_VARIABLES_PROPERTY
are stored as opaque JSON strings rather than structured documents, so they are excluded
from generic property constraint evaluation (matching only name/description
and standard base fields).
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
Fields inherited from class org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryElement
accessType, alias, breadcrumb, entryPoint, fieldNamesToRemove, fieldsToEmit, jsonNode, logger, objectMapper, polymorphic, position, projection, queryParameterIndex, queryParameters, size, type -
Constructor Summary
ConstructorsConstructorDescriptionJsonQueryQueryTemplate(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonQuery) Creates a newJsonQueryQueryTemplateinstance for the specified JSON query subtree. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBuffergetSpecificMatchQuery(List<JsonQueryElement> childrenBreadcrumb) Generates the specific MATCH query snippet for this element's subclass (subclass hook).Methods inherited from class org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryElement
addConstraints, addFieldToEmit, createMatchQuery, createQuery, evaluateNode, generateAlias, getAlias, getAlias, getBreadcrumb, getChildrenBreadcrumb, getKey, getPosition, getQueryParameters, getScalarValue, getType, getValue, isEntryPoint, isProjection, setBreadcrumb, setEntryPoint, setPolymorphic, setPosition, setProjection, validateType, wrapMatchQuery
-
Constructor Details
-
JsonQueryQueryTemplate
public JsonQueryQueryTemplate(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonQuery) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Creates a newJsonQueryQueryTemplateinstance for the specified JSON query subtree.- Parameters:
jsonQuery- the JSON query node representing the query template- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException- if schema validation failsorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database or lookup error
-
-
Method Details
-
getSpecificMatchQuery
protected StringBuffer getSpecificMatchQuery(List<JsonQueryElement> childrenBreadcrumb) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Description copied from class:JsonQueryElementGenerates the specific MATCH query snippet for this element's subclass (subclass hook).- Specified by:
getSpecificMatchQueryin classJsonQueryElement- Parameters:
childrenBreadcrumb- the list of child query elements visited- Returns:
- the MATCH query snippet string buffer
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException- if schema validation failsorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- on database error
-