1// Schema lifecycle: experimental | stable | deprecated
2@status("stable")
3package gemara
4
5import "time"
6
7@go(gemara)
8
9// Datetime represents an ISO 8601 formatted datetime string
10#Datetime: time.Format("2006-01-02T15:04:05Z07:00") @go(Datetime,format="date-time")
11
12// Group represents a classification or grouping that can be used in different contexts with semantic meaning derived from its usage
13#Group: {
14 // id allows this entry to be referenced by other elements
15 id: string
16
17 // title describes the purpose of this group at a glance
18 title: string
19
20 // description explains the significance and traits of entries to this group
21 description: string
22}
23
24// Metadata represents common metadata fields shared across all layers
25#Metadata: {
26 // id allows this entry to be referenced by other elements
27 id: string
28
29 // type identifies the kind of Gemara artifact for unambiguous parsing
30 type: #ArtifactType
31
32 // gemara-version declares which version of the Gemara specification this artifact conforms to
33 "gemara-version": string @go(GemaraVersion) @yaml("gemara-version")
34
35 // version is the version identifier of this artifact
36 version?: string
37
38 // date is the publication or effective date of this artifact
39 date?: #Datetime @go(Date)
40
41 // description provides a high-level summary of the artifact's purpose and scope
42 description: string
43
44 // author is the person or group primarily responsible for this artifact
45 author: #Actor
46
47 // mapping-references is a list of external documents referenced within this artifact
48 MR="mapping-references"?: [#MappingReference, ...#MappingReference] @go(MappingReferences) @yaml("mapping-references,omitempty")
49
50 // applicability-groups is a list of groups used to classify within this artifact to specify scope
51 AG="applicability-groups"?: [#Group, ...#Group] @go(ApplicabilityGroups) @yaml("applicability-groups,omitempty")
52
53 // draft indicates whether this artifact is a pre-release version; open to modification
54 draft?: bool
55
56 // lexicon is a URI pointing to a controlled vocabulary or glossary relevant to this artifact
57 lexicon?: #ArtifactMapping @go(Lexicon,optional=nillable)
58
59 if MR != _|_ {
60 _uniqueRefIds: {for i, r in MR {(r.id): i}}
61 }
62 if AG != _|_ {
63 _uniqueGroupsIds: {for i, c in AG {(c.id): i}}
64 }
65}
66
67// ArtifactType identifies the kind of Gemara artifact for unambiguous parsing
68#ArtifactType: "CapabilityCatalog" | "ControlCatalog" | "GuidanceCatalog" | "ThreatCatalog" | "RiskCatalog" | "Policy" | "MappingDocument" | "EvaluationLog" | "EnforcementLog" | "VectorCatalog" @go(-)