java.lang.Object
org.gcube.informationsystem.resourceregistry.queries.json.base.JsonQueryElement
org.gcube.informationsystem.resourceregistry.queries.json.base.standalone.JsonQueryContext

public class JsonQueryContext extends JsonQueryElement
Translates a JSON query subtree representing a Context entity.

Like QueryTemplate, a Context is a flat, standalone entity with no graph relations to traverse in the sense the JSON Query engine cares about — it is always the entry point of the query, hence extending JsonQueryElement directly rather than JsonQueryERElement. (Parent/child Context links exist, but are a distinct hierarchy-navigation concern handled by ContextRepository, not by graph traversal in this query engine.)

Lives in the standalone package rather than entities: Context 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.

Context.PARENT_PROPERTY and Context.CHILDREN_PROPERTY are excluded from generic property constraint evaluation: they are complex/nested structures, not simple scalar filters. Context.HISTORY can neither be filtered on nor projected: the history of a Context is served by its dedicated endpoint only. Filterable fields include name, path, state, effectiveState, and standard base fields (e.g. metadata.createdBy).

Author:
Luca Frosini (ISTI - CNR)
  • Constructor Details

    • JsonQueryContext

      public JsonQueryContext(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 new JsonQueryContext instance for the specified JSON query subtree.
      Parameters:
      jsonQuery - the JSON query node representing the context
      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

    • 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: JsonQueryElement
      Generates the specific MATCH query snippet for this element's subclass (subclass hook).
      Specified by:
      getSpecificMatchQuery in class JsonQueryElement
      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 fails
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - on database error