Package com.complexible.stardog.plan.eval.service

# Class PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder

java.lang.Object
com.complexible.stardog.plan.eval.service.ServiceQuery.ServiceQueryBuilder
com.complexible.stardog.plan.eval.service.PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder

Direct Known Subclasses:
  `LogicalServiceQuery.LogicalServiceQueryBuilder`, `PlanNodeBodyServiceQuery.CanonicalizedPlanNodeBodyServiceQueryBuilder`

Enclosing class:
  `PlanNodeBodyServiceQuery`

public abstract static class PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder extends ServiceQuery.ServiceQueryBuilder
Base builder for `PlanNodeBodyServiceQuery` objects

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected com.complexible.stardog.plan.PlanNode`
  `mBody`
  `protected com.complexible.stardog.plan.cache.TermPositionPredicate`
  `mPositionPredicate`
  `protected IntFunction<String>`
  `mVarNames`

  ### Fields inherited from class com.complexible.stardog.plan.eval.service.ServiceQuery.ServiceQueryBuilder

  `mServiceTerm`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PlanNodeBodyServiceQueryBuilder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder`
  `assignIDs(com.complexible.stardog.index.dictionary.MappingDictionary mappings)`
  `PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder`
  `body(com.complexible.stardog.plan.PlanNode body)`
  `abstract PlanNodeBodyServiceQuery`
  `build()`
  `PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder`
  `optimize(com.complexible.stardog.plan.optimizer.OptimizingVisitor optimizer, String name)`
  Allows general `plan optimizers` apply their optimizations to service patterns while also allowing services to influence how the optimization is applied.
  `protected com.complexible.stardog.plan.PlanNode`
  `replaceBodyConstants(com.complexible.stardog.index.dictionary.MappingDictionary dictionary, UnaryOperator<com.complexible.stardog.plan.filter.expr.Constant> mapping, boolean performValidation)`
  `ServiceQuery.ServiceQueryBuilder`
  `replaceConstants(com.complexible.stardog.index.dictionary.MappingDictionary dictionary, UnaryOperator<com.complexible.stardog.plan.filter.expr.Constant> mapping, boolean performValidation)`
  Replace constants in the query using the provided mapping.
  `PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder`
  `scopeOf(List<PlanNodeBodyServiceQuery> theArgs)`
  `PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder`
  `serviceTerm(com.complexible.stardog.plan.QueryTerm term)`
  `PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder`
  `termPositionPredicate(com.complexible.stardog.plan.cache.TermPositionPredicate thePredicate)`
  `PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder`
  `unionOf(List<PlanNodeBodyServiceQuery> theArgs)`
  `ServiceQuery.ServiceQueryBuilder`
  `varNames(IntFunction<String> varNames)`
  Propagate a function for mapping internal variable IDs to user-facing variable names.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### mBody

    protected com.complexible.stardog.plan.PlanNode mBody

  - ### mPositionPredicate

    protected com.complexible.stardog.plan.cache.TermPositionPredicate mPositionPredicate

  - ### mVarNames

    protected IntFunction<String> mVarNames

- ## Constructor Details

  - ### PlanNodeBodyServiceQueryBuilder

    public PlanNodeBodyServiceQueryBuilder()

- ## Method Details

  - ### varNames

    public ServiceQuery.ServiceQueryBuilder varNames(IntFunction<String> varNames)
    Description copied from class: `ServiceQuery.ServiceQueryBuilder`
    Propagate a function for mapping internal variable IDs to user-facing variable names. Some services, like the Stored Query Service, need to know it and possibly update when reusing a cached plan.
    Specified by:
      `varNames` in class `ServiceQuery.ServiceQueryBuilder`

  - ### body

    public PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder body(com.complexible.stardog.plan.PlanNode body)

  - ### optimize

    public PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder optimize(com.complexible.stardog.plan.optimizer.OptimizingVisitor optimizer, String name)
    Allows general `plan optimizers` apply their optimizations to service patterns while also allowing services to influence how the optimization is applied. This is useful, for example, for the Stored Query Service where optimizations, such as pushing limits, should apply to the plan of the stored query, not to the SQS pattern in the main query (i.e. a configuration BGP with sqs:variables, etc.). If this kind of control is not needed, the optimizer can simply visit the service body as it traverses the query plan.
    Parameters:
      `optimizer` - the optimizer to be applied to the service body.
      `name` - the name of the optimizer (for logging and debugging purposes, see `PlanNodeOptimizer.name()`)
    Returns:
      this builder after applying the optimization

  - ### termPositionPredicate

    public PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder termPositionPredicate(com.complexible.stardog.plan.cache.TermPositionPredicate thePredicate)

  - ### serviceTerm

    public PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder serviceTerm(com.complexible.stardog.plan.QueryTerm term)
    Overrides:
      `serviceTerm` in class `ServiceQuery.ServiceQueryBuilder`

  - ### assignIDs

    public PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder assignIDs(com.complexible.stardog.index.dictionary.MappingDictionary mappings)

  - ### replaceBodyConstants

    protected com.complexible.stardog.plan.PlanNode replaceBodyConstants(com.complexible.stardog.index.dictionary.MappingDictionary dictionary, UnaryOperator<com.complexible.stardog.plan.filter.expr.Constant> mapping, boolean performValidation)

  - ### replaceConstants

    public ServiceQuery.ServiceQueryBuilder replaceConstants(com.complexible.stardog.index.dictionary.MappingDictionary dictionary, UnaryOperator<com.complexible.stardog.plan.filter.expr.Constant> mapping, boolean performValidation)
    Description copied from class: `ServiceQuery.ServiceQueryBuilder`
    Replace constants in the query using the provided mapping. Constants that are able to be replaced will be canonicalized for `plan caching`. Constants which are not able to be replaced will be cached and only plans with the same constants will be reused.

    If `performValidation` is not set, the returned query may be abstract until another call to the same method with `performValidation` set to true. That is, `performValidation` set to false indicates we may use canonicalized constants which need not pass query validation. Canonicalized service queries won't be executed unless replaced with concrete constants.

    todo: this may not be the best name since it's not really about general purpose replacement but specifically about canonicalisation
    Overrides:
      `replaceConstants` in class `ServiceQuery.ServiceQueryBuilder`

  - ### scopeOf

    public PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder scopeOf(List<PlanNodeBodyServiceQuery> theArgs)

  - ### unionOf

    public PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder unionOf(List<PlanNodeBodyServiceQuery> theArgs)

  - ### build

    public abstract PlanNodeBodyServiceQuery build()
    Specified by:
      `build` in class `ServiceQuery.ServiceQueryBuilder`