code: def title_from_rdf(rdf, url):
      '''
      Try to extract a distribution title from a property.
      As it's not a mandatory property,
      it fallback on building a title from the URL
      then the format and in last ressort a generic resource name.
      '''
      title = rdf_value(rdf, DCT.title)
      if title:
          return title
      if url:
          last_part = url.split('/')[-1]
          if '.' in last_part and '?' not in last_part:
              return last_part
      fmt = rdf_value(rdf, DCT.term('format'))
      lang = current_app.config['DEFAULT_LANGUAGE']
      with i18n.language(lang):
          if fmt:
              return i18n._('{format} resource').format(format=fmt.lower())
          else:
              return i18n._('Nameless resource'f title_from_rdf(rdf, url):
      '''
      Try to extract a distribution title from a property.
      As it's not a mandatory property,
      it fallback on building a title from the URL
      then the format and in last ressort a generic resource name.
      '''
      title = rdf_value(rdf, DCT.title)
      if title:
          return title
      if url:
          last_part = url.split('/')[-1]
          if '.' in last_part and '?' not in last_part:
              return last_part
      fmt = rdf_value(rdf, DCT.term('format'))
      lang = current_app.config['DEFAULT_LANGUAGE']
      with i18n.language(lang):
          if fmt:
              return i18n._('{format} resource').format(format=fmt.lower())
          else:
              return i18n._('Nameless resource')
docs: Try to extract a distribution title from a property.
      As it's not a mandatory property,
      it fallback on building a title from the URL
      then the format and in last ressort a generic resource name.