diff --git a/case_example_mapping/dict_to_case.py b/case_example_mapping/dict_to_case.py index 35ffe0b..ffc851d 100644 --- a/case_example_mapping/dict_to_case.py +++ b/case_example_mapping/dict_to_case.py @@ -1,5 +1,6 @@ import json import sys +from typing import Any def main() -> None: @@ -9,7 +10,7 @@ def main() -> None: """ # Initialize the basic CASE graph that will have the files appended - case: dict = { + case: dict[str, Any] = { "@context": { "case-investigation": "https://ontology.caseontology.org/case/investigation/", "kb": "http://example.org/kb/", diff --git a/tests/case_output_test.py b/tests/case_output_test.py index 4735790..8561d09 100644 --- a/tests/case_output_test.py +++ b/tests/case_output_test.py @@ -3,6 +3,7 @@ from typing import Set from rdflib import Graph, URIRef +from rdflib.query import ResultRow class CASEOutputTests(unittest.TestCase): @@ -11,7 +12,7 @@ def test_graphs_exist(self) -> None: Identifies all CASE graph files within the ./output directory and ensures there are at least two. """ - files: list = [] + files: list[str] = [] source_directory: str = "./output" for file in os.listdir(source_directory): if file.endswith(".json") or file.endswith(".jsonld"): @@ -68,6 +69,8 @@ def test_organization_iri_found(self) -> None: g: Graph = Graph() g.parse(os.path.join(source_directory, file)) for result in g.query(query): + assert isinstance(result, ResultRow) + assert isinstance(result[0], URIRef) # Graph.query for a SELECT query returns a tuple, with # member count as long as the number of bound variables. computed.add(result[0])