NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Automated Creation of the Legal Knowledge Graph Addressing Legislation on Violence Against Women: Resource, Methodology and Lessons Learned

Claudia dAmato, Giuseppe Rubini, Francesco Didio, Donato Francioso, Fatima Zahra Amara, Nicola FanizziarXiv 2025

TL;DR

This paper introduces the first legal Knowledge Graph (KG) specifically targeting legislation and judicial cases of violence against women, derived from European Court of Human Rights (ECHR) jurisprudence. The authors develop and compare two distinct automation methodologies—a highly precise, structured bottom-up pipeline and a scalable, flexible Large Language Model (LLM) approach—highlighting their trade-offs in accuracy, scalability, and engineering effort.

What Problem Does This Paper Address?

Legal decision-making and predictive justice require quick access to structured, comprehensive legislative data and case law. However, the legal domain suffers from a severe shortage of Knowledge Graphs (KGs) due to the intricate, nuanced writing style of laws and court sentences, which makes data integration difficult.

The authors address this gap by focusing on the critical and urgent domain of violence against women. By structuring unstructured court rulings into a queryable, semantic format, they aim to create a resource that assists legal experts in case analysis, policy formulation, and training predictive machine learning models.

Methods

The authors contrast two distinct paradigms for legal KG construction:

  1. Bottom-Up Approach: A systematic, custom pipeline that extracts data from ECHR HTML files using Selenium and Beautiful Soup. It maps entities (like defendant states) to Wikidata URIs and generates standard RDF triples using the RDFLib library. The ontology is manually curated based on expert-defined Competency Questions (CQs) to ensure strict domain alignment.
  2. LLM-Based Approach: A pipeline leveraging GPT-4.o (for base ontology creation) and Mixtral 8x22b, combined with Retrieval-Augmented Generation (RAG) using LangChain, BERT-M2 embeddings, and a FAISS vector database. The authors test two input strategies here: feeding the full text of the judgment versus feeding expert-selected sub-parts.

A traditional NLP pipeline (using NLTK and SpaCy for POS tagging and subject-verb-object triple extraction) was also utilized to evaluate and compare against the LLM outputs.

Fig. 1. The adopted pipeline.

Datasets

The primary dataset consists of 73 judgments and decisions (65 judgments, 8 decisions) in English, carefully selected by international law experts from the ECHR public database. The resulting KG has been published openly as the PREJUST4WOMAN dataset on the LOD (Linked Open Data) cloud, adhering strictly to FAIR (Findable, Accessible, Interoperable, Reusable) data principles.

Key Insights and Ideas

  • Precision vs. Scalability Trade-off: The bottom-up approach delivers flawless semantic precision and strict adherence to domain standards but is highly labor-intensive and slow. Conversely, the LLM approach is fast and highly scalable but suffers from accuracy issues like hallucinations.
  • The "Sub-part" LLM Strategy: When prompting LLMs, feeding them expert-selected text segments (sub-parts) rather than the full text reduces processing time and token constraints. While it yields fewer total responses, the answers are significantly more focused, accurate, and aligned with expert objectives for factual or procedural queries.
  • Ontology Limitations of LLMs: Pretrained LLMs struggle to independently generate complete, nuanced, domain-specific ontologies. They require explicit domain-specific documents for specialization and rigorous human oversight to prune superfluous or redundant elements.

Key Results

  • Bottom-Up KG: Successfully extracted 10,325 triples, comprising 22 distinct predicates and 5,185 distinct entities from the 73 ECHR documents. New legal concepts like DomesticLaw, InternationalLaw, and StrasbourgCaseLaw were formalized.
  • LLM Evaluation: Evaluated using 13 Competency Questions across 5 documents (65 total queries). The full-text strategy achieved a 61.5% accuracy rate (40/65 consistent answers), while the sub-part strategy achieved 56.9% (37/65), proving that full-text provides broader coverage but sub-parts offer higher precision for specific tasks.
Fig. 2. Part of Knowledge Graph Constructed Using a Bottom-Up Approach.

Limitations and Future Work

The primary limitation of the automated LLM approach is its inconsistency and tendency to generate incomplete entities or hallucinations, mandating extensive manual verification. Additionally, the bottom-up approach scales poorly due to its reliance on manual data curation and predefined ontologies.

Moving forward, the authors plan to merge the two generated KGs into a single, unified resource. They also intend to extend these methodologies to other legal domains to demonstrate generality and leverage the resulting KGs for predictive justice applications, such as treating sentence prediction as a link prediction problem.

Summary updated

BibTeX
@misc{damato2025automated,
  author = {Claudia dAmato and Giuseppe Rubini and Francesco Didio and Donato Francioso and Fatima Zahra Amara and Nicola Fanizzi},
  title = {{Automated Creation of the Legal Knowledge Graph Addressing Legislation on Violence Against Women: Resource, Methodology and Lessons Learned}},
  year = {2025},
  eprint = {2508.06368},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.06368},
}
Figure