You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
72
+
Validate the given data graph against the given CASE ontology version and supplemental graphs.
73
+
74
+
:param *args: The positional arguments to pass to the underlying pyshacl.validate function.
75
+
:param input_file: The path to the file containing the data graph to validate. This can also be a list of paths to files containing data graphs to pool together.
76
+
:param case_version: The version of the CASE ontology to use (e.g. 1.2.0). If None, the most recent version will be used.
77
+
:param supplemental_graphs: File paths to supplemental graphs to use. If None, no supplemental graphs will be used.
78
+
:param allow_warnings: In addition to affecting the conformance of SHACL validation, this will affect conformance based on unrecognized CDO concepts (likely, misspelled or miscapitalized) in the data graph. If allow_warnings is not True, any unrecognized concept using a CDO IRI prefix will cause conformance to be False.
79
+
:param inference: The type of inference to use. If "none" (type str), no inference will be used. If None (type NoneType), pyshacl defaults will be used. Note that at the time of this writing (pySHACL 0.23.0), pyshacl defaults are no inferencing for the data graph, and RDFS inferencing for the SHACL graph, which for case_utils.validate includes the SHACL and OWL graphs.
80
+
:param **kwargs: The keyword arguments to pass to the underlying pyshacl.validate function.
81
+
:return: The validation result object containing the defined properties.
62
82
"""
83
+
# Convert the data graph string to a rdflib.Graph object.
undefined_cdo_concepts_alleviation_message="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."
# Relieve RAM of the data graph after validation has run.
318
-
deldata_graph
319
-
320
-
conforms=validate_result[0]
321
-
validation_graph=validate_result[1]
322
-
validation_text=validate_result[2]
257
+
conforms=validation_result.conforms
258
+
validation_graph=validation_result.graph
259
+
validation_text=validation_result.text
323
260
324
261
# NOTE: The output logistics code is adapted from pySHACL's file
325
262
# pyshacl/cli.py. This section should be monitored for code drift.
@@ -341,13 +278,6 @@ def main() -> None:
341
278
%type(validation_graph)
342
279
)
343
280
344
-
iflen(undefined_cdo_concepts) >0:
345
-
warnings.warn(undefined_cdo_concepts_message)
346
-
ifnotargs.allow_warnings:
347
-
undefined_cdo_concepts_alleviation_message="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."
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.
39
+
"""
40
+
41
+
pass
42
+
43
+
44
+
classNonExistentCASEVersionError(Exception):
45
+
"""
46
+
This class is used when an invalid CASE version is requested that is not supported by the library.
0 commit comments