docs: def _extract_resources(elem):
          """Extract the children of an element as a key/value mapping.
          """
          resources = collections.defaultdict(list)
          for child in itertools.islice(elem.iter(), 1, None):
              try:
                  basename = child.tag.split('}', 1)[-1]
                  if child.text is not None:
                      child.text = child.text.strip()
                  if child.text:
                      resources[basename].append(child.text)
                  elif child.get(RDF_RESOURCE) is not None:
                      resources[basename].append(child.get(RDF_RESOURCE))
              except AttributeError:
                  pass
          return dict(resources)