code: def expandServices(service_elements):
      
      expanded = []
      for service_element in service_elements:
          expanded.extend(expandService(service_element))
  
      return expanded
docs: Take a sorted iterator of service elements and expand it into a
      sorted iterator of:
      ([type_uri], uri, service_element)
  
      There may be more than one item in the resulting list for each
      service element if there is more than one URI or type for a
      service, but each triple will be unique.
  
      If there is no URI or Type for a Service element, it will not
      appear in the result.