Skip to content

Commit e58f1b2

Browse files
committed
Add and complete type signatures
Signed-off-by: Alex Nelson <[email protected]>
1 parent 5613b63 commit e58f1b2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

case_example_mapping/dict_to_case.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import sys
3+
from typing import Any
34

45

56
def main() -> None:
@@ -9,7 +10,7 @@ def main() -> None:
910
"""
1011

1112
# Initialize the basic CASE graph that will have the files appended
12-
case: dict = {
13+
case: dict[str, Any] = {
1314
"@context": {
1415
"case-investigation": "https://ontology.caseontology.org/case/investigation/",
1516
"kb": "http://example.org/kb/",

tests/case_output_test.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import Set
44

55
from rdflib import Graph, URIRef
6+
from rdflib.query import ResultRow
67

78

89
class CASEOutputTests(unittest.TestCase):
@@ -11,7 +12,7 @@ def test_graphs_exist(self) -> None:
1112
Identifies all CASE graph files within the ./output directory and ensures there
1213
are at least two.
1314
"""
14-
files: list = []
15+
files: list[str] = []
1516
source_directory: str = "./output"
1617
for file in os.listdir(source_directory):
1718
if file.endswith(".json") or file.endswith(".jsonld"):
@@ -68,6 +69,8 @@ def test_organization_iri_found(self) -> None:
6869
g: Graph = Graph()
6970
g.parse(os.path.join(source_directory, file))
7071
for result in g.query(query):
72+
assert isinstance(result, ResultRow)
73+
assert isinstance(result[0], URIRef)
7174
# Graph.query for a SELECT query returns a tuple, with
7275
# member count as long as the number of bound variables.
7376
computed.add(result[0])

0 commit comments

Comments
 (0)