Skip to content

Core Artifact Structure

In the YAML serialization, an artifact is written as a set of keys and values. Its opening keys give the artifact's type, name, description, and identity:

type: text-field
name: "Study Name"
description: "The name of the study"
id: "https://repo.metadatacenter.org/template-fields/5c2d54c"

Every artifact begins this way, differing only in its type and in the content it carries. A template:

type: template
name: "Study"
description: "A clinical study"
id: "https://repo.metadatacenter.org/templates/7b8977e"

Or an element:

type: element
name: "Address"
description: "A postal address"
id: "https://repo.metadatacenter.org/template-elements/be89d73"

An instance opens the same way, and additionally identifies the template it conforms to:

type: instance
name: "SDY232"
id: "https://repo.metadatacenter.org/template-instances/1f9a2b3"
isBasedOn: "https://repo.metadatacenter.org/templates/7b8977e"

Scalar Style

Quoted and plain strings carry the same model value, and readers accept both. The canonical CEDAR writers use plain scalars only for structural values whose complete vocabulary CEDAR controls: type, modelVersion, status, version, datatype, action, granularity, termType, and inputTimeFormat. A value must also be a recognized member for that key; version and modelVersion must have the three-part form N.N.N.

All other strings are double-quoted in canonical output, including names, descriptions, identifiers, IRIs, timestamps, and values supplied by an external vocabulary. The examples throughout this specification are written in that style, so what they show is what a CEDAR writer emits.

These four kinds fall into two families. A template, element, or field is a schema artifact, describing the shape that metadata must take. An instance is an instance artifact, holding metadata that conforms to a template. A few keys apply only to schema artifacts, since only a schema artifact defines structure.

The type Discriminator

Every definition opens with type, whose value names the artifact kind and, for fields, the field type. The reader dispatches on it. The value fixes which further keys are meaningful.

Value Artifact
template A template.
element An element.
a field-type token A field, of one of the field types below.
instance A template instance.
element-instance A standalone element instance.

Descriptive Keys

Key Value Presence Meaning
name string required The artifact's human-readable name. Required.
description string optional A description of the artifact. Omitted when empty.
identifier string optional An application-defined identifier, distinct from id. Not necessarily an IRI. Omitted when empty.
language string optional The natural language of the artifact's content, as an IETF BCP 47 language tag (for example en). Omitted when empty.

Identity

An artifact's id is its own identifier, an IRI. The model fixes no particular form for it. Any valid IRI serves. In practice CEDAR mints identifiers under its own repository, so a CEDAR id usually looks like https://repo.metadatacenter.org/templates/7b8977e, with a path segment naming the artifact kind and a trailing identifier. An id from another source is equally valid, as long as it is a well-formed IRI.

Key Value Presence Meaning
id IRI conditional The artifact's own identifier. Present when the artifact has been assigned one.

A nested child is not required to have an id. Full and compact serialization preserve one when present; a hand-authored minimal artifact normally has no repository-assigned IDs yet.

Field Types

A field's type is one of 25 field types, each collecting a particular kind of value.

Field type Collects
text-field Free text.
text-area-field Multi-line text.
numeric-field A number.
temporal-field A date, time, or datetime.
controlled-term-field A term from a controlled vocabulary.
radio-field One option, as radio buttons.
single-select-list-field One option, from a dropdown list.
checkbox-field Any number of options, as checkboxes.
multi-select-list-field Any number of options, from a dropdown list.
link-field An IRI.
phone-number-field A phone number.
email-field An email address.
attribute-value-field User-supplied attribute/value pairs.
ext-ror-field A ROR identifier.
ext-orcid-field An ORCID identifier.
ext-doi-field A DOI.
ext-rrid-field An RRID.
ext-pfas-field A PFAS identifier.
ext-pubmed-field A PubMed identifier.
ext-nih-grant-id-field An NIH grant identifier.
static-rich-text Fixed formatted text (collects no value).
static-image A fixed image (collects no value).
static-youtube-video An embedded video (collects no value).
static-section-break A section divider (collects no value).
static-page-break A page divider (collects no value).

Model Version

Every schema artifact records the version of the CEDAR model it is written against, in modelVersion. The current model version is 1.6.0. Because it names the modelling language rather than any one artifact's content, modelVersion changes only when the CEDAR model itself changes. An instance does not carry it.

Key Value Presence Meaning
modelVersion string optional The version of the CEDAR model the artifact conforms to (currently 1.6.0).

The full form states modelVersion for the artifact, and a writer states it for each child within the artifact as well. A hand-written child may leave it to the artifact it is in. The compact form states it for neither. A reader of the full form refuses an artifact without one, and a reader of either form refuses a modelVersion that names a version other than the current one, whether the artifact states it or a child does.

Keys Outside the Form

A reader refuses a key that the form does not have where the key appears, and it reports the key with its path. A misspelled key such as descripton: is therefore refused rather than read as nothing, which would lose its value without a word. The same holds for a key that the form has only for another field type. A unit belongs to a numeric-field, so a text-field that states one is refused.

Some keys are names that a document chooses itself, and a reader accepts any name there. They are the keys of an instance's children, the names under annotations, and the attribute names of an attribute-value field. Beside an instance's children, a key whose value is a mapping is read as an attribute-value field, since only the template can say whether the instance holds one by that name. A key there whose value is not a mapping is refused.

A reader also accepts a few keys that earlier writers emitted and that the model has no place for, and it discards them. They are a field's settings (continuePreviousLine, valueRecommendation, hidden, required and recommended) stated in an element's configuration, and required or recommended stated for a static field or an attribute-value field.