Getting Started
This guide takes you from a raw CWR EDI file to a CWR-JSON document in three steps. Build your own converter from the schema, or try the CWR-JSON Playground first.
Step 1. Know what maps
CWR-JSON v1.0 covers:
NWR/REVwork registration transactions- Related detail records (
ALT,NAT,SPU/OPU,SWR/OWR,PWR,SPT/OPT,SWT/OWT,REC,ARI,XRF,MSG)
Acknowledgement (ACK) transactions map to a work with messages.type: "ack", flat ACK fields on messages, and MSG rows in messages.msgs[]. Nested NWR/REV detail still fills titles, identifiers, parties, and flags.
Step 2. Convert
A converter does three things:
- Parse each fixed-width CWR line into its fields, using the CWR 2.x record layouts (each field at its exact byte offset).
- Map the fields of each transaction to one entry in
works[], following the field tables in this specification (Header Metadata, Work Metadata, Interested Parties, Sound Recordings, CWR two-way conversion). - Write the result as one JSON object with
headerandworks.
To see the expected result for your own files before you build a converter, upload a CWR file (.cwr, .v21 or .v22) to the CWR-JSON Playground .
Step 3. Validate
Validate every file against the published JSON Schema and the semantic rules (see Schema Validation):
cwr-json-schema-v1.0.schema.json
Minimal valid document
Source CWR (one NWR with an ISWC and a submitter work number):
HDR00000000001XRF SAMPLE PUBLISHER 02.202026063012000020260630
GRHNWR0000102.20
NWR0000000100000000XRF IDENTIFIER DEMO WORK SW00000000001 T0000000010 POP U ORI
CWR-JSON (passes the published JSON Schema and the semantic rules in strict mode):
{
"header": {
"senderIdentifier": "00000000001",
"senderName": "XRF SAMPLE PUBLISHER",
"creationDate": "20260630",
"creationTime": "120000"
},
"works": [
{
"messages": {
"type": "nwr",
"schema": "CWR-JSON Schema v1.0",
"schemaDescription": "Complete canonical representation with both ownership and collection data. This schema preserves all CWR semantics including hierarchical ownership chains and territorial collection splits."
},
"flags": {},
"titles": [
{ "value": "XRF IDENTIFIER DEMO WORK", "type": "TT" }
],
"identifiers": [
{ "iswc": ["T-000.000.001-0"] },
{
"type": "submitterWorkId",
"value": "SW00000000001",
"source": { "type": "cwrSubmitter", "value": "00000000001", "name": "XRF SAMPLE PUBLISHER" }
}
],
"parties": [],
"recordings": []
}
]
}- The
NWRISWCT0000000010becomes one{ "iswc": [...] }entry, written in dotted formT-NNN.NNN.NNN-C. - Empty
flags,partiesandrecordingsare optional. Writing them empty or omitting them are both valid. NWR.SubmitterWorkNumberbecomestype: "submitterWorkId".source.valueandsource.namecome from theHDRsender identifier and sender name.messages.schemaandmessages.schemaDescriptionare required on every work.
More complete documents (parties, territories, recordings, ACK) are on the Examples page.
Do not add a root
$schemaproperty. The format1.0.1schema does not allow extra root properties, so a file with$schemafails validation (EXTRA_PROPERTY). See Schema Validation.
Updated 18 days ago