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
FieldsModifier and TypeFieldDescriptionprotected com.complexible.stardog.plan.PlanNodeprotected com.complexible.stardog.plan.cache.TermPositionPredicateprotected IntFunction<String> Fields inherited from class com.complexible.stardog.plan.eval.service.ServiceQuery.ServiceQueryBuilder
mServiceTerm -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassignIDs(com.complexible.stardog.index.dictionary.MappingDictionary mappings) body(com.complexible.stardog.plan.PlanNode body) abstract PlanNodeBodyServiceQuerybuild()Allows generalplan optimizersapply their optimizations to service patterns while also allowing services to influence how the optimization is applied.protected com.complexible.stardog.plan.PlanNodereplaceBodyConstants(com.complexible.stardog.index.dictionary.MappingDictionary dictionary, UnaryOperator<com.complexible.stardog.plan.filter.expr.Constant> mapping, boolean performValidation) 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.scopeOf(List<PlanNodeBodyServiceQuery> theArgs) serviceTerm(com.complexible.stardog.plan.QueryTerm term) termPositionPredicate(com.complexible.stardog.plan.cache.TermPositionPredicate thePredicate) unionOf(List<PlanNodeBodyServiceQuery> theArgs) varNames(IntFunction<String> varNames) Propagate a function for mapping internal variable IDs to user-facing variable names.
-
Field Details
-
mBody
protected com.complexible.stardog.plan.PlanNode mBody -
mPositionPredicate
protected com.complexible.stardog.plan.cache.TermPositionPredicate mPositionPredicate -
mVarNames
-
-
Constructor Details
-
PlanNodeBodyServiceQueryBuilder
public PlanNodeBodyServiceQueryBuilder()
-
-
Method Details
-
varNames
Description copied from class:ServiceQuery.ServiceQueryBuilderPropagate 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:
varNamesin classServiceQuery.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 generalplan optimizersapply 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, seePlanNodeOptimizer.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:
serviceTermin classServiceQuery.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.ServiceQueryBuilderReplace constants in the query using the provided mapping. Constants that are able to be replaced will be canonicalized forplan caching. Constants which are not able to be replaced will be cached and only plans with the same constants will be reused. IfperformValidationis not set, the returned query may be abstract until another call to the same method withperformValidationset to true. That is,performValidationset 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:
replaceConstantsin classServiceQuery.ServiceQueryBuilder
-
scopeOf
public PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder scopeOf(List<PlanNodeBodyServiceQuery> theArgs) -
unionOf
public PlanNodeBodyServiceQuery.PlanNodeBodyServiceQueryBuilder unionOf(List<PlanNodeBodyServiceQuery> theArgs) -
build
- Specified by:
buildin classServiceQuery.ServiceQueryBuilder
-