-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathmapping_inline.cue
More file actions
78 lines (59 loc) · 2.76 KB
/
Copy pathmapping_inline.cue
File metadata and controls
78 lines (59 loc) · 2.76 KB
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
// SPDX-License-Identifier: Apache-2.0
// Schema lifecycle: experimental | stable | deprecated
@status("stable")
package gemara
// MappingReference represents a reference to an external document with full metadata.
#MappingReference: {
// id identifies this mapping reference within the artifact and, when url
// is absent, the referenced artifact's metadata.id.
id: string
// title describes the purpose of this mapping reference at a glance
title: string
// version is the version identifier of the artifact being mapped to
version: string
// description is prose regarding the artifact's purpose or content
description?: string
// url is the path where the artifact may be retrieved; preferably responds with Gemara-compatible YAML/JSON
url?: =~"^(https?|file)://[^\\s]+$"
}
// ArtifactMapping represents a mapping to an external artifact or artifact entry
#ArtifactMapping: {
// reference-id identifies an element from a MappingReference in the artifact's metadata
"reference-id": string @go(ReferenceId)
// remarks is prose regarding the mapped artifact or the mapping relationship
remarks?: string
}
// MultiEntryMapping represents a mapping to an external reference with one or more entries.
#MultiEntryMapping: {
// top-level reference to the MappingReference entry
#ArtifactMapping
// entries is a list of mapping entries
entries: [#ArtifactMapping, ...#ArtifactMapping] @go(Entries)
}
// EntryMapping represents how a specific entry maps to a MappingReference.
#EntryMapping: {
// reference-id is the id for a MappingReference entry in the artifact's metadata
"reference-id": string @go(ReferenceId)
// entry-id is the identifier being mapped to in the referenced artifact
"entry-id": string @go(EntryId)
// remarks is prose describing the mapping relationship
remarks?: string
}
// EvidenceMapping identifies the source from which evidence was collected.
// reference-id names the MappingReference; coordinate or entry-id gives
// specificity within it; digest pins the observed content at collection time.
#EvidenceMapping: {
// reference-id ties this evidence to a mapping-reference in the artifact's metadata
"reference-id": string @go(ReferenceId)
// coordinate is the precise location within the stream identified by reference-id
// (e.g. an API path, file path, or JSON path expression).
// Do not set if entry-id is set.
coordinate?: string
// entry-id identifies a specific entry within a referenced Gemara artifact.
// Do not set if coordinate is set.
"entry-id"?: string @go(EntryId)
// digest is a cryptographic hash of the observed content at collection time; format: algorithm:encoded (e.g. sha256:abc123...)
digest?: =~"^[a-z0-9]+(?:[+._-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$"
// remarks is prose regarding this evidence reference
remarks?: string
}