# catenax-ev/cx-odrl-profile architecture

> Architecture diagram of the GitHub repository catenax-ev/cx-odrl-profile, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/catenax-ev/cx-odrl-profile
- Repository: https://github.com/catenax-ev/cx-odrl-profile

## Overview

This repository defines the Catena-X ODRL policy profile: machine-readable contractual terms and constraints for data-sharing agreements. The principal workflow is to define policy terms and constraints, express policies using the profile’s schemas and JSON-LD context, then use them in Dataspace Protocol negotiations. The repository also provides examples and a generated human-readable profile. The generator’s inputs and output are visible in its source; other subsystem links below are based on README descriptions, not inspected schema contents.

Main entry points: [`generate.py`](https://github.com/catenax-ev/cx-odrl-profile/blob/main/generate.py) (Profile generator), [`profile.ttl`](https://github.com/catenax-ev/cx-odrl-profile/blob/main/profile.ttl) (ODRL terms), [`schema/policy-schema.json`](https://github.com/catenax-ev/cx-odrl-profile/blob/main/schema/policy-schema.json) (Policy schema), [`schema/constraint`](https://github.com/catenax-ev/cx-odrl-profile/tree/main/schema/constraint) (Constraint schemas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_profile["Policy profile"]
  node_terms["ODRL terms<br/>[profile.ttl]"]
  node_generator["Profile generator<br/>[generate.py]"]
  node_template["Markdown template"]
  node_readable["Human-readable profile<br/>[profile.md]"]
end

subgraph group_schemas["Policy schemas"]
  node_policy_schema["Policy schema<br/>[policy-schema.json]"]
  node_constraint_schemas["Constraint schemas"]
  node_atomic_schema["Atomic constraint schema"]
  node_context["JSON-LD context"]
end

subgraph group_reference["Examples and reference"]
  node_policy_examples["Policy examples"]
  node_example_policy["Example policy"]
  node_expanded_policy["Expanded example"]
end

node_author(("Profile author"))
node_participants(("Dataspace participants"))
node_negotiation{{"DSP negotiation"}}

node_author -->|"defines terms"| node_terms
node_generator -->|"reads profile"| node_terms
node_generator -->|"renders template"| node_template
node_generator -->|"writes output"| node_readable
node_participants -->|"negotiate agreements"| node_negotiation
node_policy_schema -->|"defines policy format"| node_negotiation
node_constraint_schemas -->|"define constraints"| node_negotiation
node_atomic_schema -->|"defines constraint structure"| node_negotiation
node_context -->|"provides JSON-LD context"| node_negotiation
node_policy_examples -->|"illustrate policies"| node_participants
node_example_policy -->|"expands to"| node_expanded_policy

click node_terms "https://github.com/catenax-ev/cx-odrl-profile/blob/main/profile.ttl"
click node_generator "https://github.com/catenax-ev/cx-odrl-profile/blob/main/generate.py"
click node_template "https://github.com/catenax-ev/cx-odrl-profile/blob/main/profile_template.md"
click node_readable "https://github.com/catenax-ev/cx-odrl-profile/blob/main/profile.md"
click node_policy_schema "https://github.com/catenax-ev/cx-odrl-profile/blob/main/schema/policy-schema.json"
click node_constraint_schemas "https://github.com/catenax-ev/cx-odrl-profile/tree/main/schema/constraint"
click node_atomic_schema "https://github.com/catenax-ev/cx-odrl-profile/blob/main/schema/atomic-constraint-schemas.json"
click node_context "https://github.com/catenax-ev/cx-odrl-profile/tree/main/schema/context"
click node_policy_examples "https://github.com/catenax-ev/cx-odrl-profile/tree/main/schema/samples"
click node_example_policy "https://github.com/catenax-ev/cx-odrl-profile/blob/main/example_usage_policy.json"
click node_expanded_policy "https://github.com/catenax-ev/cx-odrl-profile/blob/main/example_usage_policy_expanded.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_terms,node_generator,node_template,node_readable toneBlue
class node_policy_schema,node_constraint_schemas,node_atomic_schema,node_context toneAmber
class node_policy_examples,node_example_policy,node_expanded_policy toneMint
class node_author,node_participants,node_negotiation toneIndigo
```

## Components

### Policy profile

- [ODRL terms](https://github.com/catenax-ev/cx-odrl-profile/blob/main/profile.ttl): `profile.ttl`
- [Profile generator](https://github.com/catenax-ev/cx-odrl-profile/blob/main/generate.py): `generate.py`
- [Markdown template](https://github.com/catenax-ev/cx-odrl-profile/blob/main/profile_template.md): `profile_template.md`
- [Human-readable profile](https://github.com/catenax-ev/cx-odrl-profile/blob/main/profile.md): `profile.md`

### Policy schemas

- [Policy schema](https://github.com/catenax-ev/cx-odrl-profile/blob/main/schema/policy-schema.json): `schema/policy-schema.json`
- [Constraint schemas](https://github.com/catenax-ev/cx-odrl-profile/tree/main/schema/constraint): `schema/constraint`
- [Atomic constraint schema](https://github.com/catenax-ev/cx-odrl-profile/blob/main/schema/atomic-constraint-schemas.json): `schema/atomic-constraint-schemas.json`
- [JSON-LD context](https://github.com/catenax-ev/cx-odrl-profile/tree/main/schema/context): `schema/context`

### Examples and reference

- [Policy examples](https://github.com/catenax-ev/cx-odrl-profile/tree/main/schema/samples): `schema/samples`
- [Example policy](https://github.com/catenax-ev/cx-odrl-profile/blob/main/example_usage_policy.json): `example_usage_policy.json`
- [Expanded example](https://github.com/catenax-ev/cx-odrl-profile/blob/main/example_usage_policy_expanded.json): `example_usage_policy_expanded.json`

### Other components

- **Profile author**
- **Dataspace participants**
- **DSP negotiation**

## Connections

- Profile author → ODRL terms: defines terms (evidence: `Readme.md`)
- Profile generator → ODRL terms: reads profile (evidence: `generate.py`)
- Profile generator → Markdown template: renders template (evidence: `generate.py`)
- Profile generator → Human-readable profile: writes output (evidence: `generate.py`)
- Dataspace participants → DSP negotiation: negotiate agreements (evidence: `Readme.md`)
- Policy schema → DSP negotiation: defines policy format (evidence: `Readme.md`)
- Constraint schemas → DSP negotiation: define constraints (evidence: `Readme.md`)
- Atomic constraint schema → DSP negotiation: defines constraint structure (evidence: `Readme.md`)
- JSON-LD context → DSP negotiation: provides JSON-LD context (evidence: `Readme.md`)
- Policy examples → Dataspace participants: illustrate policies (evidence: `Readme.md`)
- Example policy → Expanded example: expands to (evidence: `Readme.md`)
