code: private String getPropertyPath(Expression reference, String alias) {
          if (reference instanceof Property) {
              Property property = (Property)reference;
              if (alias.equals(property.getScope())) {
                  return property.getPath();
              }
              else if (property.getSource() != null) {
                  String subPath = getPropertyPath(property.getSource(), alias);
                  if (subPath != null) {
                      return String.format("%s.%s", subPath, property.getPath());
                  }
              }
          }
  
          return null;
      }
docs: Collapse a property path expression back to it's qualified form for use as the path attribute of the retrieve.
  
  @param reference the <code>Expression</code> to collapse
  @param alias    the alias of the <code>Retrieve</code> in the query.
  @return The collapsed path
  operands (or sub-operands) were modified; <code>false</code> otherwise.