Skip to content

Commit e9f07f0

Browse files
committed
Relax core_objects in ContextualCompilation; align arguments to ontology
No effects were observed on Make-managed files. References: * ucoProject/UCO#599 * ucoProject/UCO#662 Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
1 parent 254f924 commit e9f07f0

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

case_mapping/uco/core.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@ class Compilation(UcoObject):
1010
def __init__(
1111
self,
1212
*args: Any,
13-
core_objects: Optional[Sequence[UcoObject]] = None,
1413
**kwargs: Any,
1514
) -> None:
1615
"""
1716
A compilation is a grouping of things.
1817
"""
1918
super().__init__(*args, **kwargs)
2019
self["@type"] = "uco-core:Compilation"
21-
if core_objects is not None and len(core_objects) > 0:
22-
self.append_core_objects(core_objects)
2320

2421
@unpack_args_array
2522
def append_to_uco_object(self, *args) -> None:
@@ -34,21 +31,16 @@ class ContextualCompilation(Compilation):
3431
def __init__(
3532
self,
3633
*args: Any,
37-
core_objects: Sequence[UcoObject],
34+
core_objects: Optional[Sequence[UcoObject]] = None,
3835
**kwargs: Any,
3936
) -> None:
4037
"""
4138
A contextual compilation is a grouping of things sharing some context (e.g., a set of network connections observed on a given day, all accounts associated with a given person).
42-
43-
Future implementation note: At and before CASE 1.3.0, at least one core:object must be supplied at instantiation time of a contextual compilation. At and after CASE 1.4.0, these objects will be optional.
4439
"""
45-
if len(core_objects) == 0:
46-
raise ValueError(
47-
"A ContextualCompilation is required to have at least one UcoObject to link at initiation time. This will become optional in CASE 1.4.0."
48-
)
4940
super().__init__(*args, **kwargs)
5041
self["@type"] = "uco-core:ContextualCompilation"
51-
self.append_core_objects(core_objects)
42+
if core_objects is not None and len(core_objects) > 0:
43+
self.append_core_objects(core_objects)
5244

5345

5446
class EnclosingCompilation(Compilation):

0 commit comments

Comments
 (0)