Skip to content

Reference

Every top-level key of a blueprint, its fields and how consumers read them.

Common rules

  • Strict keys. Unknown keys are rejected. Only top-level keys that start with x- are free-form.
  • $import. Any list entry can be { "$import": "path-or-url" }. The file it points to holds more entries of the same list (or a single entry), spliced in place.
  • Duplicates merge into the first. After imports, two entries of a list with the same identity (see the table below) describe the same record. Their relative paths are resolved first, each against the file that declares it. Then the later entry is shallow-merged into the first: each field it gives replaces the earlier value as a whole, the others are kept, and the entry keeps its first position, so the install order of modules does not change. When the two entries have different forms (a simple entry and a source entry in itemSets or items), the later one replaces the first as a whole, still in the first position; a bare module or theme name counts as { "name": … }. Consumers should warn when the later entry changes something. An entry without an identity is kept, in its place.
  • Config errors stop the deploy. An entry of modules, themes, files, vocabularies, resourceTemplates, users or sites that cannot be applied stops the deploy: the content depends on it. Entries of itemSets and items take onError (see Errors).
  • Sources. A source, an $import and a media url are a relative path, an http(s):// URL or a git source (gh:, gl: or git@host:). A git repository is gh:owner/repo[#ref], git@host:path.git[#ref], an http(s):// URL whose path ends in .git, or https://github.com/owner/repo (a trailing / is allowed). gh:owner/repo[@ref]:path and gl:group/repo[@ref]:path are a file in a repository. Any other URL is a file; consumers may turn GitHub and GitLab /blob/ page URLs into raw URLs. Modules and themes may use a repository; other fields need a single file. The schema only tells the forms apart; a value can still fail when a consumer resolves it.
  • No fallback. When a consumer reads a source and the file is missing, unreachable or in a form it doesn't support, it stops with an error. It never falls back to another release, a catalog lookup or an installed copy.
  • Relative paths resolve against the file that declares them: the blueprint or an imported file. They are URL references, as in HTML: write %, # and ? percent-encoded (notes%231.pdf); other characters may be written as they are or encoded (My File.pdf or My%20File.pdf), but not / and \ (%2F, %5C). Absolute paths and leading whitespace are rejected. Write them with ./; paths without it are still valid, unless they start like a URL scheme (notes: in ./notes:1.json).
  • The root. A relative path must stay inside the root: the folder of the blueprint, local or URL. ../ may go back up to the root, not beyond. A file imported by an absolute URL or by gh:/gl: has its own folder as root; a file imported by a relative path keeps the root of the file that imports it. A blueprint without a location has no root; whether it can use relative paths is up to the consumer. A consumer may allow a wider root, for example with --root.
  • Optional parts. A consumer may ignore keys it does not support, and documents which ones in its support matrix.
"modules": [
  "Common",
  { "$import": "./partials/modules.json" }
]

The identity of an entry, compared without case, is a field it gives in the blueprint that identifies the record in Omeka S:

List Identity
modules, themes name, or the name string
users email
vocabularies namespaceUri
resourceTemplates label, when the entry gives one
sites slug, when the entry gives one
itemSets, items title, when the entry gives one
files none

Consumers don't read the files an entry points to, so a template without label or a source entry without title doesn't merge, even when its file has the same label or title as another entry. Two different records with the same title in a list merge into one: give them different titles, or leave title out of a source entry. A site without slug doesn't merge, and Omeka S makes its slug unique. Every files entry is applied, in order: a later file with the same destination overwrites the earlier one on disk.

"modules": [
  { "$import": "./partials/modules.json" },
  { "name": "Common", "version": "3.4.72" }
]

Common keeps the place and the state that modules.json gives it; only its version changes, unless modules.json gives it a ZIP or a #ref in source, which still wins over version.

install

Values used when Omeka S is installed. Consumers that work on an existing installation ignore them.

Field Type Description
source string Omeka S release ZIP: a URL, a path relative to the blueprint or a file in a repository (see Sources). It must be the built release asset, for example https://github.com/omeka/omeka-s/releases/download/v4.1.1/omeka-s-4.1.1.zip or a downloaded copy next to the blueprint, ./core/omeka-s-4.1.1.zip: a git repository or a GitHub source archive needs a build first, and consumers reject a repository. It wins over preferredVersions.omeka; consumers may warn when they differ. When it can't be read, consumers stop with an error; they don't fall back to preferredVersions.omeka. Consumers that cannot install from an archive ignore it.
title string Installation title
locale string For example en_US
timezone string For example UTC
admin object First global admin: email (required), name, password. Without a password, the consumer takes one from its own input or generates it.

