The repository contains the implementation of the method, experimental results, and related scripts. This work was published at the LLM+KG Workshop at VLDB 2024.
-
data/: Dataset used for experiments.ontology/: Contains the ODRL ontology file.odrl.ttl: The ODRL ontology file in Turtle format.
tasks/: Contains use case files used as experiments for testing the approach.
-
llm_guidance_template/: Contains PDF templates used to guide the LLM in generating ODRL knowledge graphs.templates/: Subdirectory containing the PDF templates.ODRL-Agreement_Generator_template.pdf: Template for generating ODRL Agreement policies.ODRL-Offer_Generator_Template.pdf: Template for generating ODRL Offer policies.ODRL_Rule_Generator_template.pdf: Template for generating ODRL Rule policies.
-
generated_odrl_from_ontology/: Contains the ODRL knowledge graphs generated directly from the ODRL ontology. -
generated_odrl_policy_from_template/: Contains the ODRL knowledge graphs generated from context and self-correction mechanisms. -
ODRL_policy_validation_shapes/: Contains shapes for validating ODRL rules, agreements, and offers. -
config.json: Configuration file containing settings for the scripts. -
constants.py: File containing constant variables used throughout the project. -
correction_report.py: Script containing correction rules applied for the self-correction mechanism. -
file_paths.py: File handling paths used by the scripts.
ODRL_From_Ontology.py: Script to generate ODRL knowledge graphs solely from the ontology and apply self-correction mechanisms.ODRL_Agreement_Gen.py: Script to generate agreement policies from context and apply self-correction mechanisms.ODRL_Offer_Gen.py: Script to generate offer policies from context and apply self-correction mechanisms.ODRL_Rule_Gen.py: Script to generate rule policies from context templates.shacl_odrl_validator.py: Script for SHACL validation of ODRL policies.
Before running the scripts, ensure that you have set up an Open API key and configured the config.json file with the appropriate settings.
- Set up the Open API key.
- Configure the
config.jsonfile with the necessary settings. - Run the desired script using Python, e.g.,
python ODRL_From_Ontology.py. - Follow the prompts and provide any required inputs.
-
🟡 Yellow Components (Parallelogram shape): Human-prepared inputs
- Task Description
- LLM Guidance Template
- Self-Correction Rules
-
🔵 Blue Components (Rectangle shape): Machine-generated outputs
- ODRL KG
- Refined ODRL Knowledge Graph
-
🔴 Red Component (Rectangle shape): Processing
- LLM Processing
-
🌸 Pink Box: ODRL Ontology
- ODRL-OWL Ontology
-
🌿 Green Box: OSES Insights
- Syntax Rules
- Semantic Insights
- Distilled Examples
- "domain requirements": Task description to LLM
- "guides validation": Task description to Self-Correction
- "guides generation": LGT to LLM
- "provides structure": Ontology to LGT
- "enriches template": OSES to LGT
- "generates": LLM to KG
- "inputs for correction": KG to SCM
- "refines": SCM to RKG
The workflow represents a novel methodology for generating ODRL policies using LLMs, combining human expertise with machine processing. It consists of three main phases: Input (human-prepared), Processing (machine), and Refinement (human-guided correction), resulting in a refined ODRL Knowledge Graph.
If you use this work in your research, please cite our paper:
@inproceedings{mustafa2024instructions,
title={From Instructions to ODRL Usage Policies: An Ontology Guided Approach},
author={Mustafa, Daham M. and Nadgeri, Abhishek and Collarana, Diego and Arnold, Benedikt T. and Quix, Christoph and Lange, Christoph and Decker, Stefan},
booktitle={Proceedings of the LLM+KG Workshop at VLDB},
year={2024},
url={https://vldb.org/workshops/2024/proceedings/LLM+KG/LLM+KG-15.pdf}
}- Daham M. Mustafa - Fraunhofer FIT, Sankt Augustin, Germany
- Abhishek Nadgeri - Fraunhofer FIT, Sankt Augustin, Germany
- Diego Collarana - Fraunhofer FIT, Sankt Augustin, Germany & Universidad Privada Boliviana, Cochabamba, Bolivia
- Benedikt T. Arnold - Fraunhofer FIT, Sankt Augustin, Germany & RWTH Aachen University, Aachen, Germany
- Christoph Quix - RWTH Aachen University, Aachen, Germany
- Christoph Lange - Fraunhofer FIT, Sankt Augustin, Germany & RWTH Aachen University, Aachen, Germany
- Stefan Decker - Fraunhofer FIT, Sankt Augustin, Germany & RWTH Aachen University, Aachen, Germany
- Workshop: LLM+KG Workshop at VLDB 2024