Tag Archive for: CEDAR Features

The CEDAR Model, Now in TypeScript

CEDAR 2.9.5 is now in production, bringing with it the changes from CEDAR 2.9.2, which was released but not deployed separately.

The most important change for developers is that browser applications no longer have to treat CEDAR artifacts as untyped JSON. The CEDAR Artifact Library already gave Java applications typed builders, readers, writers, and validators, but browser applications had no equivalent. They had to assemble the JSON themselves—JSON Schema with JSON-LD annotations, correctly ordered children, and correctly shaped value constraints—then send it to the server to learn whether it was valid.

The CEDAR Model TypeScript Library closes that gap. Its first stable release brings the same model into the browser, with typed models, builders, readers, writers, and validators for templates, elements, fields, and instances. It supports JSON, JSON-LD, and YAML, and any web application can install it from npm and work with CEDAR artifacts locally. The model library documentation covers these APIs with complete TypeScript examples. An application can now build a template, validate an instance against it, and translate either artifact between serializations without a round trip to the server.

That support includes YAML, the human-readable representation defined in the CEDAR Model YAML Specification. CEDAR has long produced YAML artifacts; since 2.9.0, it has accepted them as input too. A browser application can read a template or instance from YAML, work with it as a typed object, and write it back as the JSON Schema or JSON-LD that CEDAR stores. The reverse works too: an application can give a person a compact YAML view of an artifact to read or edit by hand. The result is the same artifact the server would produce, so the browser and server implementations agree.

The CEDAR Embeddable Editor (CEE) now uses the same model library. CEE renders a CEDAR template as a data-entry form inside any web application. The component has also received a substantial modernization: it moved from Angular 14 to Angular 22, shed its legacy configuration, gained TypeScript declarations for its host interface, and is now published to npm alongside the model. Embedders can install the editor and its model from one registry and receive compile-time feedback when configuration is incorrect. The CEE documentation explains how to configure and embed the component.

The CEDAR platform has modernized alongside these libraries. The backend now runs on Dropwizard 5 and Jetty 12, and every REST service publishes an OpenAPI description in the interactive API reference. Artifact updates use HTTP ETag and If-Match preconditions, preventing one editor from silently overwriting another’s changes. An unreachable dependency returns a sanitized 503, and DOI publication checks authorization and lifecycle state before contacting DataCite. Delivery changed too: GitHub Actions replaced Travis, and releases are assembled from immutable build trains pinned to exact source commits. The expanded Docker installation guide now takes an operator from configuration through building and starting CEDAR to verifying the deployment.

The linked GitHub release notes provide the complete technical details. The cedarcli manual covers building, running, and releasing CEDAR from the command line. The design behind CEE is described in Author Once, Publish Everywhere.

CEDAR now supports YAML metadata

CEDAR has long been able to hand users a template, element, field or an instance as YAML — a clean, human-readable format that is easy to skim, edit by hand, and track in version control. With the 2.9.0 release, that street now runs both ways: CEDAR accepts YAML too. You can author and edit templates, elements, fields, and instances as plain YAML.

Nothing about CEDAR’s underlying model has changed. Templates, elements and field remain in JSON Schema and metadata remains in JSON-LD; YAML is simply another serialization of those artifacts. Every template, element, field or instance round-trips through YAML and back to the identical JSON Schema or JSON-LD, so YAML is a convenience for authoring and review — not a new format to adopt or migrate to.

There is nothing new to learn and no separate endpoint to call. Every artifact route negotiates the representation per request, so JSON and YAML clients work side by side: ask for YAML and you receive YAML, send YAML and CEDAR ingests it.

A small example makes the difference concrete. Here is a real CEDAR template — a study with a single text field — as YAML:

type: template
name: "Study"
id: "https://repo.metadatacenter.org/templates/3b2af8ae"
status: draft
version: 0.0.1
children:
- key: "study_title"
  type: text-field
  name: "Study Title"
  description: "The title of the study"
  configuration:
    required: true
modelVersion: 1.6.0
createdOn: "2024-03-27T13:57:17-07:00"
modifiedOn: "2024-06-14T11:42:47-07:00"
createdBy: "https://metadatacenter.org/users/6d21a887"
modifiedBy: "https://metadatacenter.org/users/6d21a887"

That is the whole template. The equivalent CEDAR JSON Schema — the same artifact with its @context, JSON-LD typing, per-field _valueConstraints and _ui blocks, and property definitions spelled out — runs many times longer, and CEDAR still generates and stores all of it. YAML just lets a person read and write the parts that carry meaning.

We also support a compact presentation mode, which omits provenance fields for brevity. Here is the above template in compact form:

type: template
name: "Study"
id: "https://repo.metadatacenter.org/templates/3b2af8ae"
children:
- key: "study_title"
  type: text-field
  name: "Study Title"
  description: "The title of the study"
  configuration:
    required: true

The YAML format is documented in the CEDAR YAML specification, and the full API — including the YAML media types — is browsable in the interactive API reference.