Skip to content

Commit 41f0efe

Browse files
Merge pull request #73 from casework/BugFix-Issue-72
Align Role with ontology; port property documentation to UcoObject
2 parents efdd18a + 8fe6be1 commit 41f0efe

File tree

2 files changed

+16
-45
lines changed

2 files changed

+16
-45
lines changed

case_mapping/base.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def __init__(
199199
created_by: Optional["IdentityAbstraction"] = None,
200200
description: Union[None, str, Sequence[str]] = None,
201201
facets: Union[None, Facet, Sequence[Facet]] = None,
202+
created_time: Optional[datetime] = None,
202203
modified_time: Union[None, datetime, Sequence[datetime]] = None,
203204
object_created_time: Optional[datetime] = None,
204205
object_marking: Union[None, "UcoObject", Sequence["UcoObject"]] = None,
@@ -208,7 +209,15 @@ def __init__(
208209
**kwargs: Any,
209210
) -> None:
210211
"""
212+
:param created_by: The identity that created a characterization of a concept.
213+
:param created_time: The time at which a characterization of a concept is created.
214+
:param description: A description of a particular concept characterization.
211215
:param facets: This will contain specific properties for this object
216+
:param modified_time: Specifies the time that this particular version of the object was modified.
217+
:param name: The name of a particular concept characterization.
218+
:param object_marking: Marking definitions to be applied to a particular concept characterization in its entirety
219+
:param spec_version: The version of UCO used to characterize a concept.
220+
:param tag: One or more generic tags/labels.
212221
"""
213222
super().__init__(*args, **kwargs)
214223
self["@type"] = "uco-core:UcoObject"

case_mapping/uco/role.py

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,19 @@
1-
from ..base import Facet
1+
from typing import Any
22

3+
from ..base import UcoObject
34

4-
class Role(Facet):
5+
6+
class Role(UcoObject):
57
def __init__(
68
self,
7-
description=None,
8-
_id=None,
9-
modified_time=None,
10-
name=None,
11-
created_time=None,
12-
spec_version=None,
13-
tag=None,
14-
_type=None,
15-
created_by=None,
16-
objet_marking=None,
9+
*args: Any,
10+
**kwargs: Any,
1711
):
1812
"""
1913
A role is a usual or customary function based on contextual perspective.
20-
:param description: A description of a particular concept characterization.
21-
:param _id: A globally unique identifier for a characterization of a concept.
22-
:param modified_time: Specifies the time that this particular version of the object was modified.
23-
:param name: The name of a particular concept characterization.
24-
:param created_time: The time at which a characterization of a concept is created.
25-
:param spec_version: The version of UCO used to characterize a concept.
26-
:param tag: A generic tag/label.
27-
:param _type: The explicitly-defined type of characterization of a concept.
28-
:param created_by: The identity that created a characterization of a concept.
29-
:param objet_marking: Marking definitions to be applied to a particular concept characterization in its entirety
3014
"""
31-
super().__init__()
15+
super().__init__(*args, **kwargs)
3216
self["@type"] = "uco-role:Role"
33-
self._str_vars(
34-
**{
35-
"uco-core:description": description,
36-
"uco-core:name": name,
37-
"uco-core:specVersion": spec_version,
38-
"uco-core:tag": tag,
39-
"uco-core:type": _type,
40-
}
41-
)
42-
self._datetime_vars(
43-
**{
44-
"uco-core:modifiedTime": modified_time,
45-
"uco-core:objectCreatedTime": created_time,
46-
}
47-
)
48-
self._node_reference_vars(
49-
**{
50-
"uco-core:id": _id,
51-
"uco-core:createdBy": created_by,
52-
"uco-core:objectMarking": objet_marking,
53-
}
54-
)
5517

5618

5719
directory = {"uco-role:Role": Role}

0 commit comments

Comments
 (0)