This paper presents a new approach to text-to-knowledge graph conversion using large language models. Extracting, updating, and maintaining structured rulebases and ontologies from natural language text has been a labor-intensive process. While Large Language Models (LLMs) have increased the accessibility of automated extraction, they introduce significant risks regarding accuracy and logical consistency. This paper proposes a pipeline that improves accuracy and logical consistency in the automated extraction and validation of rule ontologies for legal reasoning, a domain where quality is paramount. To improve the correctness of the generated ontology, it is continuously evaluated using methods such as language syntax checkers and competency questions, so to ensure the integrity of the resulting knowledge graph. Preliminary results discuss the efficacy of these methods and their broader implications for automating legal rule modelling in highly regulated environments. The worked example applies to traffic regulations for Autonomous Vehicles (AVs). Our approach leverages the natural language understanding of LLMs to formalise legal norms as an OWL ontology, utilizing class restrictions to define Compliant and Non-Compliant behaviour. The paper presents the different methods used in the pipeline as well as the translation and validation phases. We discuss how the ontology could be used in the legal domain.

Using LLMs to Develop Legal Rule Ontologies for Compliance Checking

Enrico Francesconi;
2026

Abstract

This paper presents a new approach to text-to-knowledge graph conversion using large language models. Extracting, updating, and maintaining structured rulebases and ontologies from natural language text has been a labor-intensive process. While Large Language Models (LLMs) have increased the accessibility of automated extraction, they introduce significant risks regarding accuracy and logical consistency. This paper proposes a pipeline that improves accuracy and logical consistency in the automated extraction and validation of rule ontologies for legal reasoning, a domain where quality is paramount. To improve the correctness of the generated ontology, it is continuously evaluated using methods such as language syntax checkers and competency questions, so to ensure the integrity of the resulting knowledge graph. Preliminary results discuss the efficacy of these methods and their broader implications for automating legal rule modelling in highly regulated environments. The worked example applies to traffic regulations for Autonomous Vehicles (AVs). Our approach leverages the natural language understanding of LLMs to formalise legal norms as an OWL ontology, utilizing class restrictions to define Compliant and Non-Compliant behaviour. The paper presents the different methods used in the pipeline as well as the translation and validation phases. We discuss how the ontology could be used in the legal domain.
2026
Istituto di Informatica Giuridica e Sistemi Giudiziari - IGSG
Legal Reasoning, Semantic Web, OWL, Norm Compliance, Large Language Models, Autonomous Systems
File in questo prodotto:
File Dimensione Formato  
Text2KG_Paper_ID_10.pdf

accesso aperto

Tipologia: Versione Editoriale (PDF)
Licenza: Creative commons
Dimensione 470.81 kB
Formato Adobe PDF
470.81 kB Adobe PDF Visualizza/Apri

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/20.500.14243/609271
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus ND
  • ???jsp.display-item.citation.isi??? ND
social impact