36
36
import logging
37
37
import os
38
38
import sys
39
- import typing
40
39
import warnings
40
+ from typing import Dict , Set , Tuple , Union
41
41
42
42
import pyshacl # type: ignore
43
43
import rdflib
@@ -182,7 +182,7 @@ def main() -> None:
182
182
ontology_graph .parse (arg_ontology_graph )
183
183
184
184
# Construct set of CDO concepts for data graph concept-existence review.
185
- cdo_concepts : typing . Set [rdflib .URIRef ] = set ()
185
+ cdo_concepts : Set [rdflib .URIRef ] = set ()
186
186
187
187
for n_structural_class in [
188
188
NS_OWL .Class ,
@@ -230,7 +230,7 @@ def main() -> None:
230
230
continue
231
231
cdo_concepts .add (rdflib .URIRef (cleaned_line ))
232
232
233
- data_cdo_concepts : typing . Set [rdflib .URIRef ] = set ()
233
+ data_cdo_concepts : Set [rdflib .URIRef ] = set ()
234
234
for data_triple in data_graph .triples ((None , None , None )):
235
235
for data_triple_member in data_triple :
236
236
if isinstance (data_triple_member , rdflib .URIRef ):
@@ -255,13 +255,11 @@ def main() -> None:
255
255
# determination by output file extension. case_validate will defer
256
256
# to pySHACL behavior, as other CASE tools don't (at the time of
257
257
# this writing) have the value "human" as an output format.
258
- validator_kwargs : typing . Dict [str , str ] = dict ()
258
+ validator_kwargs : Dict [str , str ] = dict ()
259
259
if args .format != "human" :
260
260
validator_kwargs ["serialize_report_graph" ] = args .format
261
261
262
- validate_result : typing .Tuple [
263
- bool , typing .Union [Exception , bytes , str , rdflib .Graph ], str
264
- ]
262
+ validate_result : Tuple [bool , Union [Exception , bytes , str , rdflib .Graph ], str ]
265
263
validate_result = pyshacl .validate (
266
264
data_graph ,
267
265
shacl_graph = ontology_graph ,
0 commit comments