Skip to content

Add and complete type signatures #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion case_example_mapping/dict_to_case.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import sys
from typing import Any


def main() -> None:
Expand All @@ -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/",
Expand Down
5 changes: 4 additions & 1 deletion tests/case_output_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Set

from rdflib import Graph, URIRef
from rdflib.query import ResultRow


class CASEOutputTests(unittest.TestCase):
Expand All @@ -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"):
Expand Down Expand Up @@ -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])
Expand Down