class DefaultSelectionAsgStrategy implements AsgStrategy {

    @Override
    public void apply(AsgQuery query, AsgStrategyContext context) {
        Ontology.Accessor ont = new Ontology.Accessor(this.ontologyProvider.get(query.getOnt()).get());

        AsgQueryUtil.elements(query, EPropGroup.class).forEach(ePropGroupAsgEBase -> {
                    if (Stream.ofAll(ePropGroupAsgEBase.geteBase().getProps())
                            .filter(eProp -> !(eProp instanceof CalculatedEProp))
                            .filter(eProp -> eProp.getProj() != null)
                            .isEmpty()) {

                        Optional<AsgEBase<ETyped>> eTypedAsgEBase = AsgQueryUtil.ancestor(ePropGroupAsgEBase, ETyped.class);
                        List<EProp> projectionProps = Collections.emptyList();

                         if (eTypedAsgEBase.isPresent()) {
                            projectionProps =
                                    Stream.ofAll(ont.$entity$(eTypedAsgEBase.get().geteBase().geteType()).getProperties())
                                    .filter(pType -> !this.nonSelectablePTypes.contains(pType))
                                    .map(pType -> new EProp(0, pType, new IdentityProjection()))
                                    .toJavaList();
                        } else {
                            Optional<AsgEBase<EUntyped>> eUntypedAsgEBase = AsgQueryUtil.ancestor(ePropGroupAsgEBase, EUntyped.class);
                            if (eUntypedAsgEBase.isPresent()) {
                                projectionProps =
                                        Stream.ofAll(ont.entities())
                                        .flatMap(EntityType::getProperties)
                                        .filter(pType -> !this.nonSelectablePTypes.contains(pType))
                                        .map(pType -> new EProp(0, pType, new IdentityProjection()))
                                        .toJavaList();
                            }
                        }

                        if (ePropGroupAsgEBase.geteBase().getQuantType().equals(QuantType.all)) {
                            ePropGroupAsgEBase.geteBase().getProps().addAll(projectionProps);
                        } else if (ePropGroupAsgEBase.geteBase().getQuantType().equals(QuantType.some)) {
                             EPropGroup clone = new EPropGroup(
                                     0,
                                     QuantType.some,
                                     ePropGroupAsgEBase.geteBase().getProps(),
                                     ePropGroupAsgEBase.geteBase().getGroups());

                             ePropGroupAsgEBase.geteBase().getProps().clear();
                             ePropGroupAsgEBase.geteBase().getGroups().clear();
                             ePropGroupAsgEBase.geteBase().setQuantType(QuantType.all);
                             ePropGroupAsgEBase.geteBase().getGroups().add(clone);
                             ePropGroupAsgEBase.geteBase().getProps().addAll(projectionProps);
                        }
                    }
                }
        );
    }

    public  DefaultSelectionAsgStrategy(OntologyProvider ontologyProvider);

}