Skip to content

Add CDO concept typo-checker based on set-differencing URIRefs using CDO prefixes #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 17, 2022

Conversation

ajnelson-nist
Copy link
Member

This addresses Issue 40.

This PR implements in case_validate the CDO concept set-differencing strategy used in CASE-Examples-QC. That strategy was discussed in #40.

The new behavior is:

  • If a CDO concept referenced in the instance data does not exist in the requested version of the CDO ontologies, a warning is raised.
    • Any published CDO version IRIs or ontology IRIs will not trigger this warning, thanks to a new static file that refreshes as part of the new ontology version generation process.
  • The flag --allow-warnings will let these warnings still pass validation. If that flag is not present, case_validate will exit 1, and give a description (through another warning) of why the tool exited 1 even though Conforms: true came from the SHACL validation results.
    • The message currently reads: The data graph is SHACL-conformant with the CDO ontologies, but nonexistent-concept references raise Warnings with this tool. Please either correct the concept names in the data graph; use the --ontology-graph flag to pass a corrected CDO ontology file, also using --built-version none; or, use the --allow-warnings flag.
  • The Python warnings.warn function is used to raise these warnings.

…CDO prefixes

A follow-on patch will regenerate Make-managed files.

References:
* #40

Signed-off-by: Alex Nelson <[email protected]>
Syntax errors or other code halts will cause _$@ to be empty.

Signed-off-by: Alex Nelson <[email protected]>
This file records the history of CDO IRIs that are ontology IRIs or
somehow related to ontology versioning.

A follow-on patch will add the scripts that generated this file.  For CI
and git-bisect purposes, the patch storing the generated file needs to
be committed first.

References:
* #40

Signed-off-by: Alex Nelson <[email protected]>
A follow-on patch will regenerate Make-managed files.

References:
* #40

Signed-off-by: Alex Nelson <[email protected]>
References:
* #40

Signed-off-by: Alex Nelson <[email protected]>
@ajnelson-nist ajnelson-nist added this to the 0.8.0 milestone Nov 16, 2022
@ajnelson-nist ajnelson-nist added the enhancement New feature or request label Nov 16, 2022
@kchason kchason marked this pull request as ready for review November 17, 2022 02:40
@kchason kchason merged commit 2f32021 into develop Nov 17, 2022
@ajnelson-nist ajnelson-nist deleted the add_concept_typo_review branch November 17, 2022 02:50
ajnelson-nist added a commit to casework/CASE-Corpora that referenced this pull request Nov 22, 2022
The new typo checking feature of `case_validate` flags usage of the IRI
serving as the `uco-core:` prefix as an unrecognized concept.

Rather than determine how to encode a definition for the prefix IRI
within the ontology, this patch removes usage of `sh:declare`, due to
downstream side-effects noted during development of UCO Issue 457.

No effects were observed on Make-managed files.

References:
* casework/CASE-Utilities-Python#77
* ucoProject/UCO#457

Signed-off-by: Alex Nelson <[email protected]>
ajnelson-nist added a commit to casework/CASE-Implementation-GNU-Time that referenced this pull request Dec 16, 2022
This patch does not apply `pre-commit`; that will be applied in a
follow-on patch.

Concept typo-checking is now delegated to the `case_validate`
typo-checker.  This removes the CASE-Examples-QC dependency.

A follow-on patch will regenerate Make-managed files.

References:
* casework/CASE-Utilities-Python#77

Signed-off-by: Alex Nelson <[email protected]>
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.

Some function should confirm CASE- and UCO-prefixed concepts used in instance data exist
2 participants