forked from usnistgov/CASE-Utilities-Python
-
Notifications
You must be signed in to change notification settings - Fork 3
Library Usage #118
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
Library Usage #118
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
2df147a
Add validate() function for programmatic access
kchason f485161
Fix pre-commit formatting
kchason b509dc5
Fix property reference
kchason 8c40df1
Make type generic to account for multiple return types
kchason f6d48e2
Fix List vs list for casting
kchason 2d3a65b
Feedback from PR
kchason bfe9992
Merge branch 'develop' into library-usage
kchason 86ed417
Instantiate properties as instance variables instead of class
kchason 40be311
Fix None vs "none" ontology version specification
ajnelson-nist ae5f077
Add explicit `-> None` on `__init__`
ajnelson-nist 97d7fbb
Constrain `ValidationResult.graph` type to `pyshacl.validate(...)[1]`…
ajnelson-nist 64bd95c
Merge branch 'develop' into library-usage
kchason 4208a99
Wrap errors and positional arg signature support
kchason 73e4683
Separate types and utils into discrete files
kchason d41a418
Fix import reference
kchason 8f957dc
Forward arguments with unpacking syntax
ajnelson-nist 6f9b6c9
Merge branch 'develop' into library-usage
ajnelson-nist 00f1360
Default case_validate.validate inference parameter to None rather tha…
ajnelson-nist 15f00c9
Consolidate case_validate CLI validation logic into case_validate.val…
ajnelson-nist eccaad4
Add new case_validate source files to Make dependencies
ajnelson-nist 90f5c8c
case_validate: Update NIST inlined license text
ajnelson-nist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Portions of this file contributed by NIST are governed by the following | ||
# statement: | ||
# | ||
# This software was developed at the National Institute of Standards | ||
# and Technology by employees of the Federal Government in the course | ||
# of their official duties. Pursuant to Title 17 Section 105 of the | ||
# United States Code, this software is not subject to copyright | ||
# protection within the United States. NIST assumes no responsibility | ||
# whatsoever for its use by other parties, and makes no guarantees, | ||
# expressed or implied, about its quality, reliability, or any other | ||
# characteristic. | ||
# | ||
# We would appreciate acknowledgement if the software is used. | ||
|
||
from typing import Set, Union | ||
|
||
import rdflib | ||
|
||
|
||
class ValidationResult: | ||
def __init__( | ||
self, | ||
conforms: bool, | ||
graph: Union[Exception, bytes, str, rdflib.Graph], | ||
text: str, | ||
undefined_concepts: Set[rdflib.URIRef], | ||
) -> None: | ||
self.conforms = conforms | ||
self.graph = graph | ||
self.text = text | ||
self.undefined_concepts = undefined_concepts | ||
|
||
|
||
class NonExistentCDOConceptWarning(UserWarning): | ||
""" | ||
This class is used when a concept is encountered in the data graph that is not part of CDO ontologies, according to the --built-version flags and --ontology-graph flags. | ||
""" | ||
|
||
pass | ||
|
||
|
||
class NonExistentCASEVersionError(Exception): | ||
""" | ||
This class is used when an invalid CASE version is requested that is not supported by the library. | ||
""" | ||
|
||
pass |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.