This paper investigates the feasibility of representing the Italian Criminal Code as a graph knowledge base and of using Artificial Intelligence (AI), particularly Large Language Models (LLMs), to query this structure. We propose a Directed Acyclic Graph (DAG) where the nodes correspond to the structural elements of the code (Book, Title, Article, Comma), and the edges encode both hierarchical and selected semantic relationships, such as textual references and dependencies. Nodes and edges are enriched with properties that link them back to the text and record identifiers, as well as temporal information and provenance metadata. Treating this graph as a knowledge base enables a range of graph-theoretic operations to be interpreted as legal tasks such as structural navigation, dependency analysis, and localised impact assessment of legislative changes. We outline how LLMs can be used on top of this representation to support natural-language querying, semantically enriched search, and comparative analysis between provisions. In this design, LLMs act as an interface layer that translates natural-language queries into formal graph queries and translates graph-structured results back into explanations. All retrieval and dependency computation are performed by exact algorithms on the DAG. This proposal does not focus on devising a methodology to substitute the human expert. Indeed, a Human-in-the-Loop approach is crucial: the human legal expert can either accept, modify, or reject the response proposed by the AI system.
Graph-Based Modelling of the Italian Criminal Code as a Knowledge Base for AI-Assisted Inference
Nicola Deidda
;Giorgio Fumera;Giorgio Giacinto;
2026-01-01
Abstract
This paper investigates the feasibility of representing the Italian Criminal Code as a graph knowledge base and of using Artificial Intelligence (AI), particularly Large Language Models (LLMs), to query this structure. We propose a Directed Acyclic Graph (DAG) where the nodes correspond to the structural elements of the code (Book, Title, Article, Comma), and the edges encode both hierarchical and selected semantic relationships, such as textual references and dependencies. Nodes and edges are enriched with properties that link them back to the text and record identifiers, as well as temporal information and provenance metadata. Treating this graph as a knowledge base enables a range of graph-theoretic operations to be interpreted as legal tasks such as structural navigation, dependency analysis, and localised impact assessment of legislative changes. We outline how LLMs can be used on top of this representation to support natural-language querying, semantically enriched search, and comparative analysis between provisions. In this design, LLMs act as an interface layer that translates natural-language queries into formal graph queries and translates graph-structured results back into explanations. All retrieval and dependency computation are performed by exact algorithms on the DAG. This proposal does not focus on devising a methodology to substitute the human expert. Indeed, a Human-in-the-Loop approach is crucial: the human legal expert can either accept, modify, or reject the response proposed by the AI system.| File | Dimensione | Formato | |
|---|---|---|---|
|
paper45.pdf
accesso aperto
Tipologia:
versione editoriale (VoR)
Dimensione
1.12 MB
Formato
Adobe PDF
|
1.12 MB | Adobe PDF | Visualizza/Apri |
I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.


