LegislationObject
LegislationObject dual-inherits from Legislation and MediaObject. It represents a specific file or object embodying a piece of legislation — the PDF of an Act, the authoritative HTML rendering, the XML consolidated version.
1 direct property:
legislationLegalValue(LegalValueLevel): the legal value of the file. Values:AuthoritativeLegalValue,DefinitiveLegalValue,OfficialLegalValue,UnofficialLegalValue.
The same Legislation can have multiple LegislationObject entries (PDF + HTML + XML, in multiple languages). Each file carries its own legalValue — the authoritative XML may be the binding version, while an HTML rendering is unofficial.
Full example of schema.org/LegislationObject json-ld markup
The markup is verified as valid with Rich Results Test from Google.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "LegislationObject",
"name": "Dunmora Data Protection Act 2025 — Official PDF",
"contentUrl": "https://laws.dunmora.example/acts/2025/dpa-2025.pdf",
"encodingFormat": "application/pdf",
"inLanguage": "en",
"legislationLegalValue": "https://schema.org/OfficialLegalValue",
"legislationDate": "2025-06-15",
"legislationPassedBy": { "@type": "GovernmentOrganization", "name": "Royal Parliament of Dunmora" }
},
{
"@type": "LegislationObject",
"name": "Dunmora Data Protection Act 2025 — Consolidated HTML (unofficial)",
"contentUrl": "https://laws.dunmora.example/acts/2025/dpa-2025.html",
"encodingFormat": "text/html",
"inLanguage": "en",
"legislationLegalValue": "https://schema.org/UnofficialLegalValue"
}
]
}
</script>Minimal valid version
The smallest markup that still produces a valid LegislationObject entity. Use it as the floor. Reach for the advanced example above when you want search engines and AI agents to understand more about your content.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "LegislationObject",
"name": "Data Protection Act 2025 (PDF)",
"contentUrl": "https://laws.dunmora.example/acts/2025/dpa-2025.pdf",
"legislationLegalValue": "https://schema.org/OfficialLegalValue"
}
</script>Google rich results this unlocks
Markup matching this example makes your page eligible for the following Google Search rich results. The primary target drives the required / recommended property classification in the advanced code block above.
- Google docsNo dedicated rich result (legal knowledge graphs, government portals)
Common LegislationObject mistakes
Mistakes that pass validation but silently fail to earn rich results or mislead consumers walking the graph. Avoid these and your markup will be ahead of most sites in the wild.
- 01
Single LegislationObject for multiple formats
WrongOne entry pointing to both PDF and HTMLRightSeparate LegislationObject per file, each with its own legislationLegalValueLegal value is per-file; one entity can only carry one value honestly.
- 02
Missing legislationLegalValue
WrongLegislationObject without the legal-value signalRightAlways populate legislationLegalValueThe type exists specifically to express legal value; without it, plain MediaObject would do.
Schema properties in this example
About the example data
The fictional Dunmora Data Protection Act 2025 published as an official PDF and an unofficial HTML consolidated version.
Comments
Loading comments...