tna-legislation

Retrieve UK legislation as Linked Data via content negotiation and RDF serialization.

1|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/danbri/forgetmenot --skill tna-legislation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tna-legislation
Source: https://github.com/danbri/forgetmenot/tree/main/skills/tna-legislation
Command: npx skills add https://github.com/danbri/forgetmenot --skill tna-legislation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires rdflib, and includes scripts (resource) components.

What problem does it solve?

This skill solves the difficulty of programmatically accessing, validating, and querying the official UK statute book, which is often locked behind complex content negotiation or restricted SPARQL endpoints.

Core Features & Use Cases

  • Linked Data Retrieval: Fetch Acts of Parliament, Statutory Instruments, and devolved legislation as RDF/XML or Turtle.
  • Local SPARQL Materialization: Create a local, searchable SPARQL endpoint from a collection of fetched legislation slices to bypass invitation-only restrictions.
  • Validation: Use ShEx shapes to ensure the integrity and structure of retrieved legal data.
  • Use Case: A researcher needs to analyze all amendments to a specific Act of Parliament; this skill allows them to fetch the relevant RDF, materialize it locally, and run SPARQL queries to map the legislative history.

Quick Start

Use the tna-legislation skill to fetch the Leasehold and Freehold Reform Act 2024 as RDF data by running the provided fetch script with the appropriate legislative slug.

Frequently Asked Questions about tna-legislation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I retrieve UK legislation as linked data using content negotiation?

You can fetch UK legislation as linked data by using content negotiation to retrieve RDF/XML or Turtle serializations from The National Archives. The skill automates discovery via Atom feeds and parses the results using rdflib.

How do I run SPARQL queries across multiple UK statutes locally?

You can run cross-Act SPARQL queries by materializing fetched RDF/XML slices into a local SPARQL endpoint. This bypasses remote access restrictions and allows complex cross-Act analysis using rdflib.

Do I need rdflib to parse UK statute RDF data?

Yes, rdflib is required to parse UK statute RDF data and handle RDF/XML parsing alongside Turtle conversion for local data modeling. Python 3 is also required to run the provided processing scripts.

Can I validate the structure of retrieved UK legal data?

Yes, you can validate the structure of retrieved UK legal data by applying ShEx shapes to the fetched RDF. This ensures the integrity of the legislative data before materializing it locally for SPARQL querying.

What is the best way to analyze legislative amendment history for a specific UK Act?

The best way to analyze legislative amendment history is to fetch the Act's RDF data, materialize it locally, and run SPARQL queries to map the legislative changes. This avoids restricted remote endpoints and enables comprehensive cross-Act analysis.

Why does querying UK legislation data fail against remote SPARQL endpoints?

Querying remote SPARQL endpoints for UK legislation often fails due to invitation-only access restrictions. Materializing fetched RDF data locally creates an unrestricted searchable endpoint, bypassing these remote limitations for cross-Act analysis.