Skip to content

Instantly share code, notes, and snippets.

@felnne
Last active December 6, 2025 22:43
Show Gist options
  • Select an option

  • Save felnne/307bfa81672fbac2cd9cd7dd632a410c to your computer and use it in GitHub Desktop.

Select an option

Save felnne/307bfa81672fbac2cd9cd7dd632a410c to your computer and use it in GitHub Desktop.
admin metadata

MAGIC Administration (v1)

Important

Pre-publication links for reviewers:

Related profiles

Definition

Examples

About

Details

Title: 'British Antarctic Survey (BAS) Mapping and Geographic Information Centre (MAGIC) Administrative Metadata Profile'

Edition: 1

Revision: 2025-10-22

Licence: Open Government Licence

People

Authors:

Contributors:

Reviewers:

  • ...

Notes

Note

Terms including 'MUST', 'SHOULD', 'MAY' etc. are used according to RFC 2119.

Rational

The ISO 19115 information model and the open, non-verifiable, nature of discovery metadata are not sufficient to meet MAGIC's needs for managing resources administratively, including:

  • ensuring administrative information is not accessible to external users
  • ensuring the integrity and trustworthiness of administrative information can be verified
  • ensuring access constraints are captured in sufficient detail, as MAGIC routinely handles sensitive, licensed or otherwise restricted information
  • ensuring references to internal systems are not visible to end-users, as such information MUST NOT be accessible to unintended audiences

In essence, this profile aims to compliment discovery metadata with additional, targetted, information needed for internal administration, held within ISO 19115 records.

Base standard

This profile is based on the ISO 19115-2:2009 standard, specifically the gmd:supplementalInformation element.

Related profiles

Important

This is a preemptive link.

In most cases, records will also follow the MAGIC Discovery profile to set discovery metadata.

Definition

This profile consists of two parts:

  1. the structure of administrative metadata (Content Model)
  2. the method for storing administrative metadata (Encoding)

JSON Schemas

Important

These are preemptive links.

Content Model.

Encoding.

Examples

Important

These are preemptive links.

  • content model (minimal) JSON
  • content model (complete) JSON
  • minimal record encoding JSON | XML
    • a minimal ISO 19115 record including administrative metadata

Note

Encoded administrative metadata has been intentionally encrypted and signed using shared insecure Test Keys, to allow anyone to decode their contents.

Content model specification

Overview

Note

This section is informative only.

The content model is authoriatively defined by the content model JSON Schema.

Property Name Type Format
$schema Schema String URI
id ID String URI
gitlab_issues GitLab issues Array -
gitlab_issues.* GitLab issue String URI
access_permissions Access permissions Array -
access_permissions.* Access permission Object -
access_permissions.*.directory Directory identifier String -
access_permissions.*.group Group identifier String -
access_permissions.*.expiry Expiries at String Datetime
access_permissions.*.comments Comments String -

Note

These properties do not form part of the ISO 19115 information model.

Types and formats are used according to the JSON Schema specification.

Properties

Schema

As defined by the JSON Schema $schema property.

Distinguishes different versions of the MAGIC Administrative Metadata content model.

This property value MUST be set to https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/magic-admin-v1.json.

ID

Distinguishes administrative metadata instances.

This property MUST relate administrative metadata to wider discovery metadata for the described resource.

This property value MUST therefore be set to the file_identifier discovery metadata value for the described resource.

GitLab issues

Non-public information, history and/or context captured in GitLab issues about the resource.

This property CAN be used with issues from any GitLab instance.

This property MUST NOT be used for issues from any other systems (such as GitHub), as the form of issue URLs MAY be relied up (to construct shorthand references for example).

Access permissions

Groups within a directory that have access to the resource, optionally limited in duration and/or explained via a freetext comment.

SHOULD be used by data access systems as a source of truth to configure access permissions. The comments sub-property MUST NOT be used by any system to configure permissions.

The directory and group sub-properties MAY use identifiers from an identity provider, or aliases for such identifiers where these are mutually understood by different systems.

See Appendix 2 for aliases systems MUST support.

Encoding specification

Overview