modules

Each entry is a module name, an object or an $import.

Field Type Description
name string, required Module directory name, such as CleanUrl
state download, install or activate download places the files, install installs, activate installs and enables
version string Release on omeka.org, or tag or branch of a git repository. A ZIP or a #ref in source wins over it.
source string ZIP or git repository (see Sources). Without it, the module already installed is used, or name is looked up on omeka.org.
"modules": [
  "Common",
  { "name": "EasyAdmin", "version": "3.4.30" },
  { "name": "Mapping", "source": "https://github.com/omeka-s-modules/Mapping/releases/download/v2.1.0/Mapping-2.1.0.zip" },
  { "name": "Log", "source": "gh:Daniel-KM/Omeka-S-module-Log", "state": "install" }
]

themes

Same forms as modules, without state.

"themes": [ "default", { "name": "freedom", "source": "gh:omeka-s-themes/freedom" } ]

files

Files copied into the installation after modules and themes are in place.

Field Type Description
source string, required Path or URL of the file (see Sources)
destination string, required Path inside the Omeka S root. Absolute paths and .. are not allowed.
extract boolean, default false Unzip source into destination. A single top-level directory in the archive is skipped, as with add-ons.
"files": [
  { "source": "./config/cleanurl.config.php", "destination": "config/cleanurl.config.php" }
]

vocabularies

RDF vocabularies imported with the RDF importer.

Field Type Description
source string, required Path or URL of the RDF file (see Sources)
namespaceUri, prefix, label string, required How the vocabulary appears in Omeka S
comment, format, lang string Passed to the importer
labelProperty, commentProperty string RDF properties to read labels and comments from
"vocabularies": [
  { "prefix": "schema", "namespaceUri": "https://schema.org/", "label": "schema.org", "source": "https://schema.org/version/latest/schemaorg-current-https.rdf" }
]

resourceTemplates

Resource templates imported from a JSON export.

Field Type Description
source string, required Path or URL of the export (see Sources)
label string Label to use instead of the one in the export
ignoreDeps boolean Skip the dependency check when importing

settings

Global settings, as a map of setting id to value, or a list of maps and $import entries merged in order.

"settings": { "installation_title": "Blueprint Demo" }

users

Field Type Description
email string, required Identifies the user
role string global_admin, site_admin, editor, reviewer, author, researcher, or a role added by a module (such as guest)
username, password string Account details. Avoid passwords in blueprints used in production.
isActive boolean Whether the account can log in
settings object Per-user settings, such as limit_to_granted_sites

itemSets and items

Sample content. An item set has a title (required) and a description.

Item field Type Description
title string, required
description, creator string
itemSets list of strings Titles of item sets in the blueprint
sites list of strings Slugs or titles of the sites the item belongs to. Defaults to the default site.
media list Each one has a url (required), title and altText. type is url, the only type so far.

Portable JSON-LD sources

An entry of itemSets or items can instead point to a portable JSON-LD file with source. The file is Omeka's JSON-LD for one resource, with an inline @context, and it names the records it refers to instead of using instance ids, so it can be imported into any installation. Omeka-S-Cli's item:export and item-set:export write these files.

"itemSets": [{ "source": "./content/item-sets/photographs.jsonld", "title": "Photographs" }],
"items": [
  {
    "source": "./content/items/harbour.jsonld",
    "sites": ["collections"],
    "media": [{ "url": "./content/media/harbour.png" }]
  }
]
Field Type Description
source string, required Path or URL to the JSON-LD file (see Sources).
title string The title in the file. It identifies the entry in the blueprint (see Common rules), lets a simple item name a source item set in itemSets, and is used in messages.
sites list of strings Items only. Slugs or titles that replace the file's o:site.
media list Items only. As in a simple item.

