private void init(Map<String, String> requestMap,
                      CompiledQueryProfile queryProfile,
                      Map<String, Embedder> embedders,
                      ZoneInfo zoneInfo,
                      SchemaInfo schemaInfo) {
        startTime = httpRequest.creationTime(TimeUnit.MILLISECONDS);
        if (queryProfile != null) {
            // Move all request parameters to the query profile
            Properties queryProfileProperties = new QueryProfileProperties(queryProfile, embedders, zoneInfo);
            properties().chain(queryProfileProperties);
            setPropertiesFromRequestMap(requestMap, properties(), true);

            // Create the full chain
            properties().chain(new RankProfileInputProperties(schemaInfo, this, embedders))
                        .chain(new QueryProperties(this, queryProfile.getRegistry(), embedders))
                        .chain(new ModelObjectMap())
                        .chain(new RequestContextProperties(requestMap))
                        .chain(queryProfileProperties)
                        .chain(new DefaultProperties());

            // Pass values from the query profile which maps to a field in the Query object model
            // through the property chain to cause those values to be set in the Query object model with
            // the right types according to query profiles
            setFieldsFrom(queryProfileProperties, requestMap);

            // We need special handling for "select" because it can be both the prefix of the nested JSON select
            // parameters, and a plain select expression. The latter will be disallowed by query profile types
            // since they contain the former.
            Object select = requestMap.get(Select.SELECT);
            if (select == null)
                select = queryProfile.get(Select.SELECT, requestMap);
            if (select != null)
                properties().set(Select.SELECT, select.toString());
        }
        else { // bypass these complications if there is no query profile to get values from and validate against
            properties().
                    chain(new RankProfileInputProperties(schemaInfo, this, embedders)).
                    chain(new QueryProperties(this, CompiledQueryProfileRegistry.empty, embedders)).
                    chain(new PropertyMap()).
                    chain(new DefaultProperties());
            setPropertiesFromRequestMap(requestMap, properties(), false);
        }

        properties().setParentQuery(this);
        trace.traceProperties();
    }
Creates a query from a request

@param request the HTTP request from which this is created
@param requestMap the property map of the query
@param queryProfile the query profile to use for this query, or null if none
container-search/src/main/java/com/yahoo/search/Query.java