Skip to content

Commit 7621f7f

Browse files
committed
Use typing symbols directly
This patch partially implements a small piece of PR 118. References: * #118 Requested-by: kchason <[email protected]> Signed-off-by: Alex Nelson <[email protected]>
1 parent 116437c commit 7621f7f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

case_utils/case_validate/__init__.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
import logging
3737
import os
3838
import sys
39-
import typing
4039
import warnings
40+
from typing import Dict, Set, Tuple, Union
4141

4242
import pyshacl # type: ignore
4343
import rdflib
@@ -182,7 +182,7 @@ def main() -> None:
182182
ontology_graph.parse(arg_ontology_graph)
183183

184184
# 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()
186186

187187
for n_structural_class in [
188188
NS_OWL.Class,
@@ -230,7 +230,7 @@ def main() -> None:
230230
continue
231231
cdo_concepts.add(rdflib.URIRef(cleaned_line))
232232

233-
data_cdo_concepts: typing.Set[rdflib.URIRef] = set()
233+
data_cdo_concepts: Set[rdflib.URIRef] = set()
234234
for data_triple in data_graph.triples((None, None, None)):
235235
for data_triple_member in data_triple:
236236
if isinstance(data_triple_member, rdflib.URIRef):
@@ -255,13 +255,11 @@ def main() -> None:
255255
# determination by output file extension. case_validate will defer
256256
# to pySHACL behavior, as other CASE tools don't (at the time of
257257
# 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()
259259
if args.format != "human":
260260
validator_kwargs["serialize_report_graph"] = args.format
261261

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]
265263
validate_result = pyshacl.validate(
266264
data_graph,
267265
shacl_graph=ontology_graph,

0 commit comments

Comments
 (0)