policy-library
Description
The DATAMITE Policy Library is a FastAPI-based service that provides a comprehensive API for managing ODRL (Open Digital Rights Language) compliant policies. It offers a structured approach to creating, managing, and enforcing digital rights and permissions in applications. The Policy Library is developed and managed by 1001LAKES.
Role in the DATAMITE Framework

DATAMITE Policy Management Flow
The Policy Library is used by the DATAMITE Frontend to create ODRL policies as part of the data product creation and publication process for EDC. Users can configure their policies by restricting usage of their data product based on time, location and/or purpose of use. This is achieved by sending user-given parameters from the Frontend to the Policy Library API, where these parameters are used to render the final policy. This policy is then sent by the Frontend to the EDC Management API, through which e.g. the Policy Engine can access the policies for evaluation.

Architecture
The Policy Library API consists of the following components:
FastAPI Application Layer
The FastAPI application layer provides:
- RESTful API endpoints
- Request/response handling
- Input validation
- API documentation (via OpenAPI/Swagger)
Policy Creation Interface
The policy creation interface provides:
- Policy creation from templates
- Policy parameter validation
- ODRL-compliant policy structure
- Policy composition support
Data Models
The data models define the structure for:
- Policy templates
- ODRL policy elements (Permissions, Prohibitions, Duties)
- Constraint parameters
Installation and usage
For the containerised version, you can simply run docker-compose up
in the project root, or build and run the image yourself from the Dockerfile.
Another alternative is to create your own virtual environment and install all dependencies in requirements.txt. After this, the API acn be run with python api/main.py
.
Support
- Joel Himanen (repository owner), joel.himanen@1001lakes.com
License
This component is provided under the terms of the MIT License.