function extractEntities(sourceArticle) {
  // Each article image is supposed to be a unique asset
  const fileName = sourceArticle.image.url.match(/[^/]+$/)[0]
  const asset = {
    sys: { id: `image${sourceArticle.articleNumber}` },
    fields: {
      title: { [locale]: fileName },
      description: { [locale]: sourceArticle.title },
      file: {
        [locale]: {
          upload: sourceArticle.image.url,
          fileName,
          contentType: `image/jpeg`,
        },
      },
    },
  }

  const article = {
    sys: { id: `article${sourceArticle.articleNumber}` },
    fields: {
      title: { [locale]: sourceArticle.title },
      body: { [locale]: sourceArticle.content },
      slug: { [locale]: `article${sourceArticle.articleNumber}` },
      image: {
        [locale]: {
          sys: {
            type: `Link`,
            linkType: `Asset`,
            id: asset.sys.id,
          },
        },
      },
    },
  }

  return { article, asset }
}
Transforms an article from source dataset to contentful data model