1// SPDX-License-Identifier: Apache-2.0
2
3// Schema lifecycle: experimental | stable | deprecated
4@status("stable")
5
6package gemara
7
8// MappingReference represents a reference to an external document with full metadata.
9#MappingReference: {
10 // id allows this entry to be referenced by other elements
11 id: string
12
13 // title describes the purpose of this mapping reference at a glance
14 title: string
15
16 // version is the version identifier of the artifact being mapped to
17 version: string
18
19 // description is prose regarding the artifact's purpose or content
20 description?: string
21
22 // url is the path where the artifact may be retrieved; preferrably responds with Gemara-compatible YAML/JSON
23 url?: =~"^(https?|file)://[^\\s]+$"
24}
25
26// ArtifactMapping represents a mapping to an external artifact or artifact entry
27#ArtifactMapping: {
28 // reference-id identifies an element from a MappingReference in the artifact's metadata
29 "reference-id": string @go(ReferenceId)
30
31 // remarks is prose regarding the mapped artifact or the mapping relationship
32 remarks?: string
33}
34
35// MultiEntryMapping represents a mapping to an external reference with one or more entries.
36#MultiEntryMapping: {
37 // top-level reference to the MappingReference entry
38 #ArtifactMapping
39
40 // entries is a list of mapping entries
41 entries: [#ArtifactMapping, ...#ArtifactMapping] @go(Entries)
42}
43
44// EntryMapping represents how a specific entry maps to a MappingReference.
45#EntryMapping: {
46 // reference-id is the id for a MappingReference entry in the artifact's metadata
47 "reference-id": string @go(ReferenceId)
48
49 // entry-id is the identifier being mapped to in the referenced artifact
50 "entry-id": string @go(EntryId)
51
52 // remarks is prose describing the mapping relationship
53 remarks?: string
54}