java.lang.Object
org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryElement
org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryERElement
Direct Known Subclasses:
JsonQueryEntity, JsonQueryRelation

public abstract class JsonQueryERElement extends JsonQueryElement
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 Details

    • direction

      protected org.gcube.informationsystem.base.reference.Direction direction
      The relation graph traversal direction.
    • traverseBack

      protected boolean traverseBack
      Whether 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 new JsonQueryERElement instance for the specified JSON query subtree.
      Parameters:
      jsonQuery - the JSON query node representing this element
      accessType - the access type category
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException - if schema validation fails
      org.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: JsonQueryElement
      Sets whether this query element represents the root entry point of the query.
      Overrides:
      setEntryPoint in class JsonQueryElement
      Parameters:
      entryPoint - true if this is the entry point, false otherwise
    • isTraverseBack

      public boolean isTraverseBack()
      Returns whether to traverse backwards through relations.
      Returns:
      true to traverse back, false otherwise
    • setTraverseBack

      public void setTraverseBack(boolean traverseBack)
      Sets whether to traverse backwards through relations.
      Parameters:
      traverseBack - true to traverse back, false otherwise