Administrative metadata MUST be:

  1. encoded as a JSON string
  2. added to a JSON Web Token (JWT) using a pyd [Private Claim] (https://datatracker.ietf.org/doc/html/rfc7519#section-4.3)
  3. encrypted using JSON Web Encryption (JWE)

I.e.:

[JWE]
  └── [JWT]
        └── ['pyd'] (private claim)
              └── [Administrative Metadata content model instance as JSON string]

The outer JWE ensures administrative metadata is not accessible to external users (via encryption), whilst the inner JWT allows the integrity and trustworthiness of administrative information to be verified (via signing).

The JWE MUST be contained in Discovery Metadata for the described resource.

JWT claims

Administrative Metadata JWTs MUST contain these claims:

Claim Name Definition Value
pyd Payload - JSON encoded administrative metadata
iss Issuer RFC 7519 magic.data.bas.ac.uk
aud Audience RFC 7519 data.bas.ac.uk
exp Expiry RFC 7519 100 years from point of issue

Note

JWTs typically use a short expiry time for prevent long-lived credentials. These tokens are not used for credentials or an identity, and are intentionally long lived (from the point of issue for the lifetime of the record).

Administrative Metadata JWTs MAY contain these claims:

Claim Name Definition Value
sub Subject RFC 7519 Related record file identifier and admin metadata ID
nbf Not before RFC 7519 Point of issue
iat Issued at RFC 7519 Point of issue

JWT signing key

JWTs MUST be signed using the private MAGIC Administrative Metadata Signing Key.

JWTs MUST be verified using the related public key.

JWE encryption key

JWEs MUST be encrypted using the public key derived from the MAGIC Administrative Metadata Encryption Key.

JWEs MUST be decrypted using the related private Key.

Discovery metadata

Note

This sub-section is informative only. It is authoriatively defined by the encoding JSON Schema.

The JWE value MUST be:

  • contained in a JSON encoded key-value object under an 'administrative_metadata' key
  • set as the Supplemental Information element
  • in discovery metadata for the described resource

THis discovery metadata MUST also include:

  • the file identifier element, using a value that is unique across all records
  • a domain consistency data quality element as per Appendix 1 - Domain Consistency Element, stating the record complies with this profile (for validation tools to determine whether a record uses this profile)

I.e.:

[Discovery Metadata]
├── [File Identifier]
├── [Identification]
│   └── [Supplemental Information]
│       └── [JWE]
│           └── ...
└── [Data Quality]
    └── [Domain Consistency]

Tip

The supplemental information key-value object MAY contain additional keys as desired.

Reference implementations

The get_admin and set_admin methods, and their associated documentation, form a reference implementation using Python.

Appendices

Appendix 1 - Domain Consistency Element

{
	"specification": {
		"dates": {
			"publication": "2025-10-22"
		},
		"edition": "1",
		"title": {
			"value": "British Antarctic Survey (BAS) Mapping and Geographic Information Centre (MAGIC) Administration Metadata Profile",
			"href": "https://metadata-standards.data.bas.ac.uk/profiles/magic-administration/v1/"
		},
		"contact": {
			"organisation": {
				"name": "Mapping and Geographic Information Centre, British Antarctic Survey",
				"href": "https://ror.org/01rhff309",
				"title": "ror"
			},
			"phone": "+44 (0)1223 221400",
			"address": {
				"delivery_point": "British Antarctic Survey, High Cross, Madingley Road",
				"city": "Cambridge",
				"administrative_area": "Cambridgeshire",
				"postal_code": "CB3 0ET",
				"country": "United Kingdom"
			},
			"email": "magic@bas.ac.uk",
			"online_resource": {
				"href": "https://www.bas.ac.uk/teams/magic",
				"title": "Mapping and Geographic Information Centre (MAGIC) - BAS public website",
				"description": "General information about the BAS Mapping and Geographic Information Centre (MAGIC) from the British Antarctic Survey (BAS) public website.",
				"function": "information"
			},
			"role": [
				"publisher"
			]
		}
	},
	"explanation": "Resource within scope of British Antarctic Survey (BAS) Mapping and Geographic Information Centre (MAGIC) Administrative Metadata Profile.",
	"result": true
}

Appendix 2 - Minimum supported access permissions

Open Access

Grants anyone access to information (i.e. unrestricted and anonymous access).

Used for information that is intended for public release or that does not otherwise need to be restricted.

Property Value Meaning
access_permissions.*.directory * Representing any directory
access_permissions.*.group ~public Representing the opposite of private

BAS Staff access

Grants any BAS staff member access to information, excluding wider UKRI staff.

Warning

This access permission is underpinned by a dynamic group controlled by UKRI. This group's composition criteria are not known, and it is not guaranteed to exclusively contain BAS staff.

Used for information that is restricted internally within BAS (only).

Property Value Meaning
access_permissions.*.directory * Representing any directory
access_permissions.*.group ~bas-staff Representing all BAS staff

Appendix 3 - MAGIC Administrative Metadata Signing Key

Public JSON Web Key (JWK):

{
	"kty":"EC",
	"kid":"magic_metadata_signing_key",
	"alg":"ES256",
	"crv":"P-256",
	"x":"Ksei1ZoTIBRQrJZeNRzdch9910T7hqKjRSqq0wkNxRQ",
	"y":"SykdLryiLm3xNHEiC_OYmB6jzaU1ZtyRv8WfxMIRdJ4"
}

Note

Private key material for this key is available by contacting MAGIC.

Appendix 4 - MAGIC Administrative Metadata Encryption Key

Public JSON Web Key (JWK):

{
	"kty":"EC",
	"kid":"magic_metadata_encryption_key",
	"alg":"ECDH-ES+A128KW",
	"crv":"P-256",
	"x":"n_SWT2v7lyte0Kgdozc8CO_cJNEjW-s7cRR3plMK_wo",
	"y":"e2TioKjehKX_IgGHZ-Zl0q70jv6cANHWToHWQ507e5U"
}

Note

Private key material for this key is available by contacting MAGIC.

{
"$id": "https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/magic-admin-content-v1.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "BAS MAGIC Administrative Metadata Profile v1 content schema",
"description": "Content configuration schema for the BAS MAGIC Administrative Metadata profile (version 1).",
"definitions": {
"access_permissions": {
"title": "Access permissions",
"description": "Groups within a directory that have access to the resource, optionally limited in duration and/or explained via a freetext comment.",
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"directory",
"group"
],
"properties": {
"directory": {
"title": "Directory",
"description": "Identifier for Identity Provider (IdP) or other namespace group is contained within. May use mutually agreed '*' alias if globally applicable.",
"type": "string"
},
"group": {
"title": "Group",
"description": "Identifier for group representing a set of principles granted access to a resource. May use mutually agreed aliases prefixed with '~'.",
"type": "string"
},
"expiry": {
"title": "Expiry",
"description": "Time instant at which access lapses.",
"type": "string",
"format": "datetime"
},
"comment": {
"title": "Comment",
"description": "Freetext context.",
"type": "string"
}
}
}
},
"gitlab_issues": {
"title": "GitLab issues",
"description": "Non-public information, history and/or context captured in GitLab issues about the resource.\n\n",
"type": "array",
"items": {
"type": "string"
}
},
"id": {
"title": "Identifier",
"description": "Distinguishes administrative metadata instances.",
"type": "string"
},
"_schema": {
"title": "JSON Schema",
"description": "JSON Schema keyword indicating the schema a document complies with.",
"type": "string",
"format": "uri-reference",
"const": "https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/magic-admin-content-v1.json"
}
},
"type": "object",
"additionalProperties": false,
"required": [
"$schema",
"id"
],
"properties": {
"$schema": {
"$ref": "#/definitions/_schema"
},
"id": {
"$ref": "#/definitions/id"
},
"gitlab_issues": {
"$ref": "#/definitions/gitlab_issues"
},
"access_permissions": {
"$ref": "#/definitions/access_permissions"
}
}
}
{
"$id": "https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/magic-admin-encoding-v1.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "BAS MAGIC Administrative Metadata Profile v1 encoding schema",
"description": "Metadata record configuration schema for the BAS MAGIC Administrative Metadata profile (version 1).",
"definitions": {
"domain_conformance": {
"title": "Req. 02 - Domain Consistency/Conformance",
"type": "object",
"required": [
"specification",
"explanation",
"result"
],
"properties": {
"specification": {
"type": "object",
"required": [
"title",
"dates",
"edition",
"contact"
],
"properties": {
"title": {
"type": "object",
"required": [
"value",
"href"
],
"properties": {
"value": {
"type": "string",
"const": "British Antarctic Survey (BAS) Mapping and Geographic Information Centre (MAGIC) Administrative Metadata Profile"
},
"href": {
"type": "string",
"const": "https://metadata-standards.data.bas.ac.uk/profiles/magic-administrative/v1/"
}
}
},
"dates": {
"type": "object",
"required": [
"publication"
],
"properties": {
"publication": {
"type": "string",
"const": "2025-10-22"
}
}
},
"edition": {
"type": "string",
"const": "1"
},
"contact": {
"allOf": [
{
"$ref": "#/definitions/magic"
},
{
"type": "object",
"required": [
"role"
],
"properties": {
"role": {
"type": "array",
"contains": {
"type": "string",
"const": "publisher"
}
}
}
}
]
}
}
},
"explanation": {
"type": "string",
"const": "Resource within scope of British Antarctic Survey (BAS) Mapping and Geographic Information Centre (MAGIC) Administrative Metadata Profile."
},
"result": {
"type": "boolean",
"const": true
}
}
},
"domain_consistency": {
"type": "array",
"contains": {
"$ref": "#/definitions/domain_conformance"
}
},
"file_identifier": {
"type": "string"
},
"identification": {
"type": "object",
"required": [
"supplemental_information"
]
},
"magic": {
"type": "object",
"required": [
"organisation",
"phone",
"address",
"email",
"online_resource"
],
"properties": {
"organisation": {
"type": "object",
"required": [
"name",
"href",
"title"
],
"properties": {
"name": {
"type": "string",
"const": "Mapping and Geographic Information Centre, British Antarctic Survey"
},
"href": {
"type": "string",
"const": "https://ror.org/01rhff309"
},
"title": {
"type": "string",
"const": "ror"
}
}
},
"phone": {
"type": "string",
"const": "+44 (0)1223 221400"
},
"address": {
"type": "object",
"required": [
"delivery_point",
"city",
"administrative_area",
"postal_code",
"country"
],
"properties": {
"delivery_point": {
"type": "string",
"const": "British Antarctic Survey, High Cross, Madingley Road"
},
"city": {
"type": "string",
"const": "Cambridge"
},
"administrative_area": {
"type": "string",
"const": "Cambridgeshire"
},
"postal_code": {
"type": "string",
"const": "CB3 0ET"
},
"country": {
"type": "string",
"const": "United Kingdom"
}
}
},
"email": {
"type": "string",
"const": "magic@bas.ac.uk"
},
"online_resource": {
"type": "object",
"required": [
"href",
"title",
"description",
"function"
],
"properties": {
"href": {
"type": "string",
"const": "https://www.bas.ac.uk/teams/magic"
},
"title": {
"type": "string",
"const": "Mapping and Geographic Information Centre (MAGIC) - BAS public website"
},
"description": {
"type": "string",
"const": "General information about the BAS Mapping and Geographic Information Centre (MAGIC) from the British Antarctic Survey (BAS) public website."
},
"function": {
"type": "string",
"const": "information"
}
}
}
}
}
},
"type": "object",
"required": [
"file_identifier",
"identification"
],
"properties": {
"file_identifier": {
"$ref": "#/definitions/file_identifier"
},
"identification": {
"$ref": "#/definitions/identification"
}
}
}
{
"$schema": "https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/magic-admin-content-v1.json",
"id": "f611733b-de39-4cc7-9300-cd6252011efd",
"gitlab_issues": [
"https://gitlab.example.com/foo/bar/-/issues/123",
"https://gitlab.example.com/foo/bar/-/issues/234"
],
"access_permissions": [
{
"directory": "95806d78-8b5b-4451-beda-1f12d735b511",
"group": "66c8e44a-dcc9-43d8-8763-b98496ef42b6",
"expiry": "2024-12-31T23:59:59+00:00",
"comment": "..."
},
{
"directory": "*",
"group": "~public"
}
]
}
{
"$schema": "https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/magic-admin-content-v1.json",
"id": "075a458e-1b53-47cf-998b-d959a725bfe2"
}
{
"$schema": "https://metadata-resources.data.bas.ac.uk/bas-metadata-generator-configuration-schemas/v2/iso-19115-2-v4.json",
"file_identifier": "4c462c77-a123-40e7-8b71-254d3967a601",
"metadata": {
"contacts": [
{
"organisation": {
"name": "Mapping and Geographic Information Centre, British Antarctic Survey"
},
"role": [
"pointOfContact"
]
}
],
"date_stamp": "2024-10-03"
},
"hierarchy_level": "product",
"identification": {
"title": {
"value": "Test product with MAGIC Administrative Metadata"
},
"dates": {
"creation": "2024-09-14"
},
"abstract": "An example product to verify a record with the minimal set of properties required by the MAGIC Administrative Metadata Profile is handled correctly.",
"language": "eng",
"supplemental_information": "...",
"domain_consistency": [
{
"specification": {
"dates": {
"publication": "2025-10-22"
},
"edition": "1",
"title": {
"value": "British Antarctic Survey (BAS) Mapping and Geographic Information Centre (MAGIC) Administration Metadata Profile",
"href": "https://metadata-standards.data.bas.ac.uk/profiles/magic-administration/v1/"
},
"contact": {
"organisation": {
"name": "Mapping and Geographic Information Centre, British Antarctic Survey",
"href": "https://ror.org/01rhff309",
"title": "ror"
},
"phone": "+44 (0)1223 221400",
"address": {
"delivery_point": "British Antarctic Survey, High Cross, Madingley Road",
"city": "Cambridge",
"administrative_area": "Cambridgeshire",
"postal_code": "CB3 0ET",
"country": "United Kingdom"
},
"email": "magic@bas.ac.uk",
"online_resource": {
"href": "https://www.bas.ac.uk/teams/magic",
"title": "Mapping and Geographic Information Centre (MAGIC) - BAS public website",
"description": "General information about the BAS Mapping and Geographic Information Centre (MAGIC) from the British Antarctic Survey (BAS) public website.",
"function": "information"
},
"role": [
"publisher"
]
}
},
"explanation": "Resource within scope of British Antarctic Survey (BAS) Mapping and Geographic Information Centre (MAGIC) Administrative Metadata Profile.",
"result": true
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment