Class JsonQueryIsRelatedTo
java.lang.Object
org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryElement
org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryERElement
org.gcube.informationsystem.resourceregistry.queries.json.base.relations.JsonQueryRelation
org.gcube.informationsystem.resourceregistry.queries.json.base.relations.JsonQueryIsRelatedTo
Translates a JSON query subtree representing an IsRelatedTo relation.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsFields inherited from class org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryERElement
direction, traverseBackFields 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
ConstructorsConstructorDescriptionJsonQueryIsRelatedTo(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonQuery) Creates a newJsonQueryIsRelatedToinstance for the specified JSON query subtree. -
Method Summary
Modifier and TypeMethodDescriptionReturns the requested resource schema type.protected StringBuffergetSpecificMatchQuery(List<JsonQueryElement> childrenBreadcrumb) Generates the specific MATCH query snippet for this element's subclass (subclass hook).voidSets the traversal direction of this relation based on the source/target properties in the JSON node.voidsetDirectionByJson(boolean matchQuery) Sets the traversal direction of this relation based on the source/target properties in the JSON node, optionally taking into account whether it's a MATCH query.voidsetRequestedResourceType(String requestedResourceType) Sets the requested resource schema type.Methods inherited from class org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryERElement
getDirection, isTraverseBack, setDirection, setEntryPoint, setTraverseBackMethods 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, setPolymorphic, setPosition, setProjection, validateType, wrapMatchQuery
-
Field Details
-
requestedResourceType
The requested resource schema type.
-
-
Constructor Details
-
JsonQueryIsRelatedTo
public JsonQueryIsRelatedTo(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 newJsonQueryIsRelatedToinstance for the specified JSON query subtree.- Parameters:
jsonQuery- the JSON query node- 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
-
getRequestedResourceType
Returns the requested resource schema type.- Returns:
- the requested resource schema type
-
setRequestedResourceType
Sets the requested resource schema type.- Parameters:
requestedResourceType- the requested resource schema type to set
-
setDirectionByJson
public void setDirectionByJson() throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryExceptionSets the traversal direction of this relation based on the source/target properties in the JSON node.- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException- if the JSON structure is invalid or has contradictory properties
-
setDirectionByJson
public void setDirectionByJson(boolean matchQuery) throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException Sets the traversal direction of this relation based on the source/target properties in the JSON node, optionally taking into account whether it's a MATCH query.- Parameters:
matchQuery-trueif it is a MATCH query,falseotherwise- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException- if the JSON structure is invalid or has contradictory properties
-
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
-