Class JsonQueryERElement
java.lang.Object
org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryElement
org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryERElement
- Direct Known Subclasses:
JsonQueryEntity,JsonQueryRelation
Base class for JSON query elements that participate in graph relation traversal
(Resources, Facets,
IsRelatedTo, ConsistsOf), adding an edge
direction and back-reference traverseBack on top of the generic
JsonQueryElement translation machinery.
Flat, standalone collections with no relations to traverse (e.g. QueryTemplate,
Context) extend JsonQueryElement directly instead — they are never an ER
(Entity-Relation) element.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.gcube.informationsystem.base.reference.DirectionThe relation graph traversal direction.protected booleanWhether to traverse backwards through relations.Fields inherited from class org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryElement
accessType, alias, BACKEND_LINK_FIELD_PREFIXES, BACKEND_LINK_FIELDS, BACKEND_TYPE_NAME_FIELD, breadcrumb, CREATED_BY_PATH, declaredPropertyResolver, ELEMENT_INDEX_PATTERN, encryptedTypeParameters, entryPoint, FALSE_CONDITION, FIELD_NAME_PATTERN, fieldNamesToRemove, fieldsToEmit, IS_NULL, jsonNode, LAST_UPDATE_BY_PATH, logger, maskMetadata, objectMapper, operandValidator, OPERATOR_PREFIX, polymorphic, position, projection, queryParameterIndex, queryParameters, RECORD_ATTRIBUTE_PREFIX, size, type, unqueryableFields -
Constructor Summary
ConstructorsConstructorDescriptionJsonQueryERElement(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonQuery, org.gcube.informationsystem.base.reference.AccessType accessType) Creates a newJsonQueryERElementinstance for the specified JSON query subtree. -
Method Summary
Modifier and TypeMethodDescriptionorg.gcube.informationsystem.base.reference.DirectionReturns the relation graph traversal direction of this element.booleanReturns whether to traverse backwards through relations.voidsetDirection(org.gcube.informationsystem.base.reference.Direction direction) Sets the relation graph traversal direction of this element.voidsetEntryPoint(boolean entryPoint) Sets whether this query element represents the root entry point of the query.voidsetTraverseBack(boolean traverseBack) Sets whether to traverse backwards through relations.Methods inherited from class org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryElement
addComparisonConstraint, addConstraints, addFieldToEmit, addLogicalConstraints, createMatchQuery, createQuery, evaluateNode, excludeEncrypted, generateAlias, getAlias, getAlias, getBreadcrumb, getChildrenBreadcrumb, getFieldOperand, getFieldReference, getKey, getPosition, getPropertyDomain, getQueryParameters, getRequiredType, getScalarValue, getScalarValue, getSpecificMatchQuery, getType, getValue, isEntryPoint, isProjection, isSensitiveField, resolveFieldName, setBreadcrumb, setMaskMetadata, setPolymorphic, setPosition, setProjection, validateEmittedField, validateLogicalCondition, validateType, wrapMatchQuery
-
Field Details
-
direction
protected org.gcube.informationsystem.base.reference.Direction directionThe relation graph traversal direction. -
traverseBack
protected boolean traverseBackWhether to traverse backwards through relations.
-
-
Constructor Details
-
JsonQueryERElement
public JsonQueryERElement(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonQuery, org.gcube.informationsystem.base.reference.AccessType accessType) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Creates a newJsonQueryERElementinstance for the specified JSON query subtree.- Parameters:
jsonQuery- the JSON query node representing this elementaccessType- the access type category- 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
-
getDirection
public org.gcube.informationsystem.base.reference.Direction getDirection()Returns the relation graph traversal direction of this element.- Returns:
- the relation direction
-
setDirection
public void setDirection(org.gcube.informationsystem.base.reference.Direction direction) Sets the relation graph traversal direction of this element.- Parameters:
direction- the relation direction to set
-
setEntryPoint
public void setEntryPoint(boolean entryPoint) Description copied from class:JsonQueryElementSets whether this query element represents the root entry point of the query.- Overrides:
setEntryPointin classJsonQueryElement- Parameters:
entryPoint-trueif this is the entry point,falseotherwise
-
isTraverseBack
public boolean isTraverseBack()Returns whether to traverse backwards through relations.- Returns:
trueto traverse back,falseotherwise
-
setTraverseBack
public void setTraverseBack(boolean traverseBack) Sets whether to traverse backwards through relations.- Parameters:
traverseBack-trueto traverse back,falseotherwise
-