How to test JSON-LD contexts in a freight integration
On JSON-LD interfaces, compare the expanded meaning of a field, not just the short key. A change to the context can change what a familiar field means; different aliases can also refer to the same term.
Keep JSON structure and term meaning separate.
The W3C JSON-LD 1.1 recommendation describes how contexts map terms to identifiers and how document expansion makes those meanings explicit. Agree which reviewed context and vocabulary versions the receiver supports. For an integration test, use pinned, reviewed context resources rather than relying on uncontrolled changes during a build.
Two fields have the same short name but different meanings.
Two synthetic documents use the key location. After expansion, one refers to where an event occurred and the other refers to a planned delivery location. Keep both meanings separate in the mapping. Conversely, if two aliases expand to the same term, compare their values and scope before declaring a mismatch.
Detect meaning changes without guessing.
- Test a familiar term mapped to a different identifier and a changed alias mapped to the same identifier.
- Hold an unresolved context or unknown term for review rather than silently dropping data.
- Treat successful expansion as a semantic processing result, not a business-rule, partner acceptance or compliance outcome.