[Paper Review] Using Mapping Languages for Building Legal Knowledge Graphs from XML Files
This paper presents a semantic model for transforming German legal XML documents into RDF knowledge graphs using mapping languages, with a focus on improving search accuracy in legal information systems. It evaluates state-of-the-art mapping engines—particularly CARML with RML—showing that while performance is slightly slower than custom parsers for small datasets, mapping languages offer superior maintainability, reusability, and scalability for industrial legal knowledge graph pipelines.
This paper presents our experience on building RDF knowledge graphs for an industrial use case in the legal domain. The information contained in legal information systems are often accessed through simple keyword interfaces and presented as a simple list of hits. In order to improve search accuracy one may avail of knowledge graphs, where the semantics of the data can be made explicit. Significant research effort has been invested in the area of building knowledge graphs from semi-structured text documents, such as XML, with the prevailing approach being the use of mapping languages. In this paper, we present a semantic model for representing legal documents together with an industrial use case. We also present a set of use case requirements based on the proposed semantic model, which are used to compare and discuss the use of state-of-the-art mapping languages for building knowledge graphs for legal data.
Motivation & Objective
- Address the challenge of inefficient, keyword-based legal information retrieval by structuring legal data semantically.
- Develop a formal semantic model for legal documents to represent legal concepts, relationships, and taxonomy annotations explicitly.
- Enable the transformation of semi-structured legal XML data into machine-processable RDF knowledge graphs for enhanced reasoning and querying.
- Evaluate and compare state-of-the-art mapping engines based on industrial requirements derived from a real-world legal use case.
- Assess the trade-off between performance and maintainability when using mapping languages versus custom parsers in large-scale legal knowledge graph construction.
Proposed method
- Design a domain-specific semantic model for legal documents based on SKOS and RDF, modeling core elements such as tenor, tatbestand, and taxonomy concepts.
- Define a set of use case requirements derived from the semantic model and XML schema to evaluate mapping engines.
- Implement knowledge graph construction using RML (RDF Mapping Language) with the CARML engine, enabling declarative transformation of XML to RDF.
- Compare the performance of CARML (RML-based) with an ad hoc custom parser across three document scales: 1k, 10k, and 50k documents.
- Apply statistical testing (Welch Two Sample T-Test) to assess the significance of performance differences between mapping and custom parsing approaches.
- Leverage SKOS to represent legal taxonomy concepts and their hierarchical and associative relationships within the knowledge graph.
Experimental results
Research questions
- RQ1How can a formal semantic model be designed to represent legal documents and their relationships in a machine-processable way?
- RQ2Which state-of-the-art mapping engines support all the functional and structural requirements derived from a real-world legal XML schema and use case?
- RQ3What is the performance impact of using mapping languages (e.g., RML with CARML) versus custom parsers for transforming large volumes of legal XML into RDF?
- RQ4Is the performance overhead of using mapping languages statistically significant when processing industrial-scale legal document collections?
- RQ5To what extent do mapping languages improve maintainability and reusability compared to ad hoc parsers in evolving legal knowledge graph pipelines?
Key findings
- CARML, which implements the RML mapping language, was the only engine to support all the defined use case requirements, including complex nested structures and SKOS-based taxonomy handling.
- For 1k documents, the performance difference between CARML and the custom parser was not statistically significant (p-value = 0.12), indicating comparable efficiency at small scale.
- For 10k and 50k documents, the performance difference became statistically significant (p-values of 0.04 and 0.01, respectively), showing that mapping languages introduce measurable overhead at scale.
- Despite performance overhead, mapping languages are preferred due to their separation of logic and implementation, enabling easier maintenance and reuse when the schema or semantic model evolves.
- The use of declarative mappings allows for optimization and engine-agnostic execution, reducing long-term development and maintenance costs compared to custom parsers.
- The evaluation confirms that while mapping languages are slightly slower, their benefits in maintainability and extensibility outweigh performance penalties in industrial legal knowledge graph pipelines.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.