Dear iRODS Development Team,
I am reaching out for guidance on implementing custom Python rules and invoking them correctly from the Python iRODS client.
We are currently developing a metadata schema management system that uses JSON Schema Draft 2020-12 for metadata validation. As part of our architecture, we have:
Within our data portal, metadata validation is straightforward. However, we also need to enforce this validation programmatically within iRODS. Our goal is to trigger a custom iRODS Rule Engine rule that:
Before proceeding further, we would appreciate your feedback on whether this approach makes sense — or if there is a more direct or recommended way to achieve the same goal within the iRODS framework.
At the moment, we are encountering difficulties when passing JSON data from the Python iRODS client (python-irodsclient==3.1.1) to a custom rule. Specifically, we are unsure how to properly instantiate and invoke a Rule object from the Python client that accepts JSON payload parameters.
The available documentation and GitHub (https://github.com/irods/python-irodsclient) examples mostly cover simple use cases without parameters, so we may be missing some key implementation details (or perhaps our approach needs adjustment).
Any guidance, best practices, or examples you could share would be greatly appreciated.
Kind regards,
Laura Lo Gerfo
--
--
The Integrated Rule-Oriented Data System (iRODS) - https://irods.org
iROD-Chat: http://groups.google.com/group/iROD-Chat
---
You received this message because you are subscribed to the Google Groups "iRODS-Chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to irod-chat+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/irod-chat/6278f33a-8a19-4d80-b17b-e4856722871dn%40googlegroups.com.
Hi Terrell,
Thank you very much for your helpful pointers and the references — those examples are indeed very useful.
Based on your feedback about the payload size limits when invoking Python rules, we are considering a slightly different approach:
instead of passing the JSON metadata object directly as a parameter (payload) to the rule, we could first upload the JSON as a file and then have a custom rule read it and perform the validation by calling our external REST API service.
Would this be a more appropriate or robust way to handle metadata validation within iRODS, in your opinion?
Also, just for curiosity — when you mention a “limit on the payload size,” is there a known or recommended maximum size for rule input parameters?
Many thanks again for your time and guidance,
Kind regards,
Laura
To view this discussion visit https://groups.google.com/d/msgid/irod-chat/CAFaqteZyc-muSn5vW1BVjjLGi1oX_Jug_zFEDfZeiNEsKRTjrg%40mail.gmail.com.
To view this discussion visit https://groups.google.com/d/msgid/irod-chat/GVXPR06MB8755B45A1290A8AA6D40591982F6A%40GVXPR06MB8755.eurprd06.prod.outlook.com.