-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuco_role.py
801 lines (596 loc) · 37.3 KB
/
uco_role.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
# Auto generated from uco_role.yaml by pythongen.py version: 0.9.0
# Generation date: 2023-04-12T12:17:49
# Schema: uco-role
#
# id: https://w3id.org/lmodel/uco-role
# description: Roles in Unified Cyber Ontology
# license: https://www.apache.org/licenses/LICENSE-2.0
import dataclasses
import sys
import re
from jsonasobj2 import JsonObj, as_dict
from typing import Optional, List, Union, Dict, ClassVar, Any
from dataclasses import dataclass
from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions
from linkml_runtime.utils.slot import Slot
from linkml_runtime.utils.metamodelcore import empty_list, empty_dict, bnode
from linkml_runtime.utils.yamlutils import YAMLRoot, extended_str, extended_float, extended_int
from linkml_runtime.utils.dataclass_extensions_376 import dataclasses_init_fn_with_kwargs
from linkml_runtime.utils.formatutils import camelcase, underscore, sfx
from linkml_runtime.utils.enumerations import EnumDefinitionImpl
from rdflib import Namespace, URIRef
from linkml_runtime.utils.curienamespace import CurieNamespace
from linkml_runtime.linkml_model.types import Boolean, Datetime, Integer, String, Uriorcurie
from linkml_runtime.utils.metamodelcore import Bool, URIorCURIE, XSDDateTime
metamodel_version = "1.7.0"
version = "1.1.0"
# Overwrite dataclasses _init_fn to add **kwargs in __init__
dataclasses._init_fn = dataclasses_init_fn_with_kwargs
# Namespaces
BFO = CurieNamespace('BFO', 'http://purl.obolibrary.org/obo/BFO_')
CSO = CurieNamespace('CSO', 'https://cso.kmi.open.ac.uk/topics/')
GSSO = CurieNamespace('GSSO', 'http://purl.obolibrary.org/obo/GSSO_')
IAO = CurieNamespace('IAO', 'http://purl.obolibrary.org/obo/IAO_')
INO = CurieNamespace('INO', 'http://purl.obolibrary.org/obo/INO_')
NCIT = CurieNamespace('NCIT', 'http://purl.obolibrary.org/obo/NCIT_')
REPR = CurieNamespace('REPR', 'https://w3id.org/reproduceme#')
SEPIO = CurieNamespace('SEPIO', 'http://purl.obolibrary.org/obo/SEPIO_')
SIO = CurieNamespace('SIO', 'http://identifiers.org/sio/')
WIKIDATA = CurieNamespace('WIKIDATA', 'http://identifiers.org/wikidata/')
CORE = CurieNamespace('core', 'https://w3id.org/lmodel/uco-core/')
CSRC = CurieNamespace('csrc', 'https://csrc.nist.gov/glossary/term/')
DCID = CurieNamespace('dcid', 'https://datacommons.org/browser/')
DCTERMS = CurieNamespace('dcterms', 'http://purl.org/dc/terms/')
GR = CurieNamespace('gr', 'http://purl.org/goodrelations/v1#')
LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/')
LM_CORE = CurieNamespace('lm_core', 'https://w3id.org/lmodel/core/')
OM = CurieNamespace('om', 'http://www.ontology-of-units-of-measure.org/resource/om-2/')
OWL = CurieNamespace('owl', 'http://www.w3.org/2002/07/owl#')
RDF = CurieNamespace('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#')
RDFS = CurieNamespace('rdfs', 'http://www.w3.org/2000/01/rdf-schema#')
ROLE = CurieNamespace('role', 'https://w3id.org/lmodel/uco-role/')
SCHEMA = CurieNamespace('schema', 'http://schema.org/')
SCHEMA_UCO_CORE = CurieNamespace('schema_uco_core', 'https://w3id.org/lmodel/uco-core/schema/')
SKOS = CurieNamespace('skos', 'http://www.w3.org/2004/02/skos/core#')
SUMO = CurieNamespace('sumo', 'https://w3id.org/sumo/kb/')
WIKIDATA = CurieNamespace('wikidata', 'http://identifiers.org/wikidata/')
WIKIDATA_PROPERTY = CurieNamespace('wikidata_property', 'https://www.wikidata.org/wiki/Property:')
XSD = CurieNamespace('xsd', 'http://www.w3.org/2001/XMLSchema#')
DEFAULT_ = ROLE
# Types
class StringType(String):
""" A string """
type_class_uri = XSD.string
type_class_curie = "xsd:string"
type_name = "string type"
type_model_uri = ROLE.StringType
class LiteralType(String):
""" Literals are used for values such as strings, numbers, and dates. """
type_class_uri = RDF.literal
type_class_curie = "rdf:literal"
type_name = "literal type"
type_model_uri = ROLE.LiteralType
class NonNegativeIntegerType(Integer):
""" real number strictly greater than zero """
type_class_uri = XSD.nonNegativeInteger
type_class_curie = "xsd:nonNegativeInteger"
type_name = "non negative integer type"
type_model_uri = ROLE.NonNegativeIntegerType
class StatementType(StringType):
""" "meaningful declarative sentence that is either true or false, or that which a true or false declarative sentence asserts" """
type_class_uri = XSD.string
type_class_curie = "xsd:string"
type_name = "statement type"
type_model_uri = ROLE.StatementType
class IriType(Uriorcurie):
""" A IRI """
type_class_uri = XSD.anyURI
type_class_curie = "xsd:anyURI"
type_name = "iri type"
type_model_uri = ROLE.IriType
class BooleanType(Boolean):
""" A boolean value """
type_class_uri = XSD.boolean
type_class_curie = "xsd:boolean"
type_name = "boolean type"
type_model_uri = ROLE.BooleanType
class HexBinaryType(hex):
""" "Represents arbitrary hex-encoded binary data" """
type_class_uri = XSD.hexBinary
type_class_curie = "xsd:hexBinary"
type_name = "hex binary type"
type_model_uri = ROLE.HexBinaryType
# Class references
class UcoThing(YAMLRoot):
"""
UcoThing is the top-level class within UCO.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.UcoThing
class_class_curie: ClassVar[str] = "core:UcoThing"
class_name: ClassVar[str] = "UcoThing"
class_model_uri: ClassVar[URIRef] = ROLE.UcoThing
class UcoInherentCharacterizationThing(UcoThing):
"""
A UCO inherent characterization thing is a grouping of characteristics unique to a particular inherent aspect of a
UCO domain object.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.UcoInherentCharacterizationThing
class_class_curie: ClassVar[str] = "core:UcoInherentCharacterizationThing"
class_name: ClassVar[str] = "UcoInherentCharacterizationThing"
class_model_uri: ClassVar[URIRef] = ROLE.UcoInherentCharacterizationThing
@dataclass
class ExternalReference(UcoInherentCharacterizationThing):
"""
Characteristics of a reference to a resource outside of the UCO.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.ExternalReference
class_class_curie: ClassVar[str] = "core:ExternalReference"
class_name: ClassVar[str] = "ExternalReference"
class_model_uri: ClassVar[URIRef] = ROLE.ExternalReference
referenceURL: Optional[Union[str, IriType]] = None
definingContext: Optional[str] = None
externalIdentifier: Optional[str] = None
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self.referenceURL is not None and not isinstance(self.referenceURL, IriType):
self.referenceURL = IriType(self.referenceURL)
if self.definingContext is not None and not isinstance(self.definingContext, str):
self.definingContext = str(self.definingContext)
if self.externalIdentifier is not None and not isinstance(self.externalIdentifier, str):
self.externalIdentifier = str(self.externalIdentifier)
super().__post_init__(**kwargs)
class Facet(UcoInherentCharacterizationThing):
"""
A facet is a grouping of characteristics singularly unique to a particular inherent aspect of a UCO domain object.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.Facet
class_class_curie: ClassVar[str] = "core:Facet"
class_name: ClassVar[str] = "Facet"
class_model_uri: ClassVar[URIRef] = ROLE.Facet
@dataclass
class ConfidenceFacet(Facet):
"""
A confidence is a grouping of characteristics unique to an asserted level of certainty in the accuracy of some
information.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.ConfidenceFacet
class_class_curie: ClassVar[str] = "core:ConfidenceFacet"
class_name: ClassVar[str] = "ConfidenceFacet"
class_model_uri: ClassVar[URIRef] = ROLE.ConfidenceFacet
confidence: Union[int, NonNegativeIntegerType] = None
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self._is_empty(self.confidence):
self.MissingRequiredField("confidence")
if not isinstance(self.confidence, NonNegativeIntegerType):
self.confidence = NonNegativeIntegerType(self.confidence)
super().__post_init__(**kwargs)
@dataclass
class UcoObject(UcoThing):
"""
A UCO object is a representation of a fundamental concept either directly inherent to the cyber domain or
indirectly related to the cyber domain and necessary for contextually characterizing cyber domain concepts and
relationships. Within the Unified Cyber Ontology (UCO) structure this is the base class acting as a consistent,
unifying and interoperable foundation for all explicit and inter-relatable content objects.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.UcoObject
class_class_curie: ClassVar[str] = "core:UcoObject"
class_name: ClassVar[str] = "UcoObject"
class_model_uri: ClassVar[URIRef] = ROLE.UcoObject
createdBy: Optional[str] = None
description: Optional[Union[str, List[str]]] = empty_list()
externalReference: Optional[Union[str, List[str]]] = empty_list()
hasFacet: Optional[Union[str, List[str]]] = empty_list()
modifiedTime: Optional[Union[Union[str, XSDDateTime], List[Union[str, XSDDateTime]]]] = empty_list()
name: Optional[str] = None
objectMarking: Optional[Union[Union[dict, MarkingDefinitionAbstraction], List[Union[dict, MarkingDefinitionAbstraction]]]] = empty_list()
objectCreatedTime: Optional[Union[str, XSDDateTime]] = None
specVersion: Optional[str] = None
tag: Optional[Union[str, List[str]]] = empty_list()
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self.createdBy is not None and not isinstance(self.createdBy, str):
self.createdBy = str(self.createdBy)
if not isinstance(self.description, list):
self.description = [self.description] if self.description is not None else []
self.description = [v if isinstance(v, str) else str(v) for v in self.description]
if not isinstance(self.externalReference, list):
self.externalReference = [self.externalReference] if self.externalReference is not None else []
self.externalReference = [v if isinstance(v, str) else str(v) for v in self.externalReference]
if not isinstance(self.hasFacet, list):
self.hasFacet = [self.hasFacet] if self.hasFacet is not None else []
self.hasFacet = [v if isinstance(v, str) else str(v) for v in self.hasFacet]
if not isinstance(self.modifiedTime, list):
self.modifiedTime = [self.modifiedTime] if self.modifiedTime is not None else []
self.modifiedTime = [v if isinstance(v, XSDDateTime) else XSDDateTime(v) for v in self.modifiedTime]
if self.name is not None and not isinstance(self.name, str):
self.name = str(self.name)
if not isinstance(self.objectMarking, list):
self.objectMarking = [self.objectMarking] if self.objectMarking is not None else []
self.objectMarking = [v if isinstance(v, MarkingDefinitionAbstraction) else MarkingDefinitionAbstraction(**as_dict(v)) for v in self.objectMarking]
if self.objectCreatedTime is not None and not isinstance(self.objectCreatedTime, XSDDateTime):
self.objectCreatedTime = XSDDateTime(self.objectCreatedTime)
if self.specVersion is not None and not isinstance(self.specVersion, str):
self.specVersion = str(self.specVersion)
if not isinstance(self.tag, list):
self.tag = [self.tag] if self.tag is not None else []
self.tag = [v if isinstance(v, str) else str(v) for v in self.tag]
super().__post_init__(**kwargs)
class Role(UcoObject):
"""
A role is a usual or customary function based on contextual perspective.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = ROLE.Role
class_class_curie: ClassVar[str] = "role:Role"
class_name: ClassVar[str] = "Role"
class_model_uri: ClassVar[URIRef] = ROLE.Role
class BenevolentRole(Role):
"""
A benevolent role is a role with positive and/or beneficial intent.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = ROLE.BenevolentRole
class_class_curie: ClassVar[str] = "role:BenevolentRole"
class_name: ClassVar[str] = "BenevolentRole"
class_model_uri: ClassVar[URIRef] = ROLE.BenevolentRole
class MaliciousRole(Role):
"""
A malicious role is a role with malevolent intent.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = ROLE.MaliciousRole
class_class_curie: ClassVar[str] = "role:MaliciousRole"
class_name: ClassVar[str] = "MaliciousRole"
class_model_uri: ClassVar[URIRef] = ROLE.MaliciousRole
class NeutralRole(Role):
"""
A neutral role is a role with impartial intent.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = ROLE.NeutralRole
class_class_curie: ClassVar[str] = "role:NeutralRole"
class_name: ClassVar[str] = "NeutralRole"
class_model_uri: ClassVar[URIRef] = ROLE.NeutralRole
@dataclass
class Assertion(UcoObject):
"""
An assertion is a statement declared to be true.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.Assertion
class_class_curie: ClassVar[str] = "core:Assertion"
class_name: ClassVar[str] = "Assertion"
class_model_uri: ClassVar[URIRef] = ROLE.Assertion
statement: Optional[Union[str, List[str]]] = empty_list()
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if not isinstance(self.statement, list):
self.statement = [self.statement] if self.statement is not None else []
self.statement = [v if isinstance(v, str) else str(v) for v in self.statement]
super().__post_init__(**kwargs)
@dataclass
class Annotation(Assertion):
"""
An annotation is an assertion made in relation to one or more objects.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.Annotation
class_class_curie: ClassVar[str] = "core:Annotation"
class_name: ClassVar[str] = "Annotation"
class_model_uri: ClassVar[URIRef] = ROLE.Annotation
object: Union[Union[dict, "UcoObject"], List[Union[dict, "UcoObject"]]] = None
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self._is_empty(self.object):
self.MissingRequiredField("object")
if not isinstance(self.object, list):
self.object = [self.object] if self.object is not None else []
self.object = [v if isinstance(v, UcoObject) else UcoObject(**as_dict(v)) for v in self.object]
super().__post_init__(**kwargs)
@dataclass
class AttributedName(UcoObject):
"""
An attributed name is a name of an entity issued by some attributed naming authority.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.AttributedName
class_class_curie: ClassVar[str] = "core:AttributedName"
class_name: ClassVar[str] = "AttributedName"
class_model_uri: ClassVar[URIRef] = ROLE.AttributedName
namingAuthority: Optional[str] = None
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self.namingAuthority is not None and not isinstance(self.namingAuthority, str):
self.namingAuthority = str(self.namingAuthority)
super().__post_init__(**kwargs)
class Compilation(UcoObject):
"""
A compilation is a grouping of things.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.Compilation
class_class_curie: ClassVar[str] = "core:Compilation"
class_name: ClassVar[str] = "Compilation"
class_model_uri: ClassVar[URIRef] = ROLE.Compilation
@dataclass
class ContextualCompilation(Compilation):
"""
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).
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.ContextualCompilation
class_class_curie: ClassVar[str] = "core:ContextualCompilation"
class_name: ClassVar[str] = "ContextualCompilation"
class_model_uri: ClassVar[URIRef] = ROLE.ContextualCompilation
object: Union[Union[dict, "UcoObject"], List[Union[dict, "UcoObject"]]] = None
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self._is_empty(self.object):
self.MissingRequiredField("object")
if not isinstance(self.object, list):
self.object = [self.object] if self.object is not None else []
self.object = [v if isinstance(v, UcoObject) else UcoObject(**as_dict(v)) for v in self.object]
super().__post_init__(**kwargs)
@dataclass
class ControlledVocabulary(UcoObject):
"""
A controlled vocabulary is an explicitly constrained set of string values.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.ControlledVocabulary
class_class_curie: ClassVar[str] = "core:ControlledVocabulary"
class_name: ClassVar[str] = "ControlledVocabulary"
class_model_uri: ClassVar[URIRef] = ROLE.ControlledVocabulary
value: str = None
constrainingVocabularyReference: Optional[Union[str, IriType]] = None
constrainingVocabularyName: Optional[str] = None
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self._is_empty(self.value):
self.MissingRequiredField("value")
if not isinstance(self.value, str):
self.value = str(self.value)
if self.constrainingVocabularyReference is not None and not isinstance(self.constrainingVocabularyReference, IriType):
self.constrainingVocabularyReference = IriType(self.constrainingVocabularyReference)
if self.constrainingVocabularyName is not None and not isinstance(self.constrainingVocabularyName, str):
self.constrainingVocabularyName = str(self.constrainingVocabularyName)
super().__post_init__(**kwargs)
@dataclass
class EnclosingCompilation(Compilation):
"""
An enclosing compilation is a container for a grouping of things.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.EnclosingCompilation
class_class_curie: ClassVar[str] = "core:EnclosingCompilation"
class_name: ClassVar[str] = "EnclosingCompilation"
class_model_uri: ClassVar[URIRef] = ROLE.EnclosingCompilation
object: Optional[Union[Union[dict, "UcoObject"], List[Union[dict, "UcoObject"]]]] = empty_list()
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if not isinstance(self.object, list):
self.object = [self.object] if self.object is not None else []
self.object = [v if isinstance(v, UcoObject) else UcoObject(**as_dict(v)) for v in self.object]
super().__post_init__(**kwargs)
class Bundle(EnclosingCompilation):
"""
A bundle is a container for a grouping of UCO content with no presumption of shared context.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.Bundle
class_class_curie: ClassVar[str] = "core:Bundle"
class_name: ClassVar[str] = "Bundle"
class_model_uri: ClassVar[URIRef] = ROLE.Bundle
@dataclass
class Grouping(ContextualCompilation):
"""
A grouping is a compilation of referenced UCO content with a shared context.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.Grouping
class_class_curie: ClassVar[str] = "core:Grouping"
class_name: ClassVar[str] = "Grouping"
class_model_uri: ClassVar[URIRef] = ROLE.Grouping
object: Union[Union[dict, "UcoObject"], List[Union[dict, "UcoObject"]]] = None
context: Optional[Union[str, List[str]]] = empty_list()
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if not isinstance(self.context, list):
self.context = [self.context] if self.context is not None else []
self.context = [v if isinstance(v, str) else str(v) for v in self.context]
super().__post_init__(**kwargs)
class IdentityAbstraction(UcoObject):
"""
An identity abstraction is a grouping of identifying characteristics unique to an individual or organization. This
class is an ontological structural abstraction for this concept. Implementations of this concept should utilize
the identity:Identity class.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.IdentityAbstraction
class_class_curie: ClassVar[str] = "core:IdentityAbstraction"
class_name: ClassVar[str] = "IdentityAbstraction"
class_model_uri: ClassVar[URIRef] = ROLE.IdentityAbstraction
class Item(UcoObject):
"""
An item is a distinct article or unit.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.Item
class_class_curie: ClassVar[str] = "core:Item"
class_name: ClassVar[str] = "Item"
class_model_uri: ClassVar[URIRef] = ROLE.Item
class MarkingDefinitionAbstraction(UcoObject):
"""
A marking definition abstraction is a grouping of characteristics unique to the expression of a specific data
marking conveying restrictions, permissions, and other guidance for how marked data can be used and shared. This
class is an ontological structural abstraction for this concept. Implementations of this concept should utilize
the marking MarkingDefinition class.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.MarkingDefinitionAbstraction
class_class_curie: ClassVar[str] = "core:MarkingDefinitionAbstraction"
class_name: ClassVar[str] = "MarkingDefinitionAbstraction"
class_model_uri: ClassVar[URIRef] = ROLE.MarkingDefinitionAbstraction
class ModusOperandi(UcoObject):
"""
A modus operandi is a particular method of operation (how a particular entity behaves or the resources they use).
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.ModusOperandi
class_class_curie: ClassVar[str] = "core:ModusOperandi"
class_name: ClassVar[str] = "ModusOperandi"
class_model_uri: ClassVar[URIRef] = ROLE.ModusOperandi
@dataclass
class Relationship(UcoObject):
"""
A relationship is a grouping of characteristics unique to an assertion that one or more objects are related to
another object in some way.
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = CORE.Relationship
class_class_curie: ClassVar[str] = "core:Relationship"
class_name: ClassVar[str] = "Relationship"
class_model_uri: ClassVar[URIRef] = ROLE.Relationship
isDirectional: Union[bool, BooleanType] = None
source: Union[Union[dict, "UcoObject"], List[Union[dict, "UcoObject"]]] = None
target: Union[dict, "UcoObject"] = None
endTime: Optional[Union[Union[str, XSDDateTime], List[Union[str, XSDDateTime]]]] = empty_list()
kindOfRelationship: Optional[str] = None
startTime: Optional[Union[Union[str, XSDDateTime], List[Union[str, XSDDateTime]]]] = empty_list()
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self._is_empty(self.isDirectional):
self.MissingRequiredField("isDirectional")
if not isinstance(self.isDirectional, BooleanType):
self.isDirectional = BooleanType(self.isDirectional)
if self._is_empty(self.source):
self.MissingRequiredField("source")
if not isinstance(self.source, list):
self.source = [self.source] if self.source is not None else []
self.source = [v if isinstance(v, UcoObject) else UcoObject(**as_dict(v)) for v in self.source]
if self._is_empty(self.target):
self.MissingRequiredField("target")
if not isinstance(self.target, UcoObject):
self.target = UcoObject(**as_dict(self.target))
if not isinstance(self.endTime, list):
self.endTime = [self.endTime] if self.endTime is not None else []
self.endTime = [v if isinstance(v, XSDDateTime) else XSDDateTime(v) for v in self.endTime]
if self.kindOfRelationship is not None and not isinstance(self.kindOfRelationship, str):
self.kindOfRelationship = str(self.kindOfRelationship)
if not isinstance(self.startTime, list):
self.startTime = [self.startTime] if self.startTime is not None else []
self.startTime = [v if isinstance(v, XSDDateTime) else XSDDateTime(v) for v in self.startTime]
super().__post_init__(**kwargs)
# Enumerations
# Slots
class slots:
pass
slots.confidence = Slot(uri=CORE.confidence, name="confidence", curie=CORE.curie('confidence'),
model_uri=ROLE.confidence, domain=None, range=Optional[Union[int, NonNegativeIntegerType]])
slots.constrainingVocabularyName = Slot(uri=CORE.constrainingVocabularyName, name="constrainingVocabularyName", curie=CORE.curie('constrainingVocabularyName'),
model_uri=ROLE.constrainingVocabularyName, domain=None, range=Optional[str])
slots.constrainingVocabularyReference = Slot(uri=CORE.constrainingVocabularyReference, name="constrainingVocabularyReference", curie=CORE.curie('constrainingVocabularyReference'),
model_uri=ROLE.constrainingVocabularyReference, domain=None, range=Optional[Union[str, IriType]])
slots.context = Slot(uri=CORE.context, name="context", curie=CORE.curie('context'),
model_uri=ROLE.context, domain=None, range=Optional[str])
slots.createdBy = Slot(uri=CORE.createdBy, name="createdBy", curie=CORE.curie('createdBy'),
model_uri=ROLE.createdBy, domain=IdentityAbstraction, range=Optional[str])
slots.definingContext = Slot(uri=CORE.definingContext, name="definingContext", curie=CORE.curie('definingContext'),
model_uri=ROLE.definingContext, domain=None, range=Optional[str])
slots.description = Slot(uri=DCTERMS.description, name="description", curie=DCTERMS.curie('description'),
model_uri=ROLE.description, domain=None, range=Optional[str])
slots.endTime = Slot(uri=CORE.endTime, name="endTime", curie=CORE.curie('endTime'),
model_uri=ROLE.endTime, domain=None, range=Optional[Union[str, XSDDateTime]])
slots.externalIdentifier = Slot(uri=CORE.externalIdentifier, name="externalIdentifier", curie=CORE.curie('externalIdentifier'),
model_uri=ROLE.externalIdentifier, domain=None, range=Optional[str])
slots.externalReference = Slot(uri=CORE.externalReference, name="externalReference", curie=CORE.curie('externalReference'),
model_uri=ROLE.externalReference, domain=ExternalReference, range=Optional[str])
slots.hasFacet = Slot(uri=CORE.hasFacet, name="hasFacet", curie=CORE.curie('hasFacet'),
model_uri=ROLE.hasFacet, domain=None, range=Optional[str])
slots.isDirectional = Slot(uri=CORE.isDirectional, name="isDirectional", curie=CORE.curie('isDirectional'),
model_uri=ROLE.isDirectional, domain=None, range=Optional[Union[bool, BooleanType]])
slots.kindOfRelationship = Slot(uri=CORE.kindOfRelationship, name="kindOfRelationship", curie=CORE.curie('kindOfRelationship'),
model_uri=ROLE.kindOfRelationship, domain=None, range=Optional[str])
slots.modifiedTime = Slot(uri=CORE.modifiedTime, name="modifiedTime", curie=CORE.curie('modifiedTime'),
model_uri=ROLE.modifiedTime, domain=None, range=Optional[Union[str, XSDDateTime]])
slots.name = Slot(uri=RDFS.label, name="name", curie=RDFS.curie('label'),
model_uri=ROLE.name, domain=None, range=Optional[str])
slots.namingAuthority = Slot(uri=CORE.namingAuthority, name="namingAuthority", curie=CORE.curie('namingAuthority'),
model_uri=ROLE.namingAuthority, domain=None, range=Optional[str])
slots.object = Slot(uri=CORE.object, name="object", curie=CORE.curie('object'),
model_uri=ROLE.object, domain=None, range=Optional[Union[dict, UcoObject]])
slots.objectCreatedTime = Slot(uri=CORE.objectCreatedTime, name="objectCreatedTime", curie=CORE.curie('objectCreatedTime'),
model_uri=ROLE.objectCreatedTime, domain=None, range=Optional[Union[str, XSDDateTime]])
slots.objectMarking = Slot(uri=CORE.objectMarking, name="objectMarking", curie=CORE.curie('objectMarking'),
model_uri=ROLE.objectMarking, domain=None, range=Optional[Union[dict, MarkingDefinitionAbstraction]])
slots.referenceURL = Slot(uri=CORE.referenceURL, name="referenceURL", curie=CORE.curie('referenceURL'),
model_uri=ROLE.referenceURL, domain=None, range=Optional[Union[str, IriType]])
slots.source = Slot(uri=CORE.source, name="source", curie=CORE.curie('source'),
model_uri=ROLE.source, domain=None, range=Optional[Union[dict, UcoObject]])
slots.specVersion = Slot(uri=CORE.specVersion, name="specVersion", curie=CORE.curie('specVersion'),
model_uri=ROLE.specVersion, domain=None, range=Optional[str])
slots.startTime = Slot(uri=CORE.startTime, name="startTime", curie=CORE.curie('startTime'),
model_uri=ROLE.startTime, domain=None, range=Optional[Union[str, XSDDateTime]])
slots.statement = Slot(uri=CORE.statement, name="statement", curie=CORE.curie('statement'),
model_uri=ROLE.statement, domain=None, range=Optional[str])
slots.tag = Slot(uri=CORE.tag, name="tag", curie=CORE.curie('tag'),
model_uri=ROLE.tag, domain=None, range=Optional[str])
slots.target = Slot(uri=CORE.target, name="target", curie=CORE.curie('target'),
model_uri=ROLE.target, domain=None, range=Optional[Union[dict, UcoObject]])
slots.value = Slot(uri=CORE.value, name="value", curie=CORE.curie('value'),
model_uri=ROLE.value, domain=None, range=Optional[str])
slots.Annotation_object = Slot(uri=CORE.object, name="Annotation_object", curie=CORE.curie('object'),
model_uri=ROLE.Annotation_object, domain=Annotation, range=Union[Union[dict, "UcoObject"], List[Union[dict, "UcoObject"]]])
slots.Assertion_statement = Slot(uri=CORE.statement, name="Assertion_statement", curie=CORE.curie('statement'),
model_uri=ROLE.Assertion_statement, domain=Assertion, range=Optional[Union[str, List[str]]])
slots.AttributedName_namingAuthority = Slot(uri=CORE.namingAuthority, name="AttributedName_namingAuthority", curie=CORE.curie('namingAuthority'),
model_uri=ROLE.AttributedName_namingAuthority, domain=AttributedName, range=Optional[str])
slots.ConfidenceFacet_confidence = Slot(uri=CORE.confidence, name="ConfidenceFacet_confidence", curie=CORE.curie('confidence'),
model_uri=ROLE.ConfidenceFacet_confidence, domain=ConfidenceFacet, range=Union[int, NonNegativeIntegerType])
slots.ContextualCompilation_object = Slot(uri=CORE.object, name="ContextualCompilation_object", curie=CORE.curie('object'),
model_uri=ROLE.ContextualCompilation_object, domain=ContextualCompilation, range=Union[Union[dict, "UcoObject"], List[Union[dict, "UcoObject"]]])
slots.ControlledVocabulary_constrainingVocabularyReference = Slot(uri=CORE.constrainingVocabularyReference, name="ControlledVocabulary_constrainingVocabularyReference", curie=CORE.curie('constrainingVocabularyReference'),
model_uri=ROLE.ControlledVocabulary_constrainingVocabularyReference, domain=ControlledVocabulary, range=Optional[Union[str, IriType]])
slots.ControlledVocabulary_constrainingVocabularyName = Slot(uri=CORE.constrainingVocabularyName, name="ControlledVocabulary_constrainingVocabularyName", curie=CORE.curie('constrainingVocabularyName'),
model_uri=ROLE.ControlledVocabulary_constrainingVocabularyName, domain=ControlledVocabulary, range=Optional[str])
slots.ControlledVocabulary_value = Slot(uri=CORE.value, name="ControlledVocabulary_value", curie=CORE.curie('value'),
model_uri=ROLE.ControlledVocabulary_value, domain=ControlledVocabulary, range=str)
slots.EnclosingCompilation_object = Slot(uri=CORE.object, name="EnclosingCompilation_object", curie=CORE.curie('object'),
model_uri=ROLE.EnclosingCompilation_object, domain=EnclosingCompilation, range=Optional[Union[Union[dict, "UcoObject"], List[Union[dict, "UcoObject"]]]])
slots.ExternalReference_referenceURL = Slot(uri=CORE.referenceURL, name="ExternalReference_referenceURL", curie=CORE.curie('referenceURL'),
model_uri=ROLE.ExternalReference_referenceURL, domain=ExternalReference, range=Optional[Union[str, IriType]])
slots.ExternalReference_definingContext = Slot(uri=CORE.definingContext, name="ExternalReference_definingContext", curie=CORE.curie('definingContext'),
model_uri=ROLE.ExternalReference_definingContext, domain=ExternalReference, range=Optional[str])
slots.ExternalReference_externalIdentifier = Slot(uri=CORE.externalIdentifier, name="ExternalReference_externalIdentifier", curie=CORE.curie('externalIdentifier'),
model_uri=ROLE.ExternalReference_externalIdentifier, domain=ExternalReference, range=Optional[str])
slots.Grouping_context = Slot(uri=CORE.context, name="Grouping_context", curie=CORE.curie('context'),
model_uri=ROLE.Grouping_context, domain=Grouping, range=Optional[Union[str, List[str]]])
slots.Relationship_endTime = Slot(uri=CORE.endTime, name="Relationship_endTime", curie=CORE.curie('endTime'),
model_uri=ROLE.Relationship_endTime, domain=Relationship, range=Optional[Union[Union[str, XSDDateTime], List[Union[str, XSDDateTime]]]])
slots.Relationship_isDirectional = Slot(uri=CORE.isDirectional, name="Relationship_isDirectional", curie=CORE.curie('isDirectional'),
model_uri=ROLE.Relationship_isDirectional, domain=Relationship, range=Union[bool, BooleanType])
slots.Relationship_kindOfRelationship = Slot(uri=CORE.kindOfRelationship, name="Relationship_kindOfRelationship", curie=CORE.curie('kindOfRelationship'),
model_uri=ROLE.Relationship_kindOfRelationship, domain=Relationship, range=Optional[str])
slots.Relationship_target = Slot(uri=CORE.target, name="Relationship_target", curie=CORE.curie('target'),
model_uri=ROLE.Relationship_target, domain=Relationship, range=Union[dict, "UcoObject"])
slots.Relationship_source = Slot(uri=CORE.source, name="Relationship_source", curie=CORE.curie('source'),
model_uri=ROLE.Relationship_source, domain=Relationship, range=Union[Union[dict, "UcoObject"], List[Union[dict, "UcoObject"]]])
slots.Relationship_startTime = Slot(uri=CORE.startTime, name="Relationship_startTime", curie=CORE.curie('startTime'),
model_uri=ROLE.Relationship_startTime, domain=Relationship, range=Optional[Union[Union[str, XSDDateTime], List[Union[str, XSDDateTime]]]])
slots.UcoObject_description = Slot(uri=DCTERMS.description, name="UcoObject_description", curie=DCTERMS.curie('description'),
model_uri=ROLE.UcoObject_description, domain=UcoObject, range=Optional[Union[str, List[str]]])
slots.UcoObject_createdBy = Slot(uri=CORE.createdBy, name="UcoObject_createdBy", curie=CORE.curie('createdBy'),
model_uri=ROLE.UcoObject_createdBy, domain=UcoObject, range=Optional[str])
slots.UcoObject_externalReference = Slot(uri=CORE.externalReference, name="UcoObject_externalReference", curie=CORE.curie('externalReference'),
model_uri=ROLE.UcoObject_externalReference, domain=UcoObject, range=Optional[Union[str, List[str]]])
slots.UcoObject_hasFacet = Slot(uri=CORE.hasFacet, name="UcoObject_hasFacet", curie=CORE.curie('hasFacet'),
model_uri=ROLE.UcoObject_hasFacet, domain=UcoObject, range=Optional[Union[str, List[str]]])
slots.UcoObject_modifiedTime = Slot(uri=CORE.modifiedTime, name="UcoObject_modifiedTime", curie=CORE.curie('modifiedTime'),
model_uri=ROLE.UcoObject_modifiedTime, domain=UcoObject, range=Optional[Union[Union[str, XSDDateTime], List[Union[str, XSDDateTime]]]])
slots.UcoObject_name = Slot(uri=RDFS.label, name="UcoObject_name", curie=RDFS.curie('label'),
model_uri=ROLE.UcoObject_name, domain=UcoObject, range=Optional[str])
slots.UcoObject_objectCreatedTime = Slot(uri=CORE.objectCreatedTime, name="UcoObject_objectCreatedTime", curie=CORE.curie('objectCreatedTime'),
model_uri=ROLE.UcoObject_objectCreatedTime, domain=UcoObject, range=Optional[Union[str, XSDDateTime]])
slots.UcoObject_objectMarking = Slot(uri=CORE.objectMarking, name="UcoObject_objectMarking", curie=CORE.curie('objectMarking'),
model_uri=ROLE.UcoObject_objectMarking, domain=UcoObject, range=Optional[Union[Union[dict, MarkingDefinitionAbstraction], List[Union[dict, MarkingDefinitionAbstraction]]]])
slots.UcoObject_specVersion = Slot(uri=CORE.specVersion, name="UcoObject_specVersion", curie=CORE.curie('specVersion'),
model_uri=ROLE.UcoObject_specVersion, domain=UcoObject, range=Optional[str])
slots.UcoObject_tag = Slot(uri=CORE.tag, name="UcoObject_tag", curie=CORE.curie('tag'),
model_uri=ROLE.UcoObject_tag, domain=UcoObject, range=Optional[Union[str, List[str]]])