Mapper
Quickly transform your data
Mapping at a glance
Section titled “Mapping at a glance”A mapping is itself a document, pairing each target location with the source that fills it:
/citation/title: /title/citation/doi: source: /ids find: eq: { idType: doi } pointer: /value/citation/authors: source: /contributors each: /family: /surnameGiven an input:
{ "title": "On Mapping", "ids": [ { "idType": "issn", "value": "2049-3630" }, { "idType": "doi", "value": "10.1000/xyz123" } ], "contributors": [{ "surname": "Hopper" }, { "surname": "Noether" }]}applying the mapping:
import Mapper from '@christiansmith/mapper-js'
const mapper = new Mapper({}, { initializers: {}, transformers: {}, plugins: {} })const { valid, errors, ...result } = await mapper.map(mapping, input)produces:
{ "citation": { "title": "On Mapping", "doi": "10.1000/xyz123", "authors": [{ "family": "Hopper" }, { "family": "Noether" }] }}Every example in these docs, including this one, is executed against the published implementation as part of the site’s test suite.
Find your way
Section titled “Find your way”TutorialsLearning-oriented lessons that take you from installation to a running mapping server.
How-to guidesTask-oriented recipes for problems you already have.
ReferenceInformation-oriented descriptions of every keyword, the context, and the APIs.
ExplanationUnderstanding-oriented discussion of the mapping model and its design.
The family
Section titled “The family”One language, three published pieces. Mappings written for the engine run unchanged behind the plugin and the server:
mapper-jsThe engine: evaluation and mapping validation. Start at the tutorials.
mapper-requestHTTP fetching as a plugin, with policy fixed at construction.
mapper-httpA standalone image serving mappings over HTTP.
The specificationThe normative source: RFC-style requirements and the conformance suite.