code: def sortProperties(self, properties):
          for prop, objects in properties.items():
              objects.sort(key=self._globalSortKey)
          return sorted(properties, key=lambda p: self.predicate_rank[p])