Every other property, item sets included, belongs in the file. References use the o-ref vocabulary (https://omeka-s-contrib.github.io/omeka-s-ref/ns#), recognized by its namespace under any prefix:

  • o-ref:id is the record's own identity, {"<term>": "<value>"}. Without it, the title identifies the record. A record that already exists is left as it is, so applying a blueprint again creates nothing new.
  • o-ref:ref links to another record wherever Omeka S writes {"o:id": …}: o:item_set, or a value of type resource:*. It names a record by one property value.
  • Classes are named by {"o:term"}, resource templates by {"o:label"} and sites by {"o:slug"}.
  • Properties are matched by namespace URI, so the file's prefixes do not have to match the installation's.

Item sets are created before items, each list in order, so a reference should point to a record declared earlier or already in the installation. An item keeps the file's o:site unless the entry gives sites; with no site, or none that matches, it goes to the default site.

Errors

Every entry of itemSets and items, simple or with a source, takes onError:

Value Meaning
fail (default) If the entry cannot be applied, the consumer stops.
skip The consumer leaves the entry out and reports it with a warning.
"items": [
  { "source": "./content/items/harbour.jsonld", "onError": "skip" }
]

These are errors for an entry:

  • a missing vocabulary, or an unknown property, class, template or data type;
  • a media file that cannot be fetched or that Omeka S rejects;
  • a dependency that cannot be resolved: an o-ref:ref that matches no record or more than one, or an item set in a simple item's itemSets that does not exist. A skipped entry counts as missing for the entries that depend on it, and their own onError decides what happens.

A record that already exists is not an error: the identity rules above leave it as it is. An $import entry has no onError; the entries in the imported file carry their own. Demo blueprints mark their sample content "skip", so that a broken link does not stop the deploy.

sites

Field Type Description
title string, required
slug, summary string
theme string Theme name, as in themes
isPublic boolean
setAsDefault boolean Make it the default site
assignNewItems boolean, default true Add items created later without an explicit site (CSV imports, API calls) to this site, as the Omeka S admin form does. Set it to false to keep a site's items under explicit control.
permissions list Each one has a user (email of a blueprint user, required) and a role: viewer, editor or admin

meta and preferredVersions

meta is informational: title, author and description. preferredVersions has the php and omeka versions the blueprint was written for. preferredVersions.omeka is the Omeka S release consumers install when they install Omeka S and install.source is absent; consumers that cannot choose the version treat it as a hint.

Consumers

The schema identifies the form of a source; it does not check that it is safe. A consumer:

  • resolves a relative path against the file that declares it as a URL reference (file:// for a local file), and checks the root after decoding each segment, with \ read as /, so .., %2e%2e or ..\ cannot leave it (an RFC 3986 resolver keeps %2e%2e as a plain segment);
  • rejects a segment of a relative path that decodes to / or \ (%2F, %5C), whether the blueprint comes from disk or from a URL;
  • to read a local file, decodes each segment of the result; a URL is fetched as it is;
  • compares the real path of a local file with the real path of the root, so a symbolic link inside the root (a cloned repository can hold data -> /) cannot leave it;
  • stops with an error on an $import cycle: a file that imports itself, directly or through other files. Two imports are the same file when they have the same real path, or the same URL after redirects;
  • reads the characters of a relative path as in the table below;
  • keeps a repository source (a git source or an http(s):// repository URL) inside its repository: a .. segment, also percent-encoded, in the owner, group, repository, ref or path is an error, checked on the source as written, before any URL normalization; a /blob/ URL turned into a raw URL stays inside its repository too;
  • never passes a ref to git as an option;
  • does not show credentials from a URL in its output.
In a relative path A consumer
%XX of any other character (%20, %23, %25) decodes it to read a local file
%2F, %5C rejects it: encoded-separator
%2e%2e, ..\ checks the root after decoding
% without two hex digits (100%.pdf, a%zz.pdf) rejects it: invalid-encoding
escapes that don't decode to UTF-8 (%FF, %C3) rejects it: invalid-encoding
a control character, written or encoded (%00–%1F, %7F) rejects it: invalid-encoding
an unencoded # or ? rejects it: invalid-encoding

fixtures/resolution/ has the expected results to test a resolver against.

Extensions

Options for one consumer go under a top-level key that starts with x-. Its content is defined by that consumer; the others ignore it.

"x-playground": { "landingPage": "/admin" }