Synopsis
Description
dms export converts DMS JSON records to JSON-LD format using the official DMS context (schema/dms.jsonld). The output embeds @context, maps each record’s type field to a matching Schema.org @type, wraps creators with foaf:Person, and wraps locations with schema:Place.
- Single-record export — wraps one record in a standalone JSON-LD document.
- Directory export — wraps all records in a single
@graphdocument. Individual@contextdeclarations are stripped from graph members so the shared context at the root applies to the whole collection.
.jsonld extension by convention.
Type mapping
| DMS type | Schema.org @type |
|---|---|
story | schema:Article |
photo | schema:Photograph |
document | schema:DigitalDocument |
audio | schema:AudioObject |
video | schema:VideoObject |
event | schema:Event |
map | schema:Map |
artwork | schema:VisualArtwork |
site | schema:Place |
poem | schema:CreativeWork |
dms:HeritageRecord as a second @type value.
Options
Path to a single DMS
.json file. Can be a single record object or a JSON array. Optional when --dir is used.Directory of
.json files to export as a single @graph document. Optional when FILE is provided.Output file path.
- Single file: defaults to the input path with
.jsonldextension (e.g.,poem_abc123.jsonld). - Directory: defaults to
DIRECTORY/collection.jsonld.
Output structure
- Single record
- @graph collection
Examples
Notes
The DMS JSON-LD context file must be present at
schema/dms.jsonld relative to your project root. If it is missing, the export will fail with a FileNotFoundError.