JSON-LD → EN 18223 Digital Product Passport

A Digital Product Passport under CEN/CENELEC EN 18223 is plain JSON, and it falls out of data you may already publish: good GS1 Web Vocabulary, addressed by a GS1 Digital Link. Choose a product sample on the left, or paste your own, and press Derive.

Each property becomes an EN 18223 DataElement. Its dictionaryReference is the property's own vocabulary IRI, wherever the term is defined, whether GS1, schema.org, or the OpenEPCIS extensions at ref.openepcis.io, and its valueDataType is the range the ontology declares for it. The passport's granularity follows the Digital Link Application Identifiers: a GTIN on its own describes a model, a GTIN with a lot number a batch, a GTIN with a serial an item. contentSpecificationIds then lists the dictionaries the passport actually draws on.

The View dropdown on the right shows the result three ways. EN 18223 gives the passport two JSON serializations, an expanded form (Annex A, an array of explicit data elements) and a compressed form (the same content as ordinary key-value JSON), and both are plain JSON. The third view, JSON-LD expanded, is the input run through standard JSON-LD processing, so you can watch each term resolve to the IRI that becomes its dictionaryReference. EN 18223's own use of expanded and compressed is a separate idea from that JSON-LD step. Everything is bundled, so it runs in your browser with no network. The conversion is explained in full below.

Input · GS1 Web Vocabulary JSON-LD

Output


    

How the conversion works

The page runs each example through the same steps a repository would. It first expands the input with standard JSON-LD processing, which replaces every shorthand key with the full IRI of the term it stands for. That IRI is what EN 18223 calls a dictionaryReference. The JSON-LD expanded view shows this stage directly, so you can see that netWeight is https://ref.gs1.org/voc/netWeight while a recycled-content figure resolves under an OpenEPCIS extension.

EN 18223 is deliberately permissive about what that reference may be. It types dictionaryReference as a plain string and asks only that each definition carry a unique identifier that occurs once within its repository (clause 4.3), with the stated aim of staying open to different technologies; even digitalProductPassportId only should use a URI/URL structure. The identifier need not be resolvable on the web. A resolvable web IRI of the kind GS1 issues is one option; an opaque identifier such as an IRDI (the IEC 61360 / eCl@ss style used by the Asset Administration Shell, for example 0173-1#02-AAO677#002) is equally valid under the standard, even though you cannot fetch it over HTTP. GS1 is stricter in a way that pays off: a GS1 Digital Link and a GS1 Web Vocabulary term are HTTPS URLs you can dereference. This derivation keeps that web-native property, so every dictionaryReference it emits is an IRI you can open in a browser to retrieve the definition behind it.

From that expanded graph the converter assembles the EN 18223 information model. Each property becomes a DataElement with its dictionaryReference, a valueDataType read from the ontology's declared range, and a value. A nested object such as a quantity or a carbon-footprint breakdown becomes a DataElementCollection; a list of values becomes a multi-valued element; a coded value or a document reference is carried as a single value or a RelatedResource. Around the data the envelope is filled in: the unique identifier and granularity from the Digital Link, the schema version, and the contentSpecificationIds the data drew on.

The finished model prints in either EN 18223 serialization. The expanded form (Annex A) keeps every data element explicit, which suits validation and machine processing; the compressed form folds the same content back into ordinary key-value JSON that reads easily. The View dropdown only reformats the passport, so switching is instant.

None of this is written per product. The mapping follows from good GS1 Web Vocabulary and the published ontology, so the battery, textile, electronics, deforestation, packaging, construction, detergent, and food examples all pass through the identical code.