From 2803e54c64c510fe0278b64df55967122bf154dc Mon Sep 17 00:00:00 2001 From: Syphax Date: Tue, 11 Feb 2025 06:00:16 +0100 Subject: [PATCH] add ObjectPropertyCreation change specifying NodeCreation if a property --- src/oaklib/interfaces/differ_interface.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/oaklib/interfaces/differ_interface.py b/src/oaklib/interfaces/differ_interface.py index 31665f02b..25f9b2082 100644 --- a/src/oaklib/interfaces/differ_interface.py +++ b/src/oaklib/interfaces/differ_interface.py @@ -10,6 +10,7 @@ AddNodeToSubset, Change, ClassCreation, + ObjectPropertyCreation, Edge, EdgeDeletion, MappingCreation, @@ -38,6 +39,7 @@ DEPRECATED_PREDICATE, HAS_OBSOLESCENCE_REASON, OWL_CLASS, + OWL_OBJECT_PROPERTY, TERM_REPLACED_BY, TERMS_MERGED, ) @@ -159,12 +161,12 @@ def diff( logger.info("finding Creations") for entity in created_entities: types = other_ontology.owl_type(entity) - if OWL_CLASS in types: + is_class = OWL_CLASS in types + is_property = OWL_OBJECT_PROPERTY in types + if is_class: yield ClassCreation(id=_gen_id(), about_node=entity) - # elif OIO_SYNONYM_TYPE_PROPERTY in types: - # yield NodeCreation( - # id=_gen_id(), about_node=OIO_SYNONYM_TYPE_PROPERTY - # ) + elif is_property: + yield ObjectPropertyCreation(id=_gen_id(), about_node=entity) else: yield NodeCreation(id=_gen_id(), about_node=entity)