Skip to content

Commit

Permalink
add ObjectPropertyCreation change specifying NodeCreation if a property
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Feb 11, 2025
1 parent 22ebc5c commit 2803e54
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/oaklib/interfaces/differ_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
AddNodeToSubset,
Change,
ClassCreation,
ObjectPropertyCreation,
Edge,
EdgeDeletion,
MappingCreation,
Expand Down Expand Up @@ -38,6 +39,7 @@
DEPRECATED_PREDICATE,
HAS_OBSOLESCENCE_REASON,
OWL_CLASS,
OWL_OBJECT_PROPERTY,
TERM_REPLACED_BY,
TERMS_MERGED,
)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 2803e54

Please sign in to comment.