Skip to content

feat: use ODRL policy for authorisation configuration#41

Merged
mirdono merged 9 commits into
developmentfrom
feat/odrl-policy-for-authz-sparql-parser
Apr 13, 2026
Merged

feat: use ODRL policy for authorisation configuration#41
mirdono merged 9 commits into
developmentfrom
feat/odrl-policy-for-authz-sparql-parser

Conversation

@mirdono
Copy link
Copy Markdown
Member

@mirdono mirdono commented Jan 26, 2026

Use an ODRL authorisation policy as configuration for sparql-parser. With support for ODRL configuration being added to sparql-parser we no longer need the odrl-parser-service to translate an ODRL policy to sparql-parser's lisp ACL.

  • Update the app's database service configuration to use ODRL as implemented in sparql-parser using builds from a feature-branch.
  • Remove the odrl-parser service and its configuration.
  • Remove the project script to convert ttl files to n-triples files.

How to test

Running the app with ODRL configuration

  1. Checkout the branch for this PR.
  2. Pull the feature build for the database service: docker compose pull database
  3. (Re)Up database service using docker compose up -d database, or start the app's stack as usual if not yet running.
  4. The database service logs should now contain the following lines indicating it read its configuration from the ttl file.
database-1  |  >> Loading configuration via ODRL
database-1  |  >> INFO: Reading ODRL policy from ../config/config.ttl
  1. The app should work the same as before.

Understanding and modifying the ODRL policy

As part of this feature sparql-parser's README has been extended with a how-to guide for ODRL policies. Feedback can be provided as part of PR #12 for sparql-parser.

Check policy equivalence

To double-check that the ODRL policy and the original lisp configuration are equivalent. The policy update commit contains both the original lisp config config/authorization/decide.lisp and the one generated from the ttl file config/odrl-parser/decideAuthorizationPolicy.lisp. You can check out this commit and compare the files, but take into consideration things:

  • The order of the elements in these two files differ, they cannot be simply compared line by line.
  • The generated decideAuthorizationPolicy config defines more (unnecessary) prefixes as the odrl-parser-service simply adds all prefixes it knows to the output it generates.

Note, the commit message of the mentioned commit also contains instructions on how to (re)generate the decideAuthorizationPolicy.lisp file yourself. If you checked out that commit you should be able to follow them as is. Otherwise, you will have to re-add the odrl-parser-service and ttl-to-ntriples conversion script to your local stack as these are removed by a subsequent commit.

TODO

Before merging and deploying, also do the following:

  • Ensure ODRL policy matches most recent lisp authorisation configuration. (Updated until commit)
  • Add comment to lisp configuration warning that is it not used anymore, or remove the file from the repository. (Or remove lisp configuration altogether.)
  • Ensure a feature-branch build is available for sparql-parser, alternatively use a locally build image. Uses feature branch
  • Archive the odrl-parser-service as this is no longer needed and will not be actively maintained.

Related tickets

  • LBRON-719
  • LBRON-485
  • LBRON-1060

@mirdono mirdono force-pushed the feat/odrl-policy-for-authz-sparql-parser branch from 1e6f2d6 to fb4b3c7 Compare January 26, 2026 13:28
@mirdono mirdono self-assigned this Jan 26, 2026
@mirdono mirdono added the enhancement New feature or request label Jan 26, 2026
@mirdono mirdono force-pushed the feat/odrl-policy-for-authz-sparql-parser branch from fb4b3c7 to f0fc8a7 Compare February 5, 2026 18:27
@mirdono mirdono marked this pull request as draft February 13, 2026 08:03
@mirdono mirdono force-pushed the feat/odrl-policy-for-authz-sparql-parser branch 5 times, most recently from 81e90f3 to e0cd19b Compare March 30, 2026 13:14
@mirdono mirdono changed the title [DO NOT MERGE] refactor: use ODRL policy for authorisation configuration feat: use ODRL policy for authorisation configuration Mar 30, 2026
@mirdono mirdono marked this pull request as ready for review March 30, 2026 13:35
@mirdono mirdono force-pushed the feat/odrl-policy-for-authz-sparql-parser branch 4 times, most recently from 0185ec5 to 91325d0 Compare April 7, 2026 11:12
@mirdono
Copy link
Copy Markdown
Member Author

mirdono commented Apr 10, 2026

Merged the changes from #83 in this branch. In terms of behaviour nothing should really change, except that it is no longer possible to write data to the human-validation graph via the yasgui frontend.

Copy link
Copy Markdown
Contributor

@tdn tdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good as far as I can tell, and didn't notice anything weird when running it locally.

mirdono added 9 commits April 13, 2026 12:14
Bring the ODRL policy up to date with the authorization policy as defined in lisp.

To verify whether the ODRL policy and list policy are indeed equivalent, the
former can be converted to lisp as follows:
1. Clear any contents from the `http://mu.semte.ch/graphs/odrl-policy` graph
2. Regenerate `./config/odrl-parser/config.nt` using the `ttl-to-ntriples`
   project script.
3. Load the contents of the ntriples config into the triplestore using the
   `odrl-parser` service: `docker compose exec odrl-parser curl
   http://localhost/load-policy`
4. Generate the lisp config from the import policy: `docker compose exec
   odrl-parser curl http://localhost/generate-config`, the resulting file
   written to `./config/odrl-parser/decideAuthorizationPolicy.lisp`.
5. Compare `./config/authorization/decide.lisp` and the file generated in
   previous step. Note, the order of elements differs so one cannot simply to a
   line by line comparison. Furthermore, the generated file will define more
   prefixes as it includes all prefixes known by the service.
- Move the ttl file with the ODRL policy to sparql-parser's configuration folder
  such that the service can read it from there.
- Remove the 'environment variable' from to switch between regular lisp config
  and generated lisp config from sparql-parse's configuration.
Now that sparql-parser can use ODRL policies directly this service is not longer
needed.
With the `sparql-parser` service now supporting reading ttl configurations
directly the manual conversion is no longer needed.
Replace the public read+write permission to the human-validation graph by a
scoped permission for the `annotation-review-service`. This way only this
service can write `ext:ReviewAnnotation` resources to that graph.

Furthermore, additional scoped permissions are added such that the service can
read data from the appropriate graphs.
During development it can be useful to easily switch between the Lisp and ODRL
config. The added commented lines allow to do this by simply uncommenting them
if you want the Lisp config.
Replace the public read+write grant to the human-validation graph by a scoped
grant for the `annotation-review-service`. This way only this service can write
`ext:ReviewAnnotation` resources to that graph.

Furthermore, additional scoped grant are added such that the service can
read data from the appropriate graphs.
@mirdono mirdono force-pushed the feat/odrl-policy-for-authz-sparql-parser branch from af5c2e9 to 7da4511 Compare April 13, 2026 10:14
@mirdono mirdono merged commit 7da4511 into development Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants