Skip to content
Open
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
27 changes: 27 additions & 0 deletions src/kgcl_schema/datamodel/kgcl.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ class ObjectPropertyCreationId(NodeCreationId):
class NodeDeletionId(NodeChangeId):
pass

class ObjectPropertyDeletionId(NodeDeletionId):
pass

class NodeDirectMergeId(NodeObsoletionId):
pass
Expand Down Expand Up @@ -2531,6 +2533,31 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
super().__post_init__(**kwargs)
self.type = str(self.class_name)

@dataclass
class ObjectPropertyDeletion(NodeDeletion):
"""
A node deletion where the owl type is 'ObjectProperty'
"""
_inherited_slots: ClassVar[List[str]] = []

class_class_uri: ClassVar[URIRef] = KGCL.ObjectPropertyDeletion
class_class_curie: ClassVar[str] = "kgcl:ObjectPropertyDeletion"
class_name: ClassVar[str] = "ObjectPropertyDeletion"
class_model_uri: ClassVar[URIRef] = KGCL.ObjectPropertyDeletion

id: Union[str, ObjectPropertyDeletionId] = None
change_description: Optional[str] = None

def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self._is_empty(self.id):
self.MissingRequiredField("id")
if not isinstance(self.id, ObjectPropertyCreationId):
self.id = ObjectPropertyDeletionId(self.id)

if self.change_description is not None and not isinstance(self.change_description, str):
self.change_description = str(self.change_description)

super().__post_init__(**kwargs)

@dataclass(repr=False)
class NodeDirectMerge(NodeObsoletion):
Expand Down
6 changes: 6 additions & 0 deletions src/kgcl_schema/schema/kgcl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,12 @@ classes:
slot_usage:
change_description:
string_serialization: delete {about_node}
ObjectPropertyDeletion:
is_a: NodeDeletion
description: A node deletion where the owl type is 'ObjectProperty'
slot_usage:
change_description:
string_serialization: delete object property {about_node}
NodeDirectMerge:
is_a: NodeObsoletion
mixins:
Expand Down