Machine readable metadata example
Dataset schema with attachments
How it looks (preview)
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Dataset",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://www.gov.ukgovernment/statistical-data-sets/hogwarts-data"
},
"name": "All the data about Hogwarts",
"datePublished": null,
"dateModified": null,
"text": null,
"publisher": {
"@type": "Organization",
"name": "GOV.UK",
"url": "https://www.gov.uk",
"logo": {
"@type": "ImageObject",
"url": "https://govuk-collections.herokuapp.com/assets/collections/govuk_publishing_components/govuk-logo-b8553f688131fad665e52a8c2df7633f9cd1c0fffb9f69703cc68c728e7b3b74.png"
}
},
"image": [
"https://govuk-collections.herokuapp.com/assets/collections/govuk_publishing_components/govuk-schema-placeholder-1x1-2672c0fb7a5d5f947d880522c509ebe7f2be090885883cc94418f6860e812e15.png",
"https://govuk-collections.herokuapp.com/assets/collections/govuk_publishing_components/govuk-schema-placeholder-4x3-194fde4197f00e669f6f52c182df2ed707bfb2024c9ef39f7a2ed20da62b90eb.png",
"https://govuk-collections.herokuapp.com/assets/collections/govuk_publishing_components/govuk-schema-placeholder-16x9-30e6c0e035636ee6b9dc72ae254bcd4a925182805afe7c5b7170cf2394894b28.png"
],
"distribution": [
{
"name": "List of headmasters",
"contentUrl": "https://assets.publishing.service.gov.uk/hogwarts-data/headmasters.csv",
"encodingFormat": "text/csv"
},
{
"name": "Houses of Hogwarts",
"url": "https://www.gov.uk/government/statistical-data-sets/hogwarts-data/houses"
},
{
"name": "Dungeon cleaning shedule",
"url": "https://hogwarts.gov.uk/datasets/dungeon-cleaning-schedule"
}
]
}
</script>
<link rel="canonical" href="https://www.gov.ukgovernment/statistical-data-sets/hogwarts-data" />
<meta property="og:site_name" content="GOV.UK" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://www.gov.ukgovernment/statistical-data-sets/hogwarts-data" />
<meta property="og:title" content="All the data about Hogwarts" />
<meta property="og:description" content="" />
<meta name="twitter:card" content="summary" />
How to call this example
<%= render "govuk_publishing_components/components/machine_readable_metadata", {
content_item: {
title: "All the data about Hogwarts",
base_path: "government/statistical-data-sets/hogwarts-data",
details: {
attachments: [
{
attachment_type: "file",
url: "https://assets.publishing.service.gov.uk/hogwarts-data/headmasters.csv",
title: "List of headmasters",
content_type: "text/csv",
id: "headmasters.csv"
},
{
attachment_type: "html",
url: "https://www.gov.uk/government/statistical-data-sets/hogwarts-data/houses",
title: "Houses of Hogwarts",
id: "houses"
},
{
attachment_type: "external",
url: "https://hogwarts.gov.uk/datasets/dungeon-cleaning-schedule",
title: "Dungeon cleaning shedule",
id: "dungeon-cleaning-schedule"
}
]
}
},
schema: "dataset"
} %>