Skip to main content

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:

ResourceDescriptionBrowse
CountriesAll ISO 3166-1 country codes used in UN/LOCODEBrowse
Country SubdivisionsISO 3166-2 administrative divisions (states, provinces, etc.)Browse
FunctionsTransport and facility function classifiers (port, airport, rail, etc.)Browse

Data Model

The vocabulary defines the following classes and properties:

Classes

ClassURIDescription
Countryunlcdv:CountryISO 3166-1 two-letter country code
UNLOCODEunlcdv:UNLOCODEA trade and transport location identified by a 5-character code
Subdivisionunlcdv:SubdivisionISO 3166-2 administrative subdivision
Functionunlcdv:FunctionTransport mode or facility function classifier

Properties

PropertyDomainRangeDescription
unlcdv:countryCodeUNLOCODE, SubdivisionCountryLinks to the ISO 3166-1 country
unlcdv:countrySubdivisionUNLOCODESubdivisionLinks to the ISO 3166-2 subdivision
unlcdv:functionsUNLOCODEFunctionTransport/facility function codes
unlcdv:subdivisionTypeSubdivisionstringType of administrative division

Namespaces

PrefixURI
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.