An LLM-Driven Ensemble Framework for Constructing Legal Knowledge Graphs from Legislative Corpora
Discuss this preprint
Start a discussion What are Sciety discussions?Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
This paper presents a scalable framework for building a knowledge graph from New Zealand's legislative acts and analysing it using formal graph theory methods. This work addresses the challenge of turning unstructured legal text into a structured format and analysing it as a graph. The full collection of over 18,000 Acts is used to design an LLM-driven extraction pipeline for constructing a semantic knowledge graph. The framework combines a multi-pass discovery phase with a full-context verification stage to identify legal entities and determine their relationships with high accuracy. The resulting graph serves as the foundation for further graph-theoretic analysis. Graph measures, specifically Leiden community detection and authority-weighted PageRank, reveal structural connections and legislative influence across the legal system. An LLM-based topic modelling approach is also employed to map the themes of the law and classify Acts according to parliamentary committee responsibilities. This framework provides a reproducible method to transform static text into a data-driven network, enabling new forms of legal research and policy evaluation at a national scale.