The new query parameters are
OPTIONAL extensions of path segments defined in [
RFC 7482]. They are as follows:
-
"count":
-
a boolean value that allows a client to request the return of the total number of objects found
-
"sort":
-
a string value that allows a client to request a specific sort order for the result set
-
"cursor":
-
a string value representing a pointer to a specific fixed-size portion of the result set
Augmented Backus-Naur Form (ABNF) [
RFC 5234] is used in the following sections to describe the formal syntax of these new parameters.
According to most advanced principles in REST design, collectively known as HATEOAS (Hypermedia as the Engine of Application State) [
HATEOAS], a client entering a REST application through an initial URI should use server-provided links to dynamically discover available actions and access the resources it needs. In this way, the client is neither required to have prior knowledge of the service nor, consequently, to hard code the URIs of different resources. This allows the server to make URI changes as the API evolves without breaking clients. Definitively, a REST service should be as self-descriptive as possible.
Therefore, servers implementing the query parameters described in this specification
SHOULD provide additional information in their responses about both the available sorting criteria and possible pagination. Such information is collected in two
OPTIONAL response elements named "sorting_metadata" and "paging_metadata".
The "sorting_metadata" element contains the following properties:
-
"currentSort": "String" (OPTIONAL)
-
Either the value of the "sort" parameter as specified in the query string orthe sort applied by default, if any.
-
"availableSorts": "AvailableSort[]" (OPTIONAL)
-
An array of objects, with each element describing an available sort criterion. The AvailableSort object includes the following members:
-
"property": "String" (REQUIRED)
-
The name that can be used by the client to request the sort criterion.
-
"default": "Boolean" (REQUIRED)
-
Indicator of whether the sort criterion is applied by default. An RDAP server MUST define only one default sorting property for each object class.
-
"jsonPath": "String" (OPTIONAL)
-
The JSONPath expression of the RDAP field corresponding to the property.
-
"links": "Link[]" (OPTIONAL)
-
An array of links as described in [RFC 8288] containing thequery string that applies the sort criterion.
At least one of the "currentSort" and "availableSorts" properties
MUST be present.
The "paging_metadata" element contains the following fields:
-
"totalCount": "Numeric" (OPTIONAL)
-
A numeric value representing the total number of objects found. ItMUST be provided if and only if the query string contains the"count" parameter.
-
"pageSize": "Numeric" (OPTIONAL)
-
A numeric value representing the number of objects that should have beenreturned in the current page. It MUST be provided if and onlyif the total number of objects exceeds the page size. This property isredundant for RDAP clients because the page size can be derived from thelength of the search results array, but it can be helpful if the end userinteracts with the server through a web browser.
-
"pageNumber": "Numeric" (OPTIONAL)
-
A numeric value representing the number of the current page in the resultset. It MUST be provided if and only if the total number ofobjects found exceeds the page size.
-
"links": "Link[]" (OPTIONAL)
-
An array of links as described in [RFC 8288] containing thereference to the next page. In this specification, only forward pagination isdescribed because it is all that is necessary to traverse the result set.
Servers returning the "paging_metadata" element in their response
MUST include the string literal "paging" in the rdapConformance array. Servers returning the "sorting_metadata" element
MUST include the string literal "sorting".
Currently, RDAP does not allow a client to determine the total number of results in a query response when the result set is truncated. This is inefficient because the user cannot determine if the result set is complete.
The "count" parameter provides additional functionality that allows a client to request information from the server that specifies the total number of objects matching the search pattern.
The following is an example of an RDAP query including the "count" parameter:
https://example.com/rdap/domains?name=example*.com&count=true
The ABNF syntax is the following:
count = "count=" ( trueValue / falseValue )
trueValue = ("true" / "yes" / "1")
falseValue = ("false" / "no" / "0")
A trueValue means that the server
MUST provide the total number of objects in the "totalCount" field of the "paging_metadata" element (
Figure 1). A falseValue means that the server
MUST NOT provide this number.
{
"rdapConformance": [
"rdap_level_0",
"paging"
],
...
"paging_metadata": {
"totalCount": 43
},
"domainSearchResults": [
...
]
}
RDAP does not provide any capability to specify the result set sort criteria. A server could implement a default sorting scheme according to the object class, but this feature is not mandatory and might not meet user requirements. Sorting can be addressed by the client, but this solution is rather inefficient. Sorting features provided by the RDAP server could help avoid truncation of relevant results.
The "sort" parameter allows the client to ask the server to sort the results according to the values of one or more properties and according to the sort direction of each property. The ABNF syntax is the following:
sort = "sort=" sortItem *( "," sortItem )
sortItem = property-ref [":" ( "a" / "d" ) ]
property-ref = ALPHA *( ALPHA / DIGIT / "_" )
"a" means that an ascending sort
MUST be applied; "d" means that a descending sort
MUST be applied. If the sort direction is absent, an ascending sort
MUST be applied.
The following are examples of RDAP queries that include the "sort" parameter:
https://example.com/rdap/domains?name=example*.com&sort=name
https://example.com/rdap/ domains?name=example*.com&sort=registrationDate:d
https://example.com/rdap/ domains?name=example*.com&sort=lockedDate,name
Except for sorting IP addresses and values denoting dates and times, servers
MUST implement sorting according to the JSON value type of the RDAP field the sorting property refers to. That is, JSON strings
MUST be sorted lexicographically, and JSON numbers
MUST be sorted numerically. Values denoting dates and times
MUST be sorted in chronological order. If IP addresses are represented as JSON strings, they
MUST be sorted based on their numeric conversion.
The conversion of an IPv4 address to a number is possible since each dotted format IPv4 address is a representation of a number written in a 256-based manner; for example, 192.168.0.1 means 1*256^0 + 0*256^1 + 168*256^2 + 192*256^3 = 3232235521. Similarly, an IPv6 address can be converted into a number by applying the base 65536. Therefore, the numerical representation of the IPv6 address 2001:0db8:85a3:0:0:8a2e:0370:7334 is 42540766452641154071740215577757643572. Built-in functions and libraries for converting IP addresses into numbers are available in most known programming languages and relational database management systems.
If the "sort" parameter presents an allowed sorting property, it
MUST be provided in the "currentSort" field of the "sorting_metadata" element.
In the "sort" parameter ABNF syntax, the element named "property-ref" represents a reference to a property of an RDAP object. Such a reference could be expressed by using a JSONPath expression (named "jsonpath" in the following).
JSONPath is a syntax, originally based on the XML XPath notation [
W3C.CR-xpath-31-20170321], which represents a path to select an element (or a set of elements) in a JSON document [
RFC 8259]. For example, the jsonpath to select the value of the ASCII name inside an RDAP domain lookup response is "$.ldhName", where $ identifies the root of the document object model (DOM). Another way to select a value inside a JSON document is the JSON Pointer [
RFC 6901].
While JSONPath and JSON Pointer are both commonly adopted notations to select any value inside JSON data, neither is particularly concise and easy to use (e.g., "$.domainSearchResults[*].events[?(@.eventAction='registration')].eventDate" is the jsonpath of the registration date in an RDAP domain search response).
Therefore, this specification defines the "property-ref" element in terms of names identifying RDAP properties. However, not all the RDAP properties are suitable to be used in sort criteria. These properties include:
-
properties providing service information (e.g., links, notices, and remarks)
-
multivalued properties (e.g., status, roles, and variants)
-
properties representing relationships to other objects (e.g., entities)
On the contrary, properties expressed as values of other properties (e.g., registration date) could be used in such a context.
A list of properties an RDAP server
MAY implement is defined. The properties are divided into two groups: object-common properties and object-specific properties.
-
Object-common properties. Object-common properties are derived from merging the "eventAction" and the "eventDate" properties. The following values of the "sort" parameter are defined:
-
registrationDate
-
reregistrationDate
-
lastChangedDate
-
expirationDate
-
deletionDate
-
reinstantiationDate
-
transferDate
-
lockedDate
-
unlockedDate
-
Object-specific properties. Note that some of these properties are also defined as query path segments. These properties include:
-
Domain: name
-
Nameserver: name, ipv4, ipv6
-
Entity: fn, handle, org, email, voice, country, cc, city
The correspondence between these sorting properties and the RDAP object classes is shown in
Table 1. Some of the sorting properties defined for the RDAP entity class are related to jCard elements [
RFC 7095], but because jCard is the JSON format for vCard, the corresponding definitions are included in the vCard specification [
RFC 6350].
An RDAP server
MUST NOT use the defined sorting properties with a meaning other than that described in
Table 1.
Object class |
Sorting property |
RDAP property |
RFC 7483 |
RFC 6350 |
RFC 8605 |
Searchable objects |
Common properties |
eventAction values suffixed by "Date" |
4.5
|
|
|
Domain |
name |
unicodeName/ ldhName |
5.3
|
|
|
Nameserver |
name |
unicodeName/ ldhName |
5.2
|
|
|
|
ipv4 |
v4 ipAddress |
5.2
|
|
|
|
ipv6 |
v6 ipAddress |
5.2
|
|
|
Entity |
handle |
handle |
5.1
|
|
|
|
fn |
jCard fn |
5.1
|
6.2.1
|
|
|
org |
jCard org |
5.1
|
6.6.4
|
|
|
voice |
jCard tel with type="voice" |
5.1
|
6.4.1
|
|
|
email |
jCard email |
5.1
|
6.4.2
|
|
|
country |
country name in jCard adr |
5.1
|
6.3.1
|
|
|
cc |
country code in jCard adr |
5.1
|
|
3.1
|
|
city |
locality in jCard adr |
5.1
|
6.3.1
|
|
Table 1: Definitions of Sorting Properties
Regarding the definitions in
Table 1, some further considerations are needed to disambiguate some cases:
-
Since the response to a search on either domains or nameservers might include both A-labels and U-labels [RFC 5890] in general, a consistent sorting policy MUST treat the unicodeName and ldhName as two representations of the same value. The unicodeName value MUST be used while sorting if it is present; when the unicodeName is unavailable, the value of the ldhName MUST be used instead.
-
The jCard "sort-as" parameter MUST be ignored for the sorting capability described in this document.
-
Even if a nameserver can have multiple IPv4 and IPv6 addresses, the most common configuration includes one address for each IP version. Therefore, this specification makes the assumption that nameservers have a single IPv4 and/or IPv6 value. When more than one address per IP version is presented, sorting MUST be applied to the first value.
-
Multiple events with a given action on an object might be returned. If this occurs, sorting MUST be applied to the most recent event.
-
Except for handle values, all the sorting properties defined for entity objects can be multivalued according to the definition of vCard as given in [RFC 6350]. When more than one value is presented, sorting MUST be applied to the preferred value identified by the parameter pref="1". If the "pref" parameter is missing, sorting MUST be applied to the first value.
The "jsonPath" field in the "sorting_metadata" element is used to clarify the RDAP response field the sorting property refers to. The mapping between the sorting properties and the jsonpaths of the RDAP response fields is shown below. The JSONPath operators used herein are described in
Appendix A.
-
Searchable objects
-
registrationDate
-
$.domainSearchResults[*].events[?(@.eventAction=="registration")].eventDate
-
reregistrationDate
-
$.domainSearchResults[*].events[?(@.eventAction=="reregistration")].eventDate
-
lastChangedDate
-
$.domainSearchResults[*].events[?(@.eventAction=="last changed")].eventDate
-
expirationDate
-
$.domainSearchResults[*].events[?(@.eventAction=="expiration")].eventDate
-
deletionDate
-
$.domainSearchResults[*].events[?(@.eventAction=="deletion")].eventDate
-
reinstantiationDate
-
$.domainSearchResults[*].events[?(@.eventAction=="reinstantiation")].eventDate
-
transferDate
-
$.domainSearchResults[*].events[?(@.eventAction=="transfer")].eventDate
-
lockedDate
-
$.domainSearchResults[*].events[?(@.eventAction=="locked")].eventDate
-
unlockedDate
-
$.domainSearchResults[*].events[?(@.eventAction=="unlocked")].eventDate
-
Domain
-
name
-
$.domainSearchResults[*].[unicodeName,ldhName]
-
Nameserver
-
name
-
$.nameserverSearchResults[*].[unicodeName,ldhName]
-
ipv4
-
$.nameserverSearchResults[*].ipAddresses.v4[0]
-
ipv6
-
$.nameserverSearchResults[*].ipAddresses.v6[0]
-
Entity
-
handle
-
$.entitySearchResults[*].handle
-
fn
-
$.entitySearchResults[*].vcardArray[1][?(@[0]=="fn")][3]
-
org
-
$.entitySearchResults[*].vcardArray[1][?(@[0]=="org")][3]
-
voice
-
$.entitySearchResults[*].vcardArray[1][?(@[0]=="tel" && @[1].type=="voice")][3]
-
email
-
$.entitySearchResults[*].vcardArray[1][?(@[0]=="email")][3]
-
country
-
$.entitySearchResults[*].vcardArray[1][?(@[0]=="adr")][3][6]
-
cc
-
$.entitySearchResults[*].vcardArray[1][?(@[0]=="adr")][1].cc
-
city
-
$.entitySearchResults[*].vcardArray[1][?(@[0]=="adr")][3][3]
Additional notes on the provided jsonpaths:
-
Those related to the event dates are defined only for the "domain" object. To obtain the equivalent jsonpaths for "entity" and "nameserver", the path segment "domainSearchResults" must be replaced with "entitySearchResults" and "nameserverSearchResults", respectively.
-
Those related to jCard elements are specified without taking into account the "pref" parameter. Servers that sort those values identified by the "pref" parameter SHOULD update a jsonpath by adding an appropriate filter. For example, if the email values identified by pref="1" are considered for sorting, the jsonpath of the "email" sorting property should be $.entitySearchResults[*].vcardArray[1][?(@[0]=="email" && @[1].pref=="1")][3].
An RDAP server
MAY use the "links" array of the "sorting_metadata" element to provide ready-made references [
RFC 8288] to the available sort criteria (
Figure 2). Each link represents a reference to an alternate view of the results.
The "value", "rel", and "href" JSON values
MUST be specified. All other JSON values are
OPTIONAL.
{
"rdapConformance": [
"rdap_level_0",
"sorting"
],
...
"sorting_metadata": {
"currentSort": "name",
"availableSorts": [
{
"property": "registrationDate",
"jsonPath": "$.domainSearchResults[*]
.events[?(@.eventAction==\"registration\")].eventDate",
"default": false,
"links": [
{
"value": "https://example.com/rdap/domains?name=example*.com
&sort=name",
"rel": "alternate",
"href": "https://example.com/rdap/domains?name=example*.com
&sort=registrationDate",
"title": "Result Ascending Sort Link",
"type": "application/rdap+json"
},
{
"value": "https://example.com/rdap/domains?name=example*.com
&sort=name",
"rel": "alternate",
"href": "https://example.com/rdap/domains?name=example*.com
&sort=registrationDate:d",
"title": "Result Descending Sort Link",
"type": "application/rdap+json"
}
]
},
...
]
},
"domainSearchResults": [
...
]
}
The "cursor" parameter defined in this specification can be used to encode information about any pagination method. For example, in the case of a simple implementation of the "cursor" parameter to represent offset pagination information, the "cursor" value "b2Zmc2V0PTEwMCxsaW1pdD01MA==" is the base64 encoding of "offset=100,limit=50". Likewise, in a simple implementation to represent keyset pagination information, the "cursor" value "ZXhhbXBsZS1OLmNvbQ==" represents the base64 encoding of "key=example-N.com" whereby the key value identifies the last row of the current page.
Note that this specification uses a base64 encoding for cursor obfuscation just for example. RDAP servers are
NOT RECOMMENDED to obfuscate the "cursor" value through a mere base64 encoding.
This solution lets RDAP providers implement a pagination method according to their needs, a user's access level, and the submitted query. Besides, servers can change the method over time without announcing anything to clients. The considerations that have led to this solution are described in more detail in
Appendix B.
The ABNF syntax of the "cursor" parameter is the following:
cursor = "cursor=" 1*( ALPHA / DIGIT / "/" / "=" / "-" / "_" )
The following is an example of an RDAP query including the "cursor" parameter:
https://example.com/rdap/domains?name=example*.com &cursor=wJlCDLIl6KTWypN7T6vc6nWEmEYe99Hjf1XY1xmqV-M=
An RDAP server
SHOULD use the "links" array of the "paging_metadata" element to provide a ready-made reference [
RFC 8288] to the next page of the result set (
Figure 3). Examples of additional "rel" values a server
MAY implement are "first", "last", and "prev".
{
"rdapConformance": [
"rdap_level_0",
"paging"
],
...
"notices": [
{
"title": "Search query limits",
"type": "result set truncated due to excessive load",
"description": [
"search results for domains are limited to 50"
]
}
],
"paging_metadata": {
"totalCount": 73,
"pageSize": 50,
"pageNumber": 1,
"links": [
{
"value": "https://example.com/rdap/domains?name=example*.com",
"rel": "next",
"href": "https://example.com/rdap/domains?name=example*.com
&cursor=wJlCDLIl6KTWypN7T6vc6nWEmEYe99Hjf1XY1xmqV-M=",
"title": "Result Pagination Link",
"type": "application/rdap+json"
}
]
},
"domainSearchResults": [
...
]
}