Skip to main content

Synopsis

dms export FILE [--output FILE]
dms export --dir DIRECTORY [--output FILE]

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 @graph document. Individual @context declarations are stripped from graph members so the shared context at the root applies to the whole collection.
The output files use the .jsonld extension by convention.

Type mapping

DMS typeSchema.org @type
storyschema:Article
photoschema:Photograph
documentschema:DigitalDocument
audioschema:AudioObject
videoschema:VideoObject
eventschema:Event
mapschema:Map
artworkschema:VisualArtwork
siteschema:Place
poemschema:CreativeWork
All records also carry dms:HeritageRecord as a second @type value.

Options

FILE
path
Path to a single DMS .json file. Can be a single record object or a JSON array. Optional when --dir is used.
--dir
path
Directory of .json files to export as a single @graph document. Optional when FILE is provided.
--output
path
default:"derived from input"
Output file path.
  • Single file: defaults to the input path with .jsonld extension (e.g., poem_abc123.jsonld).
  • Directory: defaults to DIRECTORY/collection.jsonld.

Output structure

{
  "@context": { ... },
  "@type": ["dms:HeritageRecord", "schema:CreativeWork"],
  "@id": "urn:dms:3f8a1c2b-...",
  "dc:identifier": "3f8a1c2b-...",
  "title": "A Poem About Home",
  "creator": [
    { "@type": "foaf:Person", "name": "Espérance M." }
  ],
  "location": {
    "@type": "schema:Place",
    "name": "Dzaleka Refugee Camp"
  }
}

Examples

dms export records/poem_abc123.json
# writes records/poem_abc123.jsonld

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.
Use the directory export to produce a single collection.jsonld that can be submitted to knowledge graph platforms or published as a Linked Open Data dataset.