From Instructions to ODRL Usage Policies: An Ontology Guided Approach

Daham M. Mustafa, Abhishek Nadgeri, Diego Collarana, Benedikt T. Arnold, Christoph Quix, Christoph Lange, Stefan Decker · DOI

Abstract

This paper presents an automated pipeline leveraging Large Language Models (LLMs) to translate natural language instructions into formal Open Digital Rights Language (ODRL) usage policies. By integrating distilled ontology documentation with a rule-based self-correction mechanism, the proposed approach achieves up to 91.95% accuracy in generating valid knowledge graphs for digital rights management.

Introduction

The expansion of the "data economy" has led to the development of dataspaces—distributed infrastructures like Gaia-X or IDSA—where organizations share data while maintaining sovereignty. A critical component of these systems is the definition of usage policies: determining who can access data, for how long, and under what constraints.

The industry standard for these policies is ODRL, a language based on Semantic Web technologies (RDF). However, ODRL presents a significant entry barrier. Creating a valid policy requires expertise in RDF triples, specific serializations, and complex vocabularies. This technical overhead often prevents domain experts, such as museum curators or factory managers, from defining data usage terms effectively.

Methodology

To bridge this gap, we propose an Ontology-Guided Approach that structures the interaction with LLMs into a multi-stage pipeline.

The proposed multi-stage pipeline for ODRL Knowledge Graph construction, featuring the LLM Guidance Template and Self-Correction Model.

The pipeline consists of four primary components:

  1. LLM Guidance Template (LGT): Instead of raw ontology files, we provide "distilled" plain-text guidelines called OSES Insights (Ontology, Syntax, Semantics, and Examples). This reduces noise and clarifies how classes and properties should be aligned.
  2. Task Description (TD): The natural language instruction (e.g., "Painting X from Museum M is authorized for display within Germany") is paired with the LGT.
  3. Self-Correction Model (SCM): To mitigate hallucinations, a second stage reviews the generated Knowledge Graph (KG) against human-readable Self-Correction Rules (SCR) derived from the ODRL standard.
  4. Validation via SHACL: The final output undergoes validation using Shapes Constraint Language (SHACL) to ensure syntactic and semantic integrity.

Experimental Setup

The approach was evaluated using a benchmark dataset inspired by the Datenraum Kultur (DRK) project. The benchmark includes 12 realistic use cases of increasing complexity, covering 4 Agreements, 5 Offers, and 3 Sets. These cases involve diverse constraints, including geographic restrictions, temporal expirations, and specific subscriber roles.

Results

The study compared the performance of GPT-3.5-turbo, GPT-4, and GPT-4o across the benchmark.

Performance comparison of GPT-3.5, GPT-4, and GPT-4o across 12 use cases, demonstrating the impact of the Refinement stage.

Key findings include:

  • Model Superiority: GPT-4 and GPT-4o significantly outperformed GPT-3.5, demonstrating a superior grasp of the complex relational logic required for ODRL.
  • High Accuracy: The system achieved a peak accuracy of 91.95% in knowledge graph construction for complex use cases.
  • The Refinement Boost: The "Refinement" method, utilizing the SCM, consistently yielded the highest scores across all 12 use cases, highlighting the necessity of a self-correction loop for production-grade outputs.

Discussion

Our research highlights several critical insights for LLM-based KG construction. First, raw ontologies are often too "noisy" for LLMs; distilling them into human-readable guidelines is essential for performance. Second, because LLMs are stateless, simple error feedback is often insufficient. A structured, rule-based correction prompt is more effective than iterative chatting. Finally, the approach successfully balances syntactic correctness with semantic intent, ensuring policies accurately reflect the user's original instructions.

Conclusion and Future Work

While the current framework is highly effective, it relies on manual distillation of guidelines and correction rules. Future work will focus on automating this distillation process through statistical analysis of existing knowledge graphs. Additionally, we aim to test the framework's generalizability across other complex domains, such as medical or legal ontologies.

Summary updated

BibTeX
@inproceedings{mustafa2024from,
  author = {Daham M. Mustafa and Abhishek Nadgeri and Diego Collarana and Benedikt T. Arnold and Christoph Quix and Christoph Lange and Stefan Decker},
  title = {{From Instructions to ODRL Usage Policies: An Ontology Guided Approach}},
  booktitle = {Workshops @ VLDB},
  year = {2024},
}
Figure