Introduction
This section and its subsections are informative
GS1 defines a wide range of identifiers that underpin supply chains and many industries across the world. This document assumes the reader is familiar with these and the concept of GS1 Application Identifiers. If not, please see information on [GS1 Identification Keys] and the [GENSPECS] for further background.
This work has been motivated by a number of trends. For example: the desire among retailers to move to 2D barcodes that can carry more information than just the GTIN; the problems of multiple barcodes causing scanning errors through conflicts which suggests a need for a single but multipurpose barcode; the growing expectation among consumers and patients that more information is available online about the products they’re considering buying or using; the brand owner concept of the pack as a media channel linking to multimedia experiences and more.
A GS1 Digital Link URI identifies the entity (the product, the location, the asset etc.). When looked up online, best practice [DLBP] is to redirect from that entity identifier to a source of related information. A simple 1-to-1 redirect does not require any special software – it’s a basic function available on all Web servers. However, using a GS1-Conformant Resolver, it is possible to link that single entity to multiple sources of related information in a way that is machine-discoverable and machine-actionable.
The resolution functions defined in the current document are what brings that vision to life and allows easy communication between business partners and consumers in a manner that is scalable, interoperable and that does not require all related assets to be aggregated in one place. The GS1-Conformant Resolver standard is based entirely on existing standards and techniques defined by the Internet Engineering Task Force (IETF) and the World Wide Web Consortium (W3C). The standard enables implementers to benefit from the network effect.
Alternative approaches
The existence of this standard does not mean that all GS1 Digital Link URIs must be connected to a GS1-Conformant Resolver. Neither is it a requirement that all GS1 Digital Link URIs must redirect, although this is strongly recommended. There are solid reasons for this recommendation.
A GS1 Digital Link URI identifies the entity itself. Management of that identity is a separate process from managing any digital information about the entity and will typically be carried out by different people. For example, a GTIN identifies a trade item, and that identifier is used in various business processes. Online information about the trade item will often be managed by a brand marketing team, or those responsible for product information leaflets or instructions for use in healthcare, who will introduce new content, delete or move old content, will run promotions, medical product information, etc. Redirecting from the trade item to online product information avoids any tension between multiple management processes. The redirect can be updated at any time without affecting or needing to reprint the GS1 Digital Link URI encoded on the product. This helps to ensure that the GS1 Digital Link URI continues to function as a persistent identifier for the trade item, even though the online information changes over time.
Whether redirection is implemented or not, there are many ways to make use of GS1 identifiers within a GS1 Digital Link URI that do not require the use of a GS1-Conformant Resolver. Any Web-based application can parse the GS1 Digital Link URI and make use of the available AIs and their values. To take a simple example, if the GS1 Digital Link URI includes an expiry date that has passed, a Web page presented to the user might include a warning that is absent for products that have not expired.
Developers are encouraged to make use of the GS1 Barcode Syntax Resource [BSR] when building applications that scan, parse or validate GS1 identifiers.
Even if presenting a simple Web page containing information about the identified entity, any links from that page to further information can be annotated with the machine-readable link types discussed in this document. This can help the automatic discoverability of all information related to the identified entity.
Typographical conventions used in this document
This document includes sample JSON objects and examples of GS1 Digital Link URIs such as:
https://example.com/01/{gtin} and
https://example.org/414/{gln}/254/{glnExtension}
https://example.org/01/{gtin}{?exp}
The use of the monospace font indicates that the text has meaning for computers.
Example URIs follow the convention used in Template URIs [RFC 6570]. The places where the values of variables should be inserted are written in braces, so, for example, {gtin} means "insert the 14 digit GTIN here". All other text in the URI is a literal string to be used as written.
As explained in [RFC 2606] and [RFC 6761], the domains example.com, example.org and example.net are second-level domain names reserved by the Internet Assigned Numbers Authority (IANA) for use in documentation, along with the .example top level domain name. These should be understood as a placeholder for any registered domain name.
Terminology
In AIDC (Automatic Identification and Data Capture), the term 'qualifier' is used for the short string of characters that declare the type of identifier that follows. For example, '01' is the qualifier that precedes a string of 14 digits that makes it recognisable as a GTIN. GS1's Application Identifiers are one type of qualifier. ANSI MH10.8.2 Data Identifiers are another (both are conformant with ISO/IEC 15418). In AIDC, the actual identifier itself is called 'data'.
In common with the GS1 Digital Link URI syntax standard [DL-URI], this standard uses the term 'key qualifier' to mean an extension that provides more fine-grained identification that the primary key. For example, a GTIN is a primary key, and a batch/lot is a 'key qualifier'; a GLN is a primary key, a GLN extension is a key qualifier.
Resolving GS1 identification keys
This section and all its subsections are normative, except where explicitly stated otherwise.
A GS1-Conformant Resolver connects a GS1-identified object or entity to one or more online resources that are directly related to it. The object or entity may be identified at any level of granularity, and the resources may be either human- or machine-readable. Examples include product information pages, instruction manuals, patient leaflets and clinical data, product data, service APIs, marketing experiences and more. By adhering to a common protocol based on existing GS1 identifiers and existing Web technologies, each GS1-Conformant Resolver is part of a coherent, yet distributed, network of links to information resources. The remainder of this document defines the minimum set of requirements of a GS1-Conformant Resolver that make this vision possible.
In common with GS1 Digital Link URI syntax [DL-URI] the GS1-Conformant resolver standard is itself conformant with Encoding and resolving identifiers over HTTP [ISO/IEC 18975]
Support for GS1 identifiers
A GS1-Conformant Resolver does not need to support all GS1 primary identification keys. It may support just a subset. For example, a GS1-Conformant Resolver may support just GTIN, or GTIN and GLN, etc. However, for each supported primary identification key, all its key qualifiers and data attributes SHALL be fully supported. See section 2.5.9 for more on this topic and section 3 for how to declare the primary identification keys a GS1-Conformant Resolver can support.
Core GS1-Conformant Resolver functionality
A GS1-Conformant Resolver SHALL operate according to the relevant standards that define HTTP 1.1 or higher for GET, HEAD and OPTIONS requests and SHALL support HTTP over TLS [RFC2818]. On top of HTTP, a resolver SHALL also implement Cross-Origin Resource Sharing [CORS] to allow client-side JavaScript Web applications to access the resolver across domains. The GS1 identification keys are expressed as a GS1 Digital Link URI [DL-URI] which is the input to the resolver.
This specification adds additional functionalities that define a GS1-Conformant Resolver. In summary, these are:
- Decompression: Decompress the request URI if necessary (the request URI is the URI received and processed by the resolver).
- Basic validation: Like any software that accepts user input, the resolver will need to carry out basic checks on the request URI and extract the GS1 Application Identifiers and values from the path.
-
Providing links:
- Provide links to resources related specifically to the entity identified by the GS1 identification keys (hereafter called the identified entity) up to and including links registered at the requested level of granularity.
- One of the links SHALL be recognised by the resolver as the default and the resolver SHALL redirect to that URL unless there is information supplied within the query to the contrary. Such information may be provided in the HTTP Request headers and/or by setting a
linkTypeparameter in the query string of the request URI indicating the type of link desired. If a link to a resource of the requested type is known to the GS1-Conformant Resolver, it SHALL redirect to that resource immediately. - If the value of
linkTypeis set tolinkset, or the HTTP Accept header is set toapplication/linkset+json, then the resolver SHALL NOT redirect but SHALL return a full list of links available to the client, following the Linkset standard [RFC 9264] (see section 2.9)
- Deep validation: A resolver MAY carry out detailed validation on the request URI and include the analysis when reporting an error.
Each of these is expanded upon with important detail in the following sections. The flowchart below provides a visual summary of the basic functionality of a GS1-Conformant Resolver.
One aspect of the flowchart to note is that at several of the decision points, the question arises of whether there is information at a less-granular level. This refers to primary keys that can be qualified by more granular identification. The most important example of this is the GTIN which can be extended by a Consumer Product Variant, batch/lot and serial number. Given a GS1 Digital Link URI that includes, for example, a GTIN and a serial number, a GS1-Conformant Resolver will often need to take note of links recorded at both the serial number and GTIN level. Sections 2.5.9 and 2.5.10 are particularly relevant for this discussion.
Decompression
The original GS1 Digital Link URI standard [DL1.1] defined how such a URL can be compressed into a form that uses fewer bytes to encode the same data. As the algorithm is lossless, compressed GS1 Digital Link URIs can be decompressed. An important feature of the compression/decompression algorithm is that it does not affect the domain name used and that the compressed GS1 Digital Link URI is still a valid URL. This means that a compressed GS1 Digital Link URI can be looked up on exactly the same resolver with exactly the same result as its uncompressed equivalent.
EPC binary, as defined in the Tag Data Standard [TDS], is a very compact encoding of GS1 identifiers that can be decoded into a GS1 Digital Link URI as defined in the Tag Data Translation standard [TDT].
The original compression algorithm and EPC binary strings do not clash as EPC binary strings, when represented as compressed GS1 Digital Link URIs, are prefixed with ex or eh. Full details are provided in GS1 Digital Link URI: Compression Technical Standard for EPC binary strings [EPCB].
EPC binary is a recognised syntax for GS1 identifiers in open supply chains whereas the broader GS1 Digital Link compression method is not. This situation is not expected to change. Therefore a GS1-Conformant resolver SHALL decompress EPC binary strings [EPCB] and MAY implement the full GS1 Digital Link decompression algorithm [DL1.1].
Any linkset returned from a GS1-Conformant resolver SHALL use the decompressed form as the anchor for all links, not the compressed form. If redirecting to another resolver, the redirecting GS1-Conformant Resolver SHOULD redirect the uncompressed URI.
Validation
The system architecture that stores links used by the resolver is not defined by this standard, but it is very likely to be a database in which links are associated with the relevant GS1 identifiers. In order to maximise the performance of the outward-facing resolver service, it is assumed that data will be validated when ingested into the system. That is, it SHOULD be impossible to register a link against an invalid GS1 identifier or set of identifiers. This means that at run time the resolver can simply check whether it has one or more links for a given identifier without having to carry out detailed validation of those identifiers. If links are found, the GS1 identifiers will be known to be valid.
However, basic validation steps will need to be carried out by the resolver before looking up whether it has any associated links. This is necessary to make sense of the incoming request and to avoid, for example, passing control characters to a database. Basic validation should be based on rules codified in the GS1 General Specifications [GENSPECS] that change at a very slow pace over time, if at all. They can be carried out in such a way that they allow for new AIs that are not defined at the time the resolver was built. The following basic tests are recommended and should be carried out before looking for links associated with the GS1 keys included in the request URI.
- Overall plausible URI structure:
- <scheme>://<domain.name>/<stem>/<primary key AI>/<primary key>/possible-further AI+value-pairs> (the query string is ignored by resolvers).
- Percent encoded characters within the path are decoded prior to performing the AI and AI data checks outlined in the following points.
- AIs per AI definitions:
- Are numeric and between 2 to 4 digits long
- Overall AI length is consistent with other AIs, where there is a prefix match; the rule is that all AIs with same 2-digit prefix have identical length e.g., AI (24) is not valid because (240) exists.
- AI data per AI definitions:
- Overall AI data length meets specifications (after percent decoding)
- Belongs to character set 39, 82 or 64
- Raw AI data belongs to superset of character set 39 and 82 if AI unknown
- Overall check calculation - numeric or character pairs
- Data format checks with component level breakdown e.g., GCP structure
- If duplicate AI found, check values are the same (note, this can occur when multiple barcodes are scanned from a single entity and element strings are concatenated for processing as a GS1 Digital Link URI e.g., shipping labels)
If a request URI can be parsed into its component AIs and their values, and all the above tests are passed, then finding one or more links associated with those identifiers will be sufficient to show that it is valid.
The following tests are based on specifications that change at a medium pace. Implementations MAY include these as part of their basic validation steps and are encouraged to do so:
- GS1 Digital Link primary key validity (is the left-most AI in the request URI a primary key?)
- GS1 Digital Link key qualifier valid for primary key (are any qualifiers valid for the primary key?)
Further tests MAY be carried out but SHOULD only be done before reporting an error and not for all request URIs. These tests make use of specifications that can change at a relatively fast pace due to periodic standards maintenance activities. Therefore real time lookups and active management of the resolver's codebase MAY be required.
- AIs are known, as new AIs are introduced
- Test for mandatory AI pairings
- Test for invalid AI pairings
- Validation and lookup of externally managed codes or numbering systems (e.g., IBAN leading country code, ISO/IEC general country and currency code etc.)
- Media Type lookup (see section 2.5.5 for further information on content Media Type)
- Ad hoc component validation, e.g., winding rule components (8001)
- Consider inspecting and validating AIs and their values in the query string if present, especially if the resolver makes use of those AIs and their values in its decision-making process.
Differentiating between error conditions
If the resolver cannot provide a response for the incoming request URI there are two primary reasons why this might be so:
- The resolver has no information about the identified entity.
- The tests enumerated above are not passed, meaning that the request URI is not a valid GS1 Digital Link URI both in terms of its overall syntax and the syntactic validity of the identifier keys [DL-URI].
It is important, from a developer perspective, that the resolver differentiates between these two error conditions. If the request URI fails any of the tests then the resolver SHALL respond with an HTTP response code of 400 (Bad Request) [RFC9110]. The error report may be enhanced with the diagnostic information gathered from the final set of tests.
If the request URI is a syntactically valid GS1 Digital Link URI, but the resolver has no information about the identified entity then it SHALL return a simple 404 Not Found response.
There are other scenarios where the GS1-Conformant Resolver is not able to provide any service for the identified entity. In these cases, other HTTP response codes are likely to be appropriate. What is essential is that a GS1-Conformant Resolver SHALL NOT use a 200 OK response code when processing a query that, for whatever reason, causes an error condition.
The GS1 Barcode Syntax Resource
This subsection is informative
The GS1 Barcode Syntax Resource [BSR] is a set of tools for solution providers, that enables the consistent understanding of each GS1 barcode syntax, including the GS1 Digital Link URI, for the purpose of converting between each syntax. To facilitate the various syntax conversions, the BSR provides a means to validate GS1 keys, associated AIs as well as each GS1 barcode syntax. This includes a software library and routines which can be adapted as required, to implement the tests enumerated in the previous section.
Link attributes – what a resolver needs to know
The function of a GS1-Conformant Resolver is to provide links to resources related to the identified entity and, in many situations, immediately redirect requests to the particular requested user experience. In order for such resolvers to be able to match requests to available links, and for applications to automatically navigate those links without having to present the user with potentially confusing choices, it is necessary that each link stored in the resolver is accompanied by standardised metadata.
Three of the attributes are mandatory:
- The target URL itself.
- The link relation type, i.e., the relationship between the identified entity and the linked resource, such as a product information page, a warranty registration page, a related video etc.
- A title for the link that can be displayed to end users.
Further attributes for the links may be applied to links stored in the resolver. This can be useful to disambiguate links that have the same mandatory attributes and be used by applications to follow links of most relevance to their users. The most useful of these is the human language of the target resources and this SHOULD be supported. Other attributes that MAY be supported are:
- The media type for the content (
text/htmlfor HTML,application/jsonfor JSON,application/ld+jsonfor JSON-LD etc.). - The ‘context’ in which a link is most appropriate, such as a particular territory or usage.
More detail on each of these attributes is provided in the following sections.
How this data is stored and managed within a GS1-conformant resolver is up to the implementation. Section 2.9 describes how to expose this data for use by other applications.
The target URL
This is the link itself and therefore SHALL be provided. Wherever possible, it should be the URL of a resource that is directly relevant to the identified entity and not a general page such as a manufacturer’s homepage or a set of search results. The resource identified by the target URL is known as the target resource.
Resolvers MAY support the definition of target URLs using templates or rules so that the target can be computed from information in the incoming query. This is particularly relevant for granular identifiers, such as a batch or serial number of a given GTIN, or the serial component of a GRAI, GIAI, SSCC etc.
Implementations may use any method to achieve this.
One possible method is to use URI Templates [RFC6570]. This is a compact way to define URL rewrite rules that can cover an arbitrarily large number of request URIs with the GS1 identifiers within them used in the substitution. A GS1 Digital Link URI such as https://example.com/01/09520123456788/10/ABC within a conformant resolver might create internal name/value pairs of
01 : 09520123456788
10 : ABC
Within a template URL, the name of the key is replaced by its value in the substitution, such that a template URL of
https://brand.example/infoPageAboutThisThing?batch={10} expands to https://brand.example/infoPageAboutThisThing?batch=ABC (GTIN is not used as the target's base URL is already product-specific)
Applying the rules in RFC6570 in a GS1-Conformant Resolver context we see that
https://api.example{?01,10} expands to https://api.example?01=09520123456788&10=ABC and https://api.example{?01,10,21} also expands to https://api.example?01=09520123456788&10=ABC&21= (there is no value for '21')
An alternative approach might be to treat all path segments after the primary key in the request GS1 Digital Link URI as a single 'qualifierPath'. In this approach, the user defines one or more variable names of their own that are then used in the target URL.
For example: “qualifierPath”: “/10/{myLot}/21{mySerial}”
In the responses section of that same payload, the target URL MUST have the same template variables used. For example: “targetUrl”: “https://example.com/myapp?gtin=0952012234567&lotnumber={myLot}&serialnumber={mySerial}”
Taking this approach means that the primary key is never substituted since all substitutions are based on the 'qualifier path'. The rule is applied to a specific primary key which, as in the example given, is hard-coded in the rule.
GS1-Conformant Resolvers are not required to handle any query string included in the request URI, except in the limited way described in section 2.12. For this reason, target URLs expressed as URI templates SHOULD NOT make any use of parameters in the incoming query string.
See also Pattern-based redirection to an alternative resolver, section 2.8.
The link relation type (link type)
Links SHALL be annotated with information describing the kind(s) of resource available by following the link. This is known as the link relation type which we abbreviate to link type. The relationship(s) SHOULD be given as a URI defined in the GS1 Web vocabulary [GS1Voc]. Section 2.14 discusses supported link types in more detail. If the GS1-defined link types are not suitable, then you MAY use your own URI which should dereference to information about the relationship. Using this method is likely to greatly reduce interoperability, however. It is therefore much better to seek to add terms to the GS1 Web vocabulary. See section 2.14 for more on this topic.
Resolving the GTIN of a product might return links with types such as
-
gs1:hasRetailers(with a target URL that points to information about where the product can be purchased) -
gs1:allergenInfo(with a target URL that points to allergen information)
If the target URL points to a resource that fulfils a number of roles, such as a product information page that includes nutritional and allergen information, then more than one link type can describe the link.
The use of compact URIs (CURIEs), such as the gs1: prefix, is discussed further in section 2.14.
It is not an error for resolvers to offer multiple links of the same type, even if the linked resources are in the same (human) language or machine-readable representation. This might happen, for example, when a product is linked to multiple conformance certificates or an organisation is linked to multiple social media channels.
Note: elsewhere in this document we use ‘link type’ as a shorthand for link relation type not the media type as described below.
A title for the link
A human readable title SHALL be provided for use in applications that present links as options for an end user to follow. This is a natural language text string that can be in any language. It SHOULD be in the same language as the destination resource. GS1-Conformant Resolvers MAY support the provision of multiple titles in different languages where target resources are themselves multilingual.
The human language of the linked resource
For human-readable resources, such as Web pages, or data that contains text strings in a specific language, hints concerning the language(s) used in that resource MAY be provided. If this is done, the language SHALL be provided in accordance with IETF Best Current Practice for identifying languages [BCP47], as listed by IANA. Multiple language tags can be applied where the target resource is itself multilingual. Note that standard Web technologies include the ability for a client (such as a browser) to indicate the user's language preferences at the HTTP level and for a server to return a resource from a single URL in one of a choice of available languages. Different URLs for each language version of the same resource is common on the Web but unnecessary. When encoded in a linkset, the language(s) SHALL be provided in an array, even if there is only a single value (see Section 2.10).
The Media Type for the content
Links MAY be annotated with a hint about the likely format (the serialisation) of the linked resource. If this is done, Media Types SHALL be used for this, such as text/html, application/json, application/ld+json etc. The normative list of Media Types is maintained by IANA [IANA MT].
The context
The previous link attributes (target URL, link relation type, language and media type) are standard attributes for any link on the Web (written as href, rel, hreflang and type respectively). In addition to these, the context parameter MAY be used to disambiguate further between multiple links that match the given link type. Examples:
- A food product might link to multiple recipe pages and the context parameter might distinguish between different sub-categories like vegetarian, vegan, gluten-free etc.
- Information about a product may vary slightly between different territories.
- A link to availability and price information might use the context parameter to distinguish between different retailers.
- The GS1 Lightweight Messaging Standard for Verification of Product Identifiers [LMS] provides a concrete example: it envisages that when using the
gs1:verificationServicelink type, thecontextparameter can be set to a specific value such asdscsaSaleableReturnto indicate that a verification service for product identifiers should be configured to use a profile defined by the US Drug Supply Chain Security Act; Saleable Returns, whereas a different value of thecontextparameter would cause the target resource to use a different profile, e.g., for a different jurisdiction or regulatory regime.
The value space of the context parameter is not defined in this specification and resolvers are not obliged to support it. For resolvers that do recognise it, the resolver description file (section 3) SHOULD declare this and provide values that it recognises in one or other of the following ways:
- by enumerating recognised values;
- by linking to an external list of values.
- As noted in section 2.10, values should be expressed in an array within the linkset (in the same way languages are).
Examples of the use of the context parameter are included in section 2.7.
Additional attributes
GS1-Conformant Resolvers MAY recognise further attributes. For example, the User Agent string might be useful in differentiating between resources suitable for different clients and operating systems, custom HTTP request headers from a brand owner’s own application might be useful for a tailored experience.
The default link
Servicing multiple links for each entity to serve different end users is a key feature of the GS1-Conformant Resolver ecosystem. It underpins the notion of one barcode performing multiple functions. Enabling this one barcode for multiple functions concept, however, introduces some complexity. Operators of GS1-Conformant Resolvers will be keen to provide end users with the information they’re most likely to find useful with as little friction as possible. On the other hand, developers need to be able to discover and serve what they deem to be the content that best suits the needs of their users. These needs lead to the following details:
- For each identified entity there SHALL be exactly one default link, the list of link types for which SHALL include
gs1:defaultLink. This default is defined without any of the optional attributes, that is, it SHALL include a title, but SHALL NOT include other attributes. - Resolver operators MAY define more refined default links that are disambiguated by attributes that can be determined through inspecting the HTTP client’s request headers (only). This is likely to be particularly important for language variants of the default where language negotiation is not implemented on the target server (see Table 24 for examples). If this feature is supported, the link types for these links SHALL include
gs1:defaultLinkMulti.
The links that are typed as gs1:defaultLink and gs1:defaultLinkMulti SHALL also be described using a link type that describes the kind of resource. For example, an entity’s default might be a product information page, in which case, the link is both of type: gs1:defaultLink and gs1:pip.
The default link for granular identifiers
If an entity is identified at a granular level any fact about the higher level identifier will also apply at the more granular level. For example, if the entity is identified by a GLN and a GLN extension, any facts at the upper GLN level also apply at the GLN extension level. Likewise, with an SGTIN, any fact about the GTIN also applies to the individual instance identified by the serial number. The reverse is not true: facts about the GLN extension may not apply to the GLN, facts about the serialised entity may not apply to the GTIN. As an analogy, mammals are a subclass of animal, that is, all mammals are animals but not all animals are mammals.
An example will help to clarify this. Suppose a trade item has links defined to the product information page and the instruction manual. The link to the product information page is also defined as the default. In addition, the manufacturer has information about recycling but it only applies to a specific Consumer Product Variant of the item.
If the request URI is at the CPV level and asks for the instruction manual, the resolver ‘walks up the tree’ until it finds the appropriate link at the GTIN level. More formally, entities identified at a granular level inherit links from higher in the hierarchy. This is the primary motivation for the structure of a GS1 Digital Link URI. The identifier keys become more granular as you work from left to right. The order of attributes (such as expiry date or ship-to location) does not matter and so those are given in the GS1 Digital Link URI query string in any order.
The same applies for default links. It is perfectly permissible to set the default link for the primary key and not further down the tree. For any entry point, that is, for any GS1 Digital Link URI, no matter how granular, there SHALL be a default link available either at the entry level or at a higher level. This is most easily achieved by setting the default link at the top level.
This has positive consequences for GS1-Conformant Resolvers that support a subset of the GS1 identifier space.
As noted in section 2.1 resolvers MAY support a subset of GS1 primary keys, rather than all of them. For example, it may support only GTIN and GLN, or GLN, SSCC and GRAI. The list of supported primary keys SHALL be declared in the Resolver Description File (section 3). For each supported primary key, a resolver SHALL support all its key qualifiers. So if the resolver supports GTIN, it must also be able to process GS1 Digital Link URIs that include CPV, batch/lot and serial number; support for GLN entails support for GLN extensions and so on. However, this does not mean that such a resolver must also support the provision of links at granular levels of identity since they can simply be provided at the primary key level and still be conformant. It follows that a GS1-Conformant Resolver MAY strip off all qualifier keys from the path and simply process the primary key.
Resolvers should be as performant as possible. Therefore, “waking up the tree” SHOULD be achieved by the resolver synthesising a single response to a single request. GS1-Conformant resolvers SHOULD NOT create an HTTP redirect from a granular identifier to a less-granular GS1 Digital Link URI as this introduces an extra and unnecessary round trip.
The GTIN hierarchy
At the time of writing, most GS1 identifiers that can be used as primary keys in the GS1 Digital Link URI syntax do not have any key qualifiers. There are no further levels of granularity for SSCC, GIAI etc. There is only one valid qualifier for GLN, GSRN and CPID. Therefore, the general principle of inheriting links from higher in the hierarchy is sufficient.
This is not the case, however, for GTINs and ITIPs (AI 8006). A GTIN may be qualified by a third-party serialised extension (TPX) in which case no further qualifier may be added. However, there are three other possible qualifiers for GTINs and ITIPs: CPV (AI 22), batch/lot (AI 10) and serial number (AI 21). An example will help. Consider a trade item with the following identifiers:
01 (GTIN) 09521234000006
22 (CPV) 2A
10 (batch/lot) ABC123
17 (serial) 12345XYZ
The GTIN and all three secondary keys can be encoded in a GS1 Digital Link URI thus:
https://example.com/01/09521234000006/22/2A/10/ABC123/21/12345XYZ
Furthermore, any combination of secondary keys may be omitted and still yield a valid GS1 Digital Link URI. This means that there are seven further possible combinations:
https://example.com/01/09521234000006/22/2A/10/ABC123 (serial number omitted)
https://example.com/01/09521234000006/22/2A/21/12345XYZ (batch/lot number omitted)
https://example.com/01/09521234000006/22/2A (batch/lot number and serial number omitted)
https://example.com/01/09521234000006/10/ABC123/21/12345XYZ (CPV omitted)
https://example.com/01/09521234000006/10/ABC123 (CPV and serial number omitted)
https://example.com/01/09521234000006/21/12345XYZ (CPV and batch/lot number omitted)
https://example.com/01/09521234000006 (CPV, batch/lot number, and serial number omitted)
Semantically, GS1 Digital Link URI is hierarchical, and the link with all secondary keys implies that:
- The CPV is a sub-class of the GTIN.
- The batch/lot number is a sub-class of the CPV.
- The serial number is an instance of the batch/lot number.
In practice, this is not strictly true. The following statements are more closely aligned with the way that the secondary keys may be used in the supply chain:
- The CPV is a sub-class of the GTIN.
- The batch/lot number may or may not be a sub-class of the CPV. It’s entirely possible for a batch/lot to encompass multiple CPVs. For example, a food product may have promotional packaging for a sporting event and have multiple distinct packages, each showcasing a different athlete, active at the same time. In that scenario, multiple CPVs would be filled with the same batch/lot of product, and multiple batches/lots may be produced during the promotional period. The batch/lot number is not a sub-class of the CPV and, similarly, the CPV is not a sub-class of the batch/lot number; both are overlapping sub-classes of the GTIN.
- The GTIN plus the serial number together uniquely identify an instance of a product, regardless of the presence of CPV and batch/lot number.
This may be summarised as follows:
- The CPV is a sub-class of the GTIN.
- The batch/lot number is a sub-class of the GTIN.
- The serial number is an instance of the GTIN.
- The CPV may be associated with zero or more batch/lot numbers.
- The batch/lot number may be associated with zero or more CPVs.
- The serial number may be associated with zero or one CPV and zero or one batch/lot number.
- The GTIN plus the serial number together uniquely identify an instance of a product.
To ensure consistency and uniqueness, regardless of the many-to-many association between CPV and batch/lot number, a GS1 Digital Link URI for a GTIN or ITIP is constructed in order of GTIN (or ITIP), CPV, batch/lot number, and serial number.
There is a potential conflict between the registration side of the resolver (the part that associates a set of identifiers with a link) and the query side (the part that constructs the linkset). In theory, both sides can handle all eight combinations of identifiers but the “walk up the tree” logic that follows the GS1 Digital Link hierarchy can miss important data.
Suppose that a product is subject to a recall. The product has multiple CPVs, either because of a permanent change in packaging or because of a promotion with multiple packaging designs. The Quality Assurance manager knows only the GTIN and batch/lot number for the recall and may not be aware of or have access to CPV data. They associate a recall notice solely with the GTIN and batch/lot number (using the gs1:recallStatus link type).
However, the product has been packaged with a QR Code that includes both the CPV and the batch/lot number (https://example.com/01/09521234000006/22/2A/10/ABC123). Using the “walk up the tree” logic, the query fails to find the recall notice because it’s not associated with the CPV. That is, the resolver will look for links associated with the CPV (2A) AND the batch/lot (ABC123). That logical AND excludes the recall notice that is only associated with the batch/lot.
In a second scenario, suppose that a brand owner maintains traceability information (link type gs1:traceability or gs1:epcis) for supply chain security purposes. The brand owner records traceability information at the serial number level only. However, the product has been packaged with a QR Code that includes the batch/lot number (https://example.com/01/09521234000006/10/ABC123/21/12345XYZ). A regulator, trying to trace a suspect product, scans the QR Code on the package. As before, the “walk up the tree” logic fails to find the traceability information because it’s not associated with both the batch/lot AND the serial number found in the GS1 Digital Link URI.
To ensure that a resolver can answer all possible queries with all relevant results, the following rules SHALL be applied:
- If a link is associated with AI 01 (GTIN) plus AI 235 (TPX), further AIs SHALL NOT be defined for that association.
- If a link is associated with AI 01 (GTIN) or AI 8006 (ITIP) plus AI 21 (serial), then AI 22 (CPV) or AI 10 (batch/lot number) SHALL NOT be defined for that association.
- Links associated with AI 01 (GTIN) or AI 8006 (ITIP) without either AI 235 (TPX) or AI 21 (serial) MAY also be associated with either or both of AI 22 (CPV) and 10 (batch/lot).
- When querying a GS1 Digital Link URI containing AI 01 (GTIN) or AI 8006 (ITIP) in the path, the linkset SHALL be the union of the following linksets:
- If the path contains AI 21 (serial number), registered links matching AI 01 (or AI 8006) and 21 only.
- If the path contains AI 235 (TPX), registered links matching AIs 01 and 235 only.
- If the path contains both AIs 22 (CPV) and 10 (batch/lot number), registered links matching AIs 01 (or 8006), 22, and 10 only.
- If the path contains AI 10 (batch/lot number), registered links matching AIs 01 (or 8006) and 10 only.
- If the path contains AI 22 (CPV), registered links matching AIs 01 (or 8006) and 22 only.
- Registered links matching AI 01 or AI 8006 only.
A query for GS1 Digital Link URI containing all three qualifiers would match all six conditions and so would return the union of six linksets (some of them possibly empty).
It’s important to note that the resolver is responsible for answering only the query it’s presented with. For example, if a Quality Assurance manager associated a links with GTIN, CPV, and batch/lot number, but the query contains only the GTIN and batch/lot number (e.g., because the CPV is not encoded in the QR Code), the registered link will not be found because the CPV is not part of the request URI.
Resolution and Redirection
This section defines how GS1-Conformant Resolvers should perform redirection and how GS1 key licensees and client applications can exercise control over the redirection process.
There are three ways in which a client can query a GS1-Conformant Resolver:
- A simple lookup that results in the default response. From a client perspective, this requires no special software or understanding of GS1-Conformant Resolvers or even that it is dealing with a resolver. It’s a simple web request.
- A request for a specific type of resource.
- A request for the set of links to all resources associated with a given GS1 identifier or set of identifiers.
The following sections discuss these in turn.
The default response and the role of “default link multi”
As set out in section 2.5.8, for each identified entity there is exactly one default link that is defined without any additional metadata (other than its human-readable title). This exists so that the resolver can always provide a definite response, even when information received cannot be matched against the available links. For this reason, the cardinal rule is that:
Resolvers SHALL redirect to the default link unless there is information in the request that can be used to determine a better response.
The request can include such additional information in two ways:
- in the HTTP request headers;
- in the query string.
Of relevance here is that HTTP request headers can specify preferences and absolute requirements that a client may have. For example, they can specify that only one media type is acceptable, or that one is preferred over another. The same is true for languages so that, for example, it’s possible for the client to express that the user understands multiple languages but has a given order of preference. The details of this are defined in the HTTP standards and are out of scope for this document.
HTTP requests almost never come without any extra information that may be useful in determining a resolver’s response. This is why we define the gs1:defaultLinkMulti link type. Its use is optional but, if supported, it allows a resolver to take note of, for example, a user’s language preferences to determine which of several available redirects are followed. The examples in section 2.7 will help to clarify this.
Requesting a specific link type
Applications may wish to provide their users with a specific type of content for each entity, irrespective of the default. For example, a dietary application may want to always follow a link to nutritional information, or a clinical application may always want to follow a link to a patient information leaflet.
Applications MAY request a specific type of content by appending a linkType parameter to the query string with the value of the desired link type. For example:
linkType=gs1:nutritionalInfo
linkType=gs1:epil
- If the requested type of link is available, the resolver SHALL redirect to it.
- If the requested type of link is not available, the resolver SHALL return a
404 Not Foundmessage. When responding in this way, resolvers MAY include information about other links that are available. This can be achieved, for example, by providing the linkset (see section 2.10). -
Note: Returning a
404 Not Foundmessage when a specified type of link is not available is a significant change from GS1 Digital Link version 1.1 [DL1.1]. In that earlier standard, when a link type was not available, the resolver redirected to the default.
Matching request parameters with link attributes
The link attributes described in section 2.5 allow GS1-Conformant Resolvers to match incoming requests with the links they have at hand for the given identifier(s). The requirement for the definition of a single default link is designed to ensure that this process is deterministic, however, the aim is to provide the best match between link attributes and an incoming request, and to fall back on the default when appropriate. The overarching principles are:
- The link type is the principal attribute to be taken into account. This is why a
404 Not Foundresponse is appropriate if a specified link type is not available (the resolver cannot satisfy the request). - After the link type, all other attributes are equal and GS1-Conformant Resolvers should make a best effort to provide the closest match.
GS1-Conformant Resolvers may implement any algorithm that results in a deterministic response, however, the recommended approach to meeting those two principles is as follows:
- If no link type is set in the query the choice is only between links with the
gs1:defaultLinkandgs1:defaultLinkMultilink types. - If there are no links typed as
gs1:defaultLinkMulti, redirect to thegs1:defaultLink. - If a link type is set and matches a single link in the available data, redirect to it.
- Where a choice has to be made between links with the same link type, including
gs1:defaultLinkMulti, the implementation is likely to make use of Web servers’ existing algorithms that take into account information in the HTTP request headers. In essence: ‘best match wins.’ - Where it is impossible to determine which of multiple links of the same link type is the best match, the resolver should return the list of the available links of that type with an HTTP response code of
300 Multiple Choices. See section 2.10 for information about possible linkset formats. - If a specific requested link type is not available, return a
404 Not Foundresponse. Optionally, the identified entity's linkset may be included in the error response to allow an end user to choose alternative links to the one requested. Again, see section 2.10 for information about possible linkset formats.
The flowchart below provides a visualisation of this, followed by some worked examples.
Examples
This section is informative
Some examples should help to clarify the previous discussion.
Example 1: Simple redirect
A manufacturer operates their own resolver that just handles GTINs. For all identified entities in the resolver’s database, there is exactly one link which is to the product’s information page. In this situation, all request URIs result in a redirection to the relevant product information page with the same link types of gs1:pip and gs1:defaultLink whether or not the URI includes CPV, batch/lot or serial number. Note that setting up a simple 1-1 redirection service like this does not necessarily need a GS1-Conformant Resolver. See section 1.1.
Example 2: Temporary change of default link
A GS1 Member Organisation operates a GS1-Conformant Resolver. A consumer electronics manufacturer sets up links for one of their products as shown in the table below.
This is the usual situation so that the resolver will redirect the incoming GS1 Digital Link URI to the product information page but, for a limited period of time, the manufacturer wants to point potential consumers to a promotional campaign and adds another link so that their full set is:
Note that the default link is now the same as the (temporary) gs1:promotion. This means that for the duration of the promotion, by default, the resolver will redirect the GS1 Digital Link URI to the promotion.
Example 3: Multiple links in multiple languages
An independent organisation operates a repository of electronic patient information leaflets on behalf of a variety of pharmaceutical manufacturers. For each drug, they offer two types of information: one designed for patients (gs1:epil) and one for clinical staff (gs1:smpc). The leaflets are available in multiple languages and the repository chooses to make each language version available at a different URL (see section 2.5.4 for why, although this is a common choice, it is not necessary). This leads to multiple links for both supported link types. The manufacturer provides the list of available links as shown below.
In the absence of any information to the contrary, a resolver with these links available will redirect to the patient information leaflet (the ePIL) in Dutch (marked as the default). If there is no value for the linkType parameter, then:
- If the HTTP Accept-Language header sent by the client indicates a preference for ‘nl’, ‘fr’ or ‘de’ then the redirection would be to the patient information leaflet in the relevant language.
- If the Accept-Language header declared a preference for a language not listed, then, again, the resolver will redirect to the default version (Dutch).
Support for gs1:defaultLinkMulti is optional in any GS1-Conformant Resolver. If it were not supported in this case, then for anything other than the Dutch language patient information to be returned, the request URI would have to include the relevant linkType parameter and the HTTP Accept-Language header would need to match.
If an incoming request were received for the summary product characteristics (the term used to describe information for clinicians) by setting the linkType parameter to gs1:smpc, then:
- If the client’s language preferences can be matched, redirect to the SmPC in that language.
- If the client’s language cannot be matched, return a list of the available links with a
300 Multiple Choicesresponse header.
The same reasoning applies if the linkType parameter were set to gs1:epil. In this case, the fact that the electronic information for patients is also the default is irrelevant.
If the linkType parameter were set to any value other than gs1:epil, gs1:smp or all, return a 404 Not Found message (optionally including the linkset)
Example 4; Leveraging link types in apps
A power tool manufacturer operates its own resolver and encourages its customers to register their purchase by including a GS1 Digital Link URI on the packaging, as follows:
https://tools.example.com/01/09520123456788/21/12345
The manufacturer sets the default to the link that is also labelled gs1:instructions which points to a video showing how the tool can be used. This is set at the GTIN level and so any consumer scanning the tool’s packaging in any store would see the same video. However, the same GS1 Digital Link URI can be scanned using the retailer’s app which asks for a link type of gs1:registerProduct. Combining information from both the retailer app, which includes information about the customer, with the manufacturer’s information about the serialised product makes the registration process easier for the consumer.
Example 5: Plain request
The request URI to be resolved does not include a query string and the Accept-language header is not set. There is no data in the request to match and so the response is simple: redirect to the default (https://example.com/en/defaultPage)
Example 6: Matching the language
The request URI to be resolved does not include a query string and the HTTP client’s Accept-language is set to fr (French). There is no query string (and therefore no linkType set). There is, however, a match between the requested language and an available default. The resolver redirects to the French language default (https://example.com/fr/defaultPage)
Example 7: Non-matching language
The request URI to be resolved does not include a query string, the HTTP client’s Accept-language is set to de (German), and there is no match between the requested language and an available default. The resolver redirects to the default (https://example.com/en/defaultPage)
Example 8: Matching the link type
The request URI to be resolved does include the linkType parameter which is set to gs1:relatedVideo. The resolver redirects to https://example.com/video/abcd
Example 9: Non-matching link type
The request URI to be resolved includes the linkType parameter which is set to gs1:instructions. There are no links of this type and so the resolver returns a 404 Not Found message.
Example 10: Matching link type and language
The request to be resolved does include the linkType parameter which is set to gs1:pip and the HTTP client’s Accept-language header is set to en. The resolver redirects to the English language page at https://example.com/en/defaultPage.
Example 11: Matching link type but not language
As in the previous example, the linkType parameter is set to gs1:pip but this time the HTTP client’s Accept-language is set to vi (Vietnamese). Here there is a match for the link type but not the language. In this case, there is no definite answer and so the resolver will return a 300 Multiple Choices response showing the two available links of type gs1:pip.
Example 12: Matching link type, language and context
The request URI to be resolved includes the linkType set to gs1:whatsInTheBox, the HTTP client’s Accept-language is set to fr and the context parameter is set to CH (Switzerland). This means that there is a link with a matching link type and two further matching attributes. The resolver redirects to https://example.com/fr/packContents/CH
Example 13: Prioritisation logic
Similar to the previous request but this time the requested language is en and the requested context is again CH. There are three links with the same gs1:whatsInTheBox link type. One matches the request by language, another by context. In this case, the resolver implementation chooses to prioritise language over context and redirects to the English language page at https://example.com/en/packContents/GB, even though the context doesn’t match. This is an implementation choice but the suggested order of priority is media type à language à context.
Pattern-based redirection to an alternative resolver
Resolvers MAY support redirection of all request URIs that match a given pattern to another resolver based on a template. In the GS1 context, this might be at the GS1 Member Organisation level or the GS1 Company Prefix level and amounts to a simple passing of the request on to another service without further processing. In addition to the Location header, the target URL MAY also be exposed in the Link header. In this case, the linkType (the rel value) SHALL be gs1:handledBy, indicating that the request URI is handled by the target resolver.
Requesting the linkset
The concept and structure of a linkset is defined in Linkset: Media Types and a Link Relation Type for Link Sets [RFC9264]. It is a set of links from an identified entity to one or more sources of information that are directly related to it. A linkset includes all the attributes listed in section 2.5.
A client can request the entity’s linkset by either:
- setting the client’s HTTP Accept header to
application/linkset+json; - setting the value of the
linkTypeparameter tolinkset.
On receipt of such a request, the resolver SHALL NOT redirect the query and SHALL return the linkset. See section 2.10 for information on linkset formats.
If the request GS1 Digital Link URI includes one or more key qualifiers, any links associated with each level up to the primary key SHALL be included, that is, links are inherited from further up the hierarchy (see sections 2.5.9 and 2.5.10).
Linkset formats
A resolver will return a linkset in a number of different situations:
- When explicitly asked for (section 2.9).
- When a resolver cannot determine which of several possible links it should redirect to (section 2.6.3).
- Optionally as part of the
404 Not Founderror message when a requested link type is not available for the identified entity but others are (section 2.6.2).
GS1-Conformant Resolvers may format the linkset in any number of ways but for interoperability the following minimum rules apply. These are designed to ensure that the linkset is available consistently at least as machine-readable JSON/JSON-LD, and as a human-readable HTML page.
If the HTTP Accept header is application/linkset+json, the resolver SHALL return the linkset serialised as JSON as defined by RFC9264 [RFC9264]. It is RECOMMENDED that the identical response is returned if the HTTP Accept header is application/json. The linkset SHALL validate against https://ref.gs1.org/standards/resolver/linkset-schema.
The HTTP response headers SHOULD include a Link header pointing to a context file so that the JSON can be expanded to JSON-LD. In line with JSON-LD version 1.1 [JSON-LD], the link relation type SHALL be http://www.w3.org/ns/json-ld#context and the media type for the context file SHALL be application/ld+json. GS1-Conformant Resolvers MAY provide their own JSON-LD context file and could potentially link to different context files for different linksets. However, the RECOMMENDED approach is to use the context file published and maintained by GS1 at https://ref.gs1.org/standards/resolver/linkset-context. That URL always points to the latest version of the context file which may change with later versions of this document. To refer to an immutable context file, include the standard's version number in the URL. For example, https://ref.gs1.org/standards/resolver/1.2.0/linkset-context. The location of a resolver’s JSON-LD context file for linksets SHOULD be declared in its Resolver Description File (section 3).
Including the HTTP Link header to a JSON-LD context file when returning a linkset as JSON means that relevant applications can interpret the JSON as Linked Data [Linked Data] with no further effort required.
If the client explicitly requests JSON-LD by setting the HTTP Accept header to application/ld+json then the resolver SHOULD return the linkset as JSON-LD with the context definitions included in the data.
If the HTTP Accept header is text/html (or one of the legacy media types for HTML), or is unspecified, then the resolver SHOULD return an HTML page in which all the links are presented as hyperlinks. The linkset SHOULD be embedded within the HTML page as JSON-LD, complete with context definitions.
Note: that the value of the hreflang and context fields are arrays, even if there is only a single value.
Default link type may be set to linkset
Resolvers MAY support the setting of the default linkType to linkset. This can be applied at any level and means that where a specific linkType is not requested the resolver will return the full list of links available to the client application. This will almost certainly be as an HTML Web page and is likely to be branded according to the resolver operator, not the identified entity's brand. As always, it is worth considering the user's experience. See also section 1.1.
Since support for this function is optional, if implemented it SHOULD be declared in the Resolver Description File (section 3).
Handling the query string
If present, the query string in an uncompressed GS1 Digital Link URI carries attributes of the identified entity and does not form part of the entity’s identifier. Implementations MAY make use of query string parameters but this standard does not define a particular behaviour.
When redirecting, by default, a resolver SHALL transmit the entirety of the query string in the request URI to the target destination. This is because although the resolver is not required to process GS1 Application Identifiers or any custom or other extension name=value pairs in the query string, the target resource might be able to do so.
Trailing slashes
Where a GS1 Digital Link URI resolves to a directory on a server, it will typically be appended with a trailing slash automatically. Thus our example
https://example.com/01/09520123456788/22/2A
might be seen in the address bar of a browser as
https://example.com/01/09520123456788/22/2A
/
This is not conformant to the GS1 Digital Link syntax, however, it is likely to be common and therefore resolvers SHOULD be tolerant of it.
Supported link relation types
The Web Linking standard [RFC8288] defines a registry of general purpose link relation types [IANA LR] such as alternate, describedby and icon. These can be used without qualification in HTTP Link headers (and therefore linksets). They are similar to, but managed and defined separately from, the list of link relation types that can be used in HTML documents [HTML LT]. Neither list includes the detailed set of link relation types needed for GS1-Conformant Resolvers, which are unlikely to be of sufficiently broad applicability to warrant addition to those registries. Therefore, the GS1 Web vocabulary [GS1Voc] defines a set of link relation types (link types). The Web Vocabulary is managed under the GS1 Standards Management Process.
The extension mechanism defined in the Web Linking standard [RFC8288] states that values used as a link relation type other than those listed in the IANA registry must be a URI but may be serialised as strings that can be converted to a URI. We take advantage of this and express link types as CURIEs [CURIE] that is, compact URIs.
For example, the prefix gs1: is shorthand for https://ref.gs1.org/voc/ so that gs1:pip expands to https://ref.gs1.org/voc/pip.
GS1-Conformant Resolvers SHALL recognise the link types defined in the gs1: namespace and MAY recognise further namespaces in which case they and the recognised prefixes SHOULD be declared in the resolver description file (see section 3).
Resolver Description File
Different GS1-Conformant Resolvers are likely to serve different needs and there is no requirement, nor any expectation, that every resolver will offer the same set of links or content for the same identified entity. Equally, it is not expected that every resolver will offer support for every combination of GS1 key or qualifier. Some may support extra name=value pairs in the query string, their own set of link types and so on. All these variations and more are possible while remaining as a GS1-Conformant Resolver.
Such flexibility is deliberate and allows different businesses to operate their resolver in the way that best suits them with the minimum of restriction. On the downside, the flexibility reduces interoperability between resolvers. To address this, we define the Resolver Description File.
The Resolver Description File performs a number of functions. It provides a machine-readable description of the resolver’s capabilities and thus allows applications to automatically detect a resolver’s capabilities and act accordingly. Furthermore, it explicitly asserts the sovereignty of URLs within its own domain name. See section 4 for why this is important and why a GS1-Conformant Resolver SHALL make a Resolver Description File available at /.well-known/gs1resolver. This is in line with Defining Well-Known Uniform Resource Identifiers (URIs) [RFC 8615]. The well-known location is recorded in the IANA Registry.
The terms that SHALL and MAY be included in a Resolver Description File are defined below. Resolver Description Files SHALL validate against the JSON schema published at https://ref.gs1.org/standards/resolver/description-file-schema. As with the linkset context file (section 2.9), this URL points to the latest version of the scheme. To point to an immutable schema, include the required version number in the URL. For example https://ref.gs1.org/standards/resolver/1.2.0/description-file-schema
- The resolver root (the
customURIstemas defined in [DL-URI] (required).- property: resolverRoot
- type: URI
- Enumerate which Primary Keys & related qualifiers are supported by the resolver (required).
- property: supportedPrimaryKeys
- type: array
- Allowed values: "all", "01", "8006", "8013", "8010", "414", “415”, "417", "8017", "8018", "255", "00", "253", "401", "402", "8003", "8004"
- property: supportedPrimaryKeys
- A name for the GS1-Conformant Resolver.
- property: name
- type: string
- Additional namespace(s) of supported link type lists and associated prefixes (see section 2.14). Support for the GS1 Web vocabulary is assumed.
- property: supportedLinkType
- type: array of objects
- property: namespace
- type: URI
- property: prefix
- type: string
- Whether
linksetis a supported default link type (section 2.11).- property: linkTypeDefaultCanBeLinkset
- type: Boolean
- default: false
- The supported values (if any) for the context keyword. These can be provided through simple enumeration or by linking to an externally managed list.
- property: supportedContextValuesEnumerated
- type: array of strings
- property: supportedContextValuesExternal
- type: URI
- Contact details for the resolver operator.
- property: contact
- type: VCard
- A pointer to a document that describes any extensions the resolver supports, such as any extended key=value pairs
- property: extensionProfile
- type: URI
- If supported, the location of the JSON-LD context file referenced in the HTTP Link header when a linkset is served as a JSON object (section 2.9)
- property: jsonLdContextLocation
- type: URI
Example
As an example, the GS1 Global Office resolver’s description file (available from https://id.gs1.org/.well-known/gs1resolver) is reproduced below.
{
"name":" The GS1 AISBL Resolver",
"resolverRoot":"https://id.gs1.org",
"supportedPrimaryKeys": ["all"],
"supportedContextValuesEnumerated": ["dscsaSaleableReturn"],
"supportedContextValuesExternal": [{"nameOfList":"ISO-3166 Alpha-2", "url":"https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes"}],
"linkTypeDefaultCanBeLinkset": true,
"contact": {"fn":"GS1 AISBL", "hasAddress":{"streetAddress":" Avenue Louise 523", "locality":"Brussels", "country-name":"Belgium", "postal-code":"1050"}, "hasTelepone":"tel:+32 2 788 78 00"}
},
"jsonLdContextLocation": https://ref.gs1.org/standards/resolver/linkset-context
}
GS1-Conformant Resolvers on the Web
The GS1 Digital Link URI syntax goes directly against W3C’s Web architecture principles [WebArch], namely URI Opacity, which states that:
Agents making use of URIs SHOULD NOT attempt to infer properties of the referenced resource.
GS1 is far from unique in going against this principle but recognises the conflict. There are two requirements that GS1 believes justifies overriding the principle:
- a Web address that identifies an entity can be encoded in its entirety in a data carrier on the pack (in a QR Code®, NFC tag, digital watermark or similar) such that a generic application with no special software can directly extract the entire URL and follow the link;
- critical applications within the supply chain do not need to look up the GS1 Digital Link URI in real time to extract the GS1 keys and key values; they can instead extract the GS1 keys and key values using translation software that requires no real-time OR online connectivity.
GS1 further notes the definition of SHOULD NOT from [RFC2119]:
... there may exist valid reasons in particular circumstances when the particular behaviour is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label.
Interoperability between different GS1 resolvers and other online services that make use of the GS1 Digital Link URI syntax is made possible by the use of GS1 identification keys. This means that the Internet domain name in the URI is not used for entity identification. This goes directly against URI Design and Ownership [BCP190], the abstract of which includes:
… the structure of a URI is defined by its scheme. While it is common for schemes to further delegate their substructure to the URI's owner, publishing independent standards that mandate particular forms of URI substructure is inappropriate, because that essentially usurps ownership.
It is recognised that encoding GS1 identification keys and key values in a GS1 Digital Link URI goes against this by defining a substructure. However, resolvers are not required or expected to redirect to the same target resources or return the same linksets as each other. Furthermore, all GS1-Conformant Resolvers SHALL publish a Resolver Description File at /.well-known/gs1resolver that asserts its independent control of its URI space. The presence or absence of this file can be used to determine whether or not the URI points to a service conformant to this standard. The Resolver Description File includes information about whether the resolver handles all or only a subset of the GS1 identifier system, support for any extensions, the supported value space(s), if any, for the context keyword and more.
Therefore, each resolver/internet domain remains sovereign over its URI space and the Best Current Practice is not egregiously contravened.
Conformance statement
Summarising the preceding discussion, a GS1-conformant resolver:
- For primary keys that are supported by the resolver and that have key qualifiers, all key qualifiers SHALL be supported (sections 2.1, 2.5.9).
- SHALL support HTTP 1.1 (or higher) GET, HEAD and OPTIONS requests (section 2.2).
- SHALL support HTTP Over TLS (HTTPS) (section 2.2)
- SHALL support CORS (section 2.2)
- SHALL be able to decompress an EPC binary string in accordance with GS1 Digital Link URI: Compression Technical Standard for EPC binary strings {EPCB] (section 2.3).
- If redirecting to another resolver, the redirecting GS1-Conformant Resolver SHOULD redirect the uncompressed URI (section 2.3).
- SHOULD extract and syntactically validate the GS1 identifiers in the request URI and SHALL report errors with an HTTP response code of 400 (section 0)
- If the request URI is a syntactically valid GS1 Digital Link URI, but the resolver has no information about the identified entity then it SHALL return a simple
404 Not Foundresponse. (section 2.4.1) - SHALL NOT use a
200 OKresponse code with a resource that indicates an error condition (section 0). - SHALL respond to a query parameter of
linkType set to linksetand/or a request with the HTTP Accept header set toapplication/linkset+jsonby returning a list of links available to the client application. The list SHALL be available as per Linkset: Media Types and a Link Relation Type for Link Sets [RFC9264]. The linkset SHALL validate against https://ref.gs1.org/standards/resolver/linkset-schema. If the request GS1 Digital Link URI includes one or more key qualifiers, any links associated with each level up to the primary key SHALL be included (sections 2.2, 2.9 and 2.5.10). The URI used as the subject of facts presented SHALL be the uncompressed version. - All links in the linkset SHALL include the target URL (section 2.5.1), the link type (section 2.5.2) and a link title (section 2.5.3) and MAY include the human language(s) (section 2.5.4). If a media type is defined for a link, it SHALL be one defined by IANA (section 2.5.5).
- Links that are typed
gs1:defaultLinkorgs1:defaultLinkMultiSHALL also be described using a descriptive link type (section 2.5.8) - When returning the linkset, the resolver SHOULD include an HTTP Link header pointing to a JSON-LD context file with a
reltype of http://www.w3.org/ns/json-ld#context that itself should be served with a media type of application/ld+json. The context file SHOULD be declared in the resolver Description File (section 2.10). - SHALL recognise one available link as the default for any given request URI (sections 2.2, 2.5.8). The default link SHALL NOT have any optional attributes (section 2.5.8).
- SHALL redirect to the default link unless there is information supplied in the request that can be used to make a better match.
- For any request URI, no matter how granular, there SHALL be a default link at the entry level or higher up the tree (section 2.5.9)
- SHALL redirect to the requested type of link if available (section 2.6.2).
- SHALL return a 404 Not Found message if a link of the requested type is not available (section 2.6.2).
- SHALL pass on all key=value pairs in the query string of the request URI (if present) when redirecting (section 2.12).
- SHOULD support use of the Accept-Language and MAY support Accept HTTP Request Headers (section 2.6.3), and the
contextkeyword in the query string, to disambiguate between multiple links of the samelinkType(section 2.5.6) - SHALL provide a resolver description file at /.well-known/gs1resolver that SHALL validate against the schema at https://ref.gs1.org/standards/resolver/description-file-schema (section 3)
- The list of supported primary identifiers SHALL be provided in the Resolver Description File (section 2.5.9)
- Section 2.5.10 provides a series of closely related normative statements regarding permitted and prohibited combinations of key qualifiers for GTINs and ITIPs with which links can be associated, and how a resolver should process requests for those.
- SHALL recognise the GS1 Web vocabulary namespace and the prefix
gs1:for link types. A resolver MAY recognise additional namespaces. If this is done, their preferred prefix(es) SHOULD be declared in the resolver Description File. Link types defined elsewhere SHALL NOT duplicate link types available from GS1 (section 2.14). - SHOULD tolerate trailing slashes at the end of GS1 Digital Link URIs, i.e. the resolver SHOULD NOT fail if one is present (see section 2.13).
Glossary
The glossary lists the terms and definitions that are applied in this document. Please refer to www.gs1.org/glossary for the online version.
References
- [BCP47]
- Tags for Identifying Languages. A Phillips, M Davis (Eds), IETF September 2006-2009, https://www.rfc-editor.org/info/bcp47
- [BCP190]
- URI Design and Ownership. M Nottingham, IETF June 2020 https://www.rfc-editor.org/info/bcp190
- [BSR]
- The GS1 Barcode Syntax Resource is a collection of assets that aims to help the GS1 user community to improve data quality and accurately convert between the different GS1 data syntaxes used with 1D and 2D barcodes in the GS1 system. https://ref.gs1.org/tools/gs1-barcode-syntax-resource/
- [CORS]
- Cross-Origin Resource Sharing. W3C Recommendation https://www.w3.org/TR/cors/ and WHATWG standard https://fetch.spec.whatwg.org/
- [CURIE]
- CURIE Syntax 1.0 A syntax for expressing Compact URIs. W3C Working Group Note 16 December 2010. Mark Birbeck, Shane McCarron https://www.w3.org/TR/curie/
- [DL1.1]
- GS1 Digital Link. Version 1.1.2 Mark Harrison, Phil Archer et al GS1 Ratified Standard, November 2022 https://ref.gs1.org/standards/digital-link/1.1.2/
- [DLBP]
- Best practices for creating your QR Code powered by GS1. Informal GS1 publication, 2023 https://ref.gs1.org/docs/2023/QR-Code_powered-by-GS1-best-practices
- [DL-URI]
- GS1 Digital Link: URI syntax. Version 1.4.0 Mark Harrison et al. GS1 ratified standard 15 June 2023 https://ref.gs1.org/standards/digital-link/uri-syntax/1.4.0/
- [EPCB]
- GS1 Digital Link URI: Compression Technical Standard for EPC binary strings Mark Harrison GS1 ratified standard July 2025 https://ref.gs1.org/standards/digital-link/compression/1.0.0/
- [GS1 Identification Keys]
- GS1 Identification Keys. https://www.gs1.org/standards/id-keys
- [GENSPECS]
- GS1 General Specifications Version 23.0.0 GS1 Ratified Standard January 2023 https://ref.gs1.org/standards/genspecs/23.0.0/
- [GS1Voc]
- The GS1 Web Vocabulary. https://gs1.org/voc/
- [HTML LT]
- HTML Living Standard. https://html.spec.whatwg.org/multipage/links.html
- [IANA LR]
- Link relations. https://www.iana.org/assignments/link-relations/link-relations.xhtml
- [IANA MT]
- Media Types. https://www.iana.org/assignments/media-types/media-types.xhtml
- [ISO/IEC 15418]
- ISO/IEC 15418:2016 Information technology — Automatic identification and data capture techniques — GS1 Application Identifiers and ASC MH10 Data Identifiers and maintenancehttps://www.iso.org/standard/67405.html
- [ISO/IEC 18975]
- ISO/IEC 18975:2024 Information technology — Automatic identification and data capture techniques — Encoding and resolving identifiers over HTTP https://www.iso.org/standard/85540.html
- [JSON-LD]
- JSON-LD 1.1 A JSON-based Serialization for Linked Data. Gregg Kellogg, Pierre-Antoine Chapman, Dave Longley. W3C Recommendation 16 July 2020 https://www.w3.org/TR/json-ld11/
- [Linked Data]
- Linked Data. Tim Berners-Lee 2006 https://www.w3.org/DesignIssues/LinkedData
- [LMS]
- GS1 Lightweight Messaging Standard for Verification of Product Identifiershttps://www.gs1.org/verification-messaging
- [RFC2119]
- Key words for use in RFCs to Indicate Requirement Levels. S Bradner. IETF March 1997 https://datatracker.ietf.org/doc/html/rfc2119
- [RFC 2606]
- Reserved Top Level Domain Names. D Eastlake, A Panitz. IETF June 1999 https://datatracker.ietf.org/doc/html/rfc2606
- [RFC 2818]
- HTTP Over TLS. M Rescorla. IETF May 2000 https://datatracker.ietf.org/doc/html/rfc2818
- [RFC 6570]
- URI Template. J. Gregorio, R. Fielding, M. Hadley, M. Nottingham, D. Orchard. IETF March 2012 https://datatracker.ietf.org/doc/html/rfc6570
- [RFC 6761]
- Special-Use Domain Names. S Cheshire, M Krochmal. IETF February 2013 https://datatracker.ietf.org/doc/html/rfc6761
- [RFC 8288]
- Web Linking. M Nottingham. IETF October 2017 https://datatracker.ietf.org/doc/html/rfc8288
- [RFC 8615]
- Well-Known Uniform Resource Identifiers (URIs). M Nottingham. IETF May 2019 https://datatracker.ietf.org/doc/html/rfc8615
- [RFC9110]
- HTTP Semantics, Section 15: Status Codes R. Fielding, M. Nottingham, J. Reschke. IETF June https://www.rfc-editor.org/rfc/rfc9110.html#name-status-codes
- [RFC9264]
- Linkset: Media Types and a Link Relation Type for Link Sets. Erik Wilde, Herbert Van de Sompel. IETF July 2022 https://datatracker.ietf.org/doc/html/rfc9264
- [TDS]
- EPC Tag Data Standard (TDS). Mark Harrison, Craig Alan Repec. GS1 ratified standard. February 2025 https://ref.gs1.org/standards/tds/
- [TDT]
- EPC Tag Data Translation Standard (TDT), Mark Harrison, Craig Alan Repec. GS1 ratified standard, February 2025 https://ref.gs1.org/standards/tdt/
- [WebArch]
- Architecture of the World Wide Web, Volume One. Ian Jacobs, Norman Walsh. W3C Recommendation 15 December 2004 https://www.w3.org/TR/webarch/
Acknowledgements
Log of Changes
This standard was originally part of GS1 Digital Link [DL1.1]. It is now a standard in its own right and its only connection to GS1 Digital Link is that the input to a GS1-Conformant Resolver is a GS1 Digital Link URI.
In terms of substance, the major change since GS1 Digital Link version 1.1 is the adherence to the work on Linksets at IETF that is now a full standard. The full list of available links is no longer required to be exposed in the HTTP Link header.
The preferred value to be used for the linkType parameter when requesting the linkset is now 'linkset'. The previous value, 'all', is deprecated but existing implementations are encouraged to continue to support 'all' until further notice.
If a specific type of link is requested that is not available, resolvers shall now respond with a 404 Not Found error message, rather than redirect to the default as specified previously.
Efforts have been made to clarify what metadata a resolver will require to describe each link and how a resolver should match that against information received as part of the incoming request. The link types of gs1:defaultLink and gs1:defaultLinkMulti have been introduced as part of this.
Rules around associating links with GTINs and GTIN qualifiers have been made significantly more comprehensive. See section 2.5.10.
The previous versions stated that, in addition to link types defined in the GS1 Web vocabulary, resolvers SHOULD also recognise relevant terms in schema.org. This has been removed although, of course, resolvers MAY use such terms.
Previous versions also allowed for resolvers to support alternative compression algorithms. This option has been removed.
The concept of a 'Class 2 Resolver' has been removed.
Changes included in version 1.1.0
- Section 2.5.1 relaxed to explicitly allow implementations to use any method to support template URLs.
- Normative reference to ISO/IEC 18975 added to the introduction to Section 2
- Section 2.3 decompression. Requirement to include an HTTP Link header pointing to uncompressed form with link type of owl:sameAs removed This change arises from the change made in version 1.0.0 to refer normatively to RFC 9264 (Linksets).
Changes included in version 1.2.0
- Sections 2.2 and 2.6. Need to include link to linkset, even when redirecting, removed (since there are well-defined methods for obtaining the linkset from any given input URI).
- Section 2.3 Required support for decompression now limited to EPC binary strings. Support for other forms of compression is optional.
- Section 2.5.4 Stating the human language of a target resource changed from SHOULD to MAY
- Sections 2.5.4 and 2.5.6. Clarification that, if included in a link's description within a linkset, the values of the human language and context must be provided in an array, even if there is only a single value. Inclusion of the target resource's human language changed from SHOULD to MAY
- Section 2.5.9. Clarification that resolvers SHOULD NOT use HTTP redirection to "walk up the tree, rather, the full linkset should be synthesised by the resolver and returned as a single dataset."
- Section 2.8. When redirecting based on an MO or GCP prefix, the resolver MAY expose the target in the HTTP Link header (previously this was a SHALL).
- Section 2.10. The linkset schema, published as an artefact at https://ref.gs1.org/standards/resolver/linkset-schema, is now normative. Likewise, in section 3, the schema for resolver description files is also now normative.
- Section 2.12. The option to omit incoming query string parameters when redirecting to a target URL has been removed.