NCATSTranslator / reasoner-validator

Validation of Translator OpenAPI (TRAPI) messages both to TRAPI and Biolink Model standards. See https://ncatstranslator.github.io/reasoner-validator/
Other
2 stars 4 forks source link

Explore Integration with Reasoner Pydantic Models #15

Open kennethmorton opened 2 years ago

kennethmorton commented 2 years ago

Reasoner Pydantic is a project that aims to build pydantic models as a means for validation and serialization. It has been used in production for some time and is available on pypi . I think we should explore integration of this project with the validator service.

RichardBruskiewich commented 2 years ago

Hi @kennethmorton,

At the moment, the TRAPI validation in this package is strictly a JSON schema validation of a TRAPI JSON message. Do you have some idea at what level could we would leverage the Reasoner Pydantic here? Do you think we'd rewrite parts of the Biolink Model validation part with Pydantic Reasoner (for accessing the salient parts of the TRAPI message)? I imagine that doing that might conceivably buffer the reasoner-validator from too much refactoring for future TRAPI releases(?): I know that the system is currently coded to target TRAPI 1.2.

Do you have some specific suggestions on how to 'resolve' this issue?

That said, the Biolink Model validations mainly leverage the Biolink Model Toolkit, which also (I suspect) now uses Pydantic (but on the semantic model level...).

kennethmorton commented 2 years ago

Hi @RichardBruskiewich,

I actually think the opposite. I haven't read everything fully but I would image you could integrate a lot of the Biolink Model validation code fairly easily with the Reasoner Pydantic code base. Reasoner Pedantic is a pythonic schema validator that offers some serialization speedups, so largely has a lot of the same benefits of this package.

Reasoner pedantic as it currently exists, can't simultaneously support multiple versions of TRAPI nor does it have a service to perform validation. I'm not sure it makes sense to completely merge the two repositories.

Perhaps this issue is better transfered to reasoner pydantic to suggest that it add biolink model validation.