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

Feature: Add classDeletion and ObjectPropertyDeletion change type specifying the NodeDeletion #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion src/oaklib/interfaces/differ_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
)

from oaklib.datamodels.vocabulary import ( # OIO_SYNONYM_TYPE_PROPERTY,
OWL_OBJECT_PROPERTY,
DEPRECATED_PREDICATE,
HAS_OBSOLESCENCE_REASON,
OWL_CLASS,
Expand Down Expand Up @@ -173,7 +174,15 @@ def diff(

if nodes_to_delete:
for node in nodes_to_delete:
yield NodeDeletion(id=_gen_id(), about_node=node)
node_types = self.owl_type(node)
is_class = OWL_CLASS in node_types
is_property = OWL_OBJECT_PROPERTY in node_types
if is_class:
yield kgcl.ClassDeletion(id=_gen_id(), about_node=node)
elif is_property:
yield kgcl.ObjectPropertyDeletion(id=_gen_id(), about_node=node)
else:
yield NodeDeletion(id=_gen_id(), about_node=node, change_description=node_types)

logger.info("finding Obsoletions")
other_ontology_entities_with_obsoletes = set(
Expand Down
Loading