Skip to content
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

Minor clean up #178

Merged
merged 7 commits into from
Oct 30, 2023
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
2 changes: 1 addition & 1 deletion .github/static/get_dic2owl_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def main(argv_input: list = None) -> Set[str]:
for file in args.requirements_files:
if not file.exists():
raise FileNotFoundError(f"Could not find {file} !")
with open(file.resolve(), "r") as handle:
with open(file.resolve(), "r", encoding="utf8") as handle:
for line in handle.readlines():
match = requirements_regex.fullmatch(line)
if match is None:
Expand Down
13 changes: 1 addition & 12 deletions dic2owl/dic2owl/dic2owl.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ class Generator:
"ontology/cif-ddl.ttl"
)

# TODO:
# Should `comments` be replaced with a dict `annotations` for annotating
# the ontology itself? If so, we should import Dublin Core.

def __init__(
self,
dicfile: "StrPath",
Expand Down Expand Up @@ -187,10 +183,8 @@ def _add_data_value(self, item: dict) -> None:
for ddl_name, value in item.items():
if ddl_name.startswith("_type."):
if ddl_name == "_type.dimension":
# TODO - fix special case
pass
elif value == "Implied":
# TODO - fix special case
pass
else:
parents.append(self.ddl[value])
Expand Down Expand Up @@ -221,11 +215,6 @@ class `cls`.

def _add_metadata(self) -> None:
"""Adds metadata to the generated ontology."""
# TODO:
# Is there a way to extract metadata from the dic object like
# _dictionary_audit.version?
# onto.set_version(version="XXX")

for comment in self.comments:
self.onto.metadata.comment.append(comment)
self.onto.metadata.comment.append(
Expand Down Expand Up @@ -275,4 +264,4 @@ def main(
overwrite=True,
)

return gen # XXX - just for debugging
return gen
Loading