You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
44
+
"""
45
+
iflen(core_objects) ==0:
46
+
raiseValueError(
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
+
)
49
+
super().__init__(*args, **kwargs)
50
+
self["@type"] ="uco-core:ContextualCompilation"
51
+
self.append_core_objects(core_objects)
52
+
53
+
54
+
classEnclosingCompilation(Compilation):
55
+
def__init__(
56
+
self,
57
+
*args: Any,
58
+
core_objects: Sequence[UcoObject],
59
+
**kwargs: Any,
60
+
) ->None:
61
+
"""
62
+
An enclosing compilation is a container for a grouping of things.
63
+
"""
64
+
iflen(core_objects) ==0:
65
+
raiseValueError(
66
+
"An EnclosingCompilation is required to have at least one UcoObject to link at initiation time."
67
+
)
68
+
super().__init__(*args, **kwargs)
69
+
self["@type"] ="uco-core:EnclosingCompilation"
70
+
self.append_core_objects(core_objects)
71
+
72
+
73
+
classBundle(EnclosingCompilation):
10
74
def__init__(
11
75
self,
12
76
*args: Any,
13
77
**kwargs: Any,
14
78
) ->None:
15
79
"""
16
80
The main CASE Object for representing a case and its activities and objects.
81
+
82
+
Instantiating this class requires a starter sequence (set, list, or tuple) to be passed using the core_objects parameter. (See EnclosingCompilation.) To confirm conformant CASE will be generated, at least one UcoObject must be passed in this list. However, this does not initially need to be the complete sequence of objects that will be in this Bundle. Other UcoObjects can be added after initialization with bundle.append_to_uco_object.
17
83
"""
18
84
super().__init__(*args, **kwargs)
19
85
self.build= [] # type: ignore
@@ -39,6 +105,7 @@ def __init__(
39
105
# Assign caller-selectible prefix label and IRI, after checking
40
106
# for conflicts with hard-coded prefixes.
41
107
# https://www.w3.org/TR/turtle/#prefixed-name
108
+
assertisinstance(self["@context"], dict)
42
109
ifself.prefix_labelinself["@context"]:
43
110
raiseValueError(
44
111
"Requested prefix label already in use in hard-coded dictionary: '%s'. Please revise caller to use another label."
@@ -51,14 +118,6 @@ def __init__(
51
118
defappend_to_case_graph(self, *args):
52
119
self._append_observable_objects("@graph", *args)
53
120
54
-
@unpack_args_array
55
-
defappend_to_uco_object(self, *args):
56
-
"""
57
-
Add a single/tuple of result(s) to the list of outputs from an action
58
-
:param args: A CASE object, or objects, often an observable. (e.g., one of many devices from a search operation)
0 commit comments