Web Vocabulary (JSON-LD)
The UN/LOCODE Web Vocabulary is a linked data representation of UN/LOCODE, published as JSON-LD using the UNCEFACT vocabulary namespace. It provides machine-readable, semantically rich access to the full code list — countries, locations, subdivisions, and function codes — as part of the UN/CEFACT Buy-Ship-Pay Reference Data Model.
Browse the Vocabulary
The vocabulary is hosted at vocabulary.uncefact.org and provides browsable views of:
| Resource | Description | Browse |
|---|---|---|
| Countries | All ISO 3166-1 country codes used in UN/LOCODE | Browse |
| Country Subdivisions | ISO 3166-2 administrative divisions (states, provinces, etc.) | Browse |
| Functions | Transport and facility function classifiers (port, airport, rail, etc.) | Browse |
Data Model
The vocabulary defines the following classes and properties:
Classes
| Class | URI | Description |
|---|---|---|
| Country | unlcdv:Country | ISO 3166-1 two-letter country code |
| UNLOCODE | unlcdv:UNLOCODE | A trade and transport location identified by a 5-character code |
| Subdivision | unlcdv:Subdivision | ISO 3166-2 administrative subdivision |
| Function | unlcdv:Function | Transport mode or facility function classifier |
Properties
| Property | Domain | Range | Description |
|---|---|---|---|
unlcdv:countryCode | UNLOCODE, Subdivision | Country | Links to the ISO 3166-1 country |
unlcdv:countrySubdivision | UNLOCODE | Subdivision | Links to the ISO 3166-2 subdivision |
unlcdv:functions | UNLOCODE | Function | Transport/facility function codes |
unlcdv:subdivisionType | Subdivision | string | Type of administrative division |
Namespaces
| Prefix | URI |
|---|---|
unlcdv: | https://vocabulary.uncefact.org/unlocode-vocab/ |
unlcd: | https://vocabulary.uncefact.org/unlocode# |
unlcdc: | https://vocabulary.uncefact.org/unlocode-countries# |
unlcdf: | https://vocabulary.uncefact.org/unlocode-functions# |
unlcds: | https://vocabulary.uncefact.org/unlocode-subdivisions# |
Accessing via Content Negotiation
The vocabulary supports content negotiation. To retrieve JSON-LD programmatically:
curl -H "Accept: application/ld+json" https://vocabulary.uncefact.org/unlocode-vocab-context.jsonld
Example Entry
A single UN/LOCODE entry in JSON-LD:
{
"@id": "unlcd:GBLON",
"@type": "unlcdv:UNLOCODE",
"rdf:value": "GBLON",
"rdfs:label": { "@language": "en", "@value": "London" },
"unlcdv:countryCode": { "@id": "unlcdc:GB" },
"unlcdv:functions": [
{ "@id": "unlcdf:1" },
{ "@id": "unlcdf:5" }
]
}
Relationship to SKOS
The Web Vocabulary uses a custom UNCEFACT ontology (unlcdv:) tailored to the UN/LOCODE data model. UN/LOCODE is also available as a SKOS vocabulary using W3C standard terms, which provides broader interoperability with generic semantic web tools. The two formats complement each other:
- Web Vocabulary (JSON-LD) — rich, domain-specific model using UNCEFACT classes and properties
- SKOS (Turtle) — standard code list format understood by any SKOS-aware tool
Both use the same vocabulary.uncefact.org URI space, ensuring concepts are consistently identified across formats.