From 04bdf5653752a0928d39dd689e6981fba4fee4f6 Mon Sep 17 00:00:00 2001 From: richardbruskiewich Date: Mon, 7 Aug 2023 10:12:05 -0700 Subject: [PATCH] - Internal class hierarchy restructured for logical clarity in recent releases, formally highlighted in this release - Most visible TRAPIResponseValidator class (previously) moved from the **`reasoner_validator.__init__.py`** package module, into its own **`reasoner_validator.validator`** module - Some documentation repair --- CHANGELOG.md | 8 ++++++-- README.md | 33 ++++++++++++++++++--------------- docs/index.rst | 14 +++++++------- poetry.lock | 25 ++++++++++++------------- pyproject.toml | 2 +- 5 files changed, 44 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d02c55..c2a6635 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,14 @@ The Reasoner Validator package is evolving along with progress in TRAPI and Biolink Model standards within the NCATS Biomedical Knowledge Translator. +## 3.8.0 +- Internal class hierarchy restructured for logical clarity in recent releases, formally highlighted in this release +- Most visible TRAPIResponseValidator class (previously) moved from the **`reasoner_validator.__init__.py`** package module, into its own **`reasoner_validator.validator`** module +- Some documentation repair + ## 3.7.6 - TRAPI qualifier validation enhanced by use of biolink:Association subclass slot_usage driven constraints (leveraging novel Biolink Model Toolkit 1.1.1 methods) -- Validation made TRAPI Response (TRAPI) schema_version and biolink_version aware, taking precedence over default (non-overridden) values of these version parameters. - +- Validation made TRAPI Response (TRAPI) **`schema_version`** and **`biolink_version`** aware, taking precedence over default (non-overridden) values of these version parameters. ## 3.7.5 - Added TRAPI Response schema version and biolink version validation warning codes diff --git a/README.md b/README.md index 93a2e76..e12ee84 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ The web service has a single POST endpoint `/validate` taking a simple JSON requ "kp_source_type": "primary" }, "strict_validation": true, - "response": {} + "response": "{}" } ``` @@ -230,27 +230,30 @@ one should typically get a response body something like the following JSON valid "trapi_version": "1.4.1", "biolink_version": "3.2.1", "messages": { - # some categories of messages may be absent, hence, empty dictionaries + "_comment": "some categories of messages may be absent, hence, empty dictionaries", "critical": {}, "errors": { "error.knowledge_graph.node.category.missing": { - # this message template does not have any additional parameters - # other than identifier hence it just has the unique identifier - # value as a dictionary key, with associated value None - "MONDO:0005148": None + "_comment": "source scope of the validation error ('global' or some knowledge source path string)", + "global": { + "_comment": "this message template does not have any additional parameters other than identifier hence it just has the unique identifier value as a dictionary key, with associated value None", + "MONDO:0005148": null + } } }, "warnings": { - # validation code + "_comment": "validation code", "warning.knowledge_graph.node.unmapped_prefix": { - # template identifier field value - "CHEBI:6801": [ - { - # additional message template field values, if applicable - "categories": "['biolink:Drug']" - } - ] - + "global": { + "_comment": "template identifier field value", + "CHEBI:6801": [ + { + "_comment": "additional message template field values, if applicable", + "categories": "['biolink:Drug']" + } + ] + } + } }, "information": {}, diff --git a/docs/index.rst b/docs/index.rst index 697a242..0236b4d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -129,7 +129,7 @@ in a dictionary looking something like the following (as an example): messages: Dict[str, List[Dict[str,str]]] = { "information": { "info.excluded": { - # source scope of the validation error ("global" or some knowledge source path string + # source scope of the validation error ("global" or some knowledge source path string) "global": { # the uniquely discriminating 'identifier' here is the edge_id "(ZFIN:ZDB-GENE-060825-345$biolink:Gene)--[biolink:active_in]->(GO:0042645$biolink:CellularComponent)": None @@ -246,24 +246,24 @@ The web service has a single POST endpoint `/validate` taking a simple JSON requ .. code-block:: json { - # If the TRAPI version is omitted or set to None, then the 'latest' TRAPI version is used. + "_comment": "If the TRAPI version is omitted or set to None, then the 'latest' TRAPI version is used. # Note: for TRAPI releases from 1.4.0 onwards, the Response message will state the assumed 'schema_version'. # This modifies slightly the interpretation of this parameter, as follows: # If the following trapi_version parameter is given, then it overrides the TRAPI Response 'schema_version'; - # Otherwise, a TRAPI 1.4.0 Response embedded 'schema_version' (not 'latest') becomes the default validation version. + # Otherwise, a TRAPI 1.4.0 Response embedded 'schema_version' (not 'latest') becomes the default validation version." - trapi_version="1.4.2", + "trapi_version": "1.4.2", - # If the Biolink Model version is omitted or set to None, then the current Biolink Model Toolkit is used. + "_comment": "If the Biolink Model version is omitted or set to None, then the current Biolink Model Toolkit is used. # Note: for TRAPI releases from 1.4.0 onwards, the Response message will state the assumed 'biolink_version'. # This modifies slightly the interpretation of this parameter, as follows: # If the 'biolink_version' given here is assumed, which overrides the TRAPI Response stated 'biolink_version'; # Otherwise, a TRAPI 1.4.0 Response embedded 'biolink_version' (not BMT) becomes the default validation version. - # The biolink_version may also be set to the string 'suppress', in which case, most Biolink Model validation is NOT done during the validation of a TRAPI Response. + # The biolink_version may also be set to the string 'suppress', in which case, most Biolink Model validation is NOT done during the validation of a TRAPI Response." - biolink_version="3.5.0", + "biolink_version": "3.5.0", "sources": { "ara_source": "infores:aragorn", diff --git a/poetry.lock b/poetry.lock index ad66904..41c2982 100644 --- a/poetry.lock +++ b/poetry.lock @@ -270,23 +270,22 @@ toml = ["tomli"] [[package]] name = "curies" -version = "0.5.7" +version = "0.6.0" description = "Idiomatic conversion between URIs and compact URIs (CURIEs)." optional = false python-versions = ">=3.8" files = [ - {file = "curies-0.5.7-py3-none-any.whl", hash = "sha256:74fc743e2c41c3bcd2ecb1178cce72236018f245e970c88faf452b89694b475a"}, - {file = "curies-0.5.7.tar.gz", hash = "sha256:eb984c51dcd04187fec88074a43070ae6f96467887fd502fa5547377722c9a4a"}, + {file = "curies-0.6.0-py3-none-any.whl", hash = "sha256:0bf79e2176b2e44dee7fefadcd1f2d69e643fea124dc4a8d0dbf47ca5e1589f2"}, + {file = "curies-0.6.0.tar.gz", hash = "sha256:a31533ae9caeec332f9bb33e21366ab7ec32437c5f347fc9d85aa77cc48093cc"}, ] [package.dependencies] -pydantic = "<2.0" +pydantic = "*" pytrie = "*" requests = "*" [package.extras] -bioregistry = ["bioregistry (>=0.5.136)"] -docs = ["sphinx (<7.0)", "sphinx-autodoc-typehints", "sphinx-automodapi", "sphinx-rtd-theme"] +docs = ["sphinx", "sphinx-automodapi", "sphinx-rtd-theme"] fastapi = ["defusedxml", "fastapi", "httpx", "python-multipart", "uvicorn"] flask = ["defusedxml", "flask"] pandas = ["pandas"] @@ -598,13 +597,13 @@ format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339- [[package]] name = "linkml-runtime" -version = "1.5.5" +version = "1.5.6" description = "Runtime environment for LinkML, the Linked open data modeling language" optional = false python-versions = ">=3.7.6,<4.0.0" files = [ - {file = "linkml_runtime-1.5.5-py3-none-any.whl", hash = "sha256:92b0148a107f980a75b5608ece692f7d33f77328c6f61640a4d2e51488be4a3c"}, - {file = "linkml_runtime-1.5.5.tar.gz", hash = "sha256:f0275823c659924c032e88d4084e6fdb9699c0a62c6c62d45cb62e27101cbbff"}, + {file = "linkml_runtime-1.5.6-py3-none-any.whl", hash = "sha256:b869f7adf340b7df73f4fefa28a402de5719bbd7d172590e8a7ae9c25e179d77"}, + {file = "linkml_runtime-1.5.6.tar.gz", hash = "sha256:eb5f506f7ec08c44e49578d0ecc80e2d3d922756c2430e06906ee9502cca1b4c"}, ] [package.dependencies] @@ -617,7 +616,7 @@ jsonasobj2 = ">=1.0.4,<2.dev0" jsonschema = ">=3.2.0" prefixcommons = ">=0.1.12" prefixmaps = ">=0.1.4" -pydantic = ">=1.10.2,<2.0.0" +pydantic = ">=1.10.2,<3.0.0" pyyaml = "*" rdflib = ">=6.0.0" requests = "*" @@ -898,13 +897,13 @@ email = ["email-validator (>=1.0.3)"] [[package]] name = "pygments" -version = "2.15.1" +version = "2.16.1" description = "Pygments is a syntax highlighting package written in Python." optional = true python-versions = ">=3.7" files = [ - {file = "Pygments-2.15.1-py3-none-any.whl", hash = "sha256:db2db3deb4b4179f399a09054b023b6a586b76499d36965813c71aa8ed7b5fd1"}, - {file = "Pygments-2.15.1.tar.gz", hash = "sha256:8ace4d3c1dd481894b2005f560ead0f9f19ee64fe983366be1a21e171d12775c"}, + {file = "Pygments-2.16.1-py3-none-any.whl", hash = "sha256:13fc09fa63bc8d8671a6d247e1eb303c4b343eaee81d861f3404db2935653692"}, + {file = "Pygments-2.16.1.tar.gz", hash = "sha256:1daff0494820c69bc8941e407aa20f577374ee88364ee10a98fdbe0aece96e29"}, ] [package.extras] diff --git a/pyproject.toml b/pyproject.toml index 0117383..a5603c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "reasoner-validator" -version = "3.7.6" +version = "3.8.0" description = "Validation tools for Reasoner API" authors = [ "Richard Bruskiewich ",