<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rfc SYSTEM "http://xml.resource.org/authoring/rfc2629.dtd"
[
  <!ENTITY RFC2119 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
  <!ENTITY RFC5234 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5234.xml'>
  <!ENTITY RFC5890 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5890.xml'>
  <!ENTITY RFC6350 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6350.xml'>
  <!ENTITY RFC6901 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6901.xml'>
  <!ENTITY RFC7095 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7095.xml'>
  <!ENTITY RFC7230 PUBLIC ''
  'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7230.xml'>
  <!ENTITY RFC7231 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7231.xml'>
  <!ENTITY RFC7480 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7480.xml'>
  <!ENTITY RFC7481 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7481.xml'>
  <!ENTITY RFC7482 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7482.xml'>
  <!ENTITY RFC7483 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7483.xml'>
  <!ENTITY RFC7942 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7942.xml'>
  <!ENTITY RFC8174 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml'>
  <!ENTITY RFC8259 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8259.xml'>
  <!ENTITY RFC8288 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8288.xml'>
  <!ENTITY RFC8605 PUBLIC ''
   'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8605.xml'>
  <!ENTITY W3C.CR-xpath-31-20161213 PUBLIC ''
   'https://xml2rfc.tools.ietf.org/public/rfc/bibxml4/reference.W3C.CR-xpath-31-20161213.xml'>
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>

<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="4"?>
<?rfc compact="yes"?>
<?rfc subcompact="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc iprnotified="no"?> "rfc2629-xhtml.ent">

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" xml:lang="en" submissionType="IETF"
category="std" consensus="true" docName="draft-ietf-regext-rdap-sorting-and-paging-20" ipr="trust200902">
number="8977" updates="" obsoletes="" ipr="trust200902" tocInclude="true" tocDepth="4"
sortRefs="true" symRefs="true" version="3">

  <front>
    <title abbrev="RDAP Sorting and Paging">Registration Data Access Protocol (RDAP) Query Parameters for Result Sorting and Paging</title>
    <seriesInfo name="RFC" value="8977"/>
    <author fullname="Mario Loffredo" initials="M." surname="Loffredo">
      <organization>IIT-CNR/Registro.it</organization>
      <address>
        <postal>
          <street>Via Moruzzi,1</street>
          <city>Pisa</city>
          <country>IT</country>
          <country>Italy</country>
          <code>56124</code>
        </postal>
        <email>mario.loffredo@iit.cnr.it</email>
        <uri>http://www.iit.cnr.it</uri>
        <uri>https://www.iit.cnr.it</uri>
      </address>
    </author>
    <author fullname="Maurizio Martinelli" initials="M." surname="Martinelli">
      <organization>IIT-CNR/Registro.it</organization>
      <address>
        <postal>
          <street>Via Moruzzi,1</street>
          <city>Pisa</city>
          <country>IT</country>
          <country>Italy</country>
          <code>56124</code>
        </postal>
        <email>maurizio.martinelli@iit.cnr.it</email>
        <uri>http://www.iit.cnr.it</uri>
        <uri>https://www.iit.cnr.it</uri>
      </address>
    </author>
    <author initials="S." surname="Hollenbeck" fullname="Scott Hollenbeck">
      <organization>Verisign Labs</organization>
      <address>
        <postal>
          <street>12061 Bluemont Way</street>
          <city>Reston</city>
          <region>VA</region>
          <code>20190</code>
          <country>USA</country>
          <country>United States of America</country>
        </postal>
        <email>shollenbeck@verisign.com</email>
        <uri>https://www.verisignlabs.com/</uri>
      </address>
    </author>

    <date/>
    <date year="2021" month="January" />
    <area>Applications and Real-Time</area>
    <workgroup>Registration Protocols Extensions</workgroup>
    <keyword>RDAP</keyword>
    <keyword>Sorting</keyword>
    <keyword>Paging</keyword>
    <abstract>
      <t>The Registration Data Access Protocol (RDAP) does not include core functionality for clients to provide sorting and paging parameters for control of large result sets.  This omission can lead to unpredictable server processing of queries and client processing of responses.  This unpredictability can be greatly reduced if clients can provide servers with their preferences for managing large responses.  This document describes RDAP query extensions that allow clients to specify their preferences for sorting and paging result sets.</t>
    </abstract>
  </front>
  <middle>
    <section title="Introduction">
    <section>
      <name>Introduction</name>
      <t>The availability of functionality for result sorting and paging provides benefits to both clients and servers in the implementation of RESTful services <xref target="REST"/>.  These benefits include:</t>

        <t><list style="symbols">
	  <t>reducing
      <ul>
        <li>reducing the server response bandwidth requirements;</t>
	  <t>improving requirements</li>
        <li>improving server response time;</t>
	  <t>improving time</li>
        <li>improving query precision and, consequently, obtaining more relevant results;</t>
	  <t>decreasing results</li>
        <li>decreasing server query processing load;</t>
	  <t>reducing load</li>
        <li>reducing client response processing time.</t>
	</list></t> time</li>
      </ul>
      <t>Approaches to implementing features for result sorting and paging can be grouped into two main categories:</t>

        <t><list style="numbers">
	  <t>sorting
      <ol type="1"><li>
          <t>Sorting and paging are implemented through the introduction of additional parameters in the query string (e.g. ODATA protocol (e.g., the Open Data Protocol (ODATA) <xref target="OData-Part1"/>);<vspace blankLines='1' /></t>
	  <t>information target="ODATA-PART1"/>).</t>

        </li>
        <li>Information related to the number of results and the specific portion of the result set to be returned, in addition to a set of ready-made links for the result set scrolling, are inserted in the HTTP header of the request/response <xref target="RFC7231"/>.</t>
	</list></t> target="RFC7231"/>.</li>
      </ol>
      <t>However, there are some drawbacks associated with the use of the HTTP header.  First, the header properties cannot be set directly from a web browser.  Moreover, in an HTTP session, the information on the status (i.e. (i.e., the session identifier) is usually inserted in the header or a cookie, while the information on the resource identification or the search type is included in the query string.  Finally, providing custom information through HTTP headers assumes the client to have a has prior knowledge of the server implementation implementation, which is widely considered a REST Representational State Transfer (REST) design anti-pattern.  As a result, this document describes a specification based on the use of query parameters.</t>
      <t>Currently, the RDAP protocol <xref target="RFC7482"/> defines two query types:</t>

        <t><list style="symbols">
	  <t>lookup: the

<dl>

<dt>lookup:
</dt>
<dd>the server returns only one object;</t>
	  <t>search: the object
</dd>

<dt>search:
</dt>
<dd>the server returns a collection of objects.</t>
	</list></t> objects
</dd>

</dl>

      <t>While the lookup query does not raise issues regarding response size management, the search query can potentially generate a large result set that is often truncated according to server limits.  Besides, it is not possible to obtain the total number of objects found that might be returned in a search query response <xref target="RFC7483"/>.  Lastly, there is no way to specify sort criteria to return the most relevant objects at the beginning of the result set.  Therefore, the client might traverse the whole result set to find the relevant objects or, due to truncation, might not find them at all.</t>
      <t>The specification described in this document extends RDAP query capabilities to enable result sorting and paging, paging by adding new query parameters that can be applied to RDAP search path segments.  The service is implemented using the Hypertext Transfer Protocol (HTTP) <xref target="RFC7230"/> and the conventions described in <xref target="RFC7480"/>.</t>
      <t>The implementation of the new parameters is technically feasible, as operators for counting, sorting sorting, and paging rows are currently supported by the major relational database management systems.</t>

      <section title="Conventions
      <section>
        <name>Conventions Used in This Document">
        <t>The Document</name>

        <t>
    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
    "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>",
    "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "OPTIONAL" "<bcp14>OPTIONAL</bcp14>" in this document are
    to be interpreted as described in BCP 14 BCP&nbsp;14 <xref target="RFC2119"/>
    <xref target="RFC8174"/> when, and only when, they appear in all capitals,
    as shown here.</t> here.
        </t>

      </section>
    </section>
    <section anchor="rdap-query-parameter-specification" title="RDAP anchor="rdap-query-parameter-specification">
      <name>RDAP Query Parameter Specification"> Specification</name>
      <t>The new query parameters are OPTIONAL <bcp14>OPTIONAL</bcp14> extensions of path segments defined in <xref target="RFC7482"/>.  They are as follows:</t>

        <t><list style="symbols">
	  <t>&quot;count&quot;: a

<dl>

<dt>"count":
</dt>
<dd>a boolean value that allows a client to request the return of the total number of objects found;<vspace blankLines='1'/></t>
	  <t>&quot;sort&quot;: a found
</dd>

<dt>"sort":
</dt>
<dd>a string value that allows a client to request a specific sort order for the result set;<vspace blankLines='1'/></t>
        <t>&quot;cursor&quot;: a set
</dd>

<dt>"cursor":
</dt>
<dd>a string value representing a pointer to a specific fixed size fixed-size portion of the result set.</t>
	</list></t> set
</dd>

</dl>

      <t>Augmented Backus-Naur Form (ABNF) <xref target="RFC5234"/> is used in the following sections to describe the formal syntax of these new parameters.</t>
      <section anchor="sorting_and_paging_metadata" title="Sorting anchor="sorting_and_paging_metadata">
        <name>Sorting and Paging Metadata"> Metadata</name>

        <t>According to most advanced principles in REST design, collectively
        known as HATEOAS (Hypermedia as the Engine of Application State)
        <xref target="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 not neither required to have prior knowledge of the
        service and, 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.</t>

        <t>Therefore, servers implementing the query parameters described in this specification SHOULD <bcp14>SHOULD</bcp14> provide additional information in their responses about both the available sorting criteria and possible pagination.  Such information is collected in two OPTIONAL <bcp14>OPTIONAL</bcp14> response elements named &quot;sorting_metadata&quot; "sorting_metadata" and &quot;paging_metadata&quot;.</t> "paging_metadata".</t>
        <t>The &quot;sorting_metadata&quot; "sorting_metadata" element contains the following properties:</t>
        <t><list style="symbols">
	  <t>&quot;currentSort&quot;: &quot;String&quot; (OPTIONAL) either

<dl newline="true">

<dt>"currentSort": "String" (<bcp14>OPTIONAL</bcp14>)
</dt>
<dd>Either the value of &quot;sort&quot; the "sort" parameter as specified in the query string or
the sort applied by default, if any;<vspace blankLines='1'/></t>
	  <t>&quot;availableSorts&quot;: &quot;AvailableSort[]&quot; (OPTIONAL) an any.
</dd>

<dt>"availableSorts": "AvailableSort[]" (<bcp14>OPTIONAL</bcp14>)
</dt>

<dd><t>An array of objects, with each element describing an available sort criterion. The AvailableSort object includes the following members:
          <list style="symbols">
	  <t>&quot;property&quot;: &quot;String&quot; (REQUIRED) the members:</t>

<dl newline="true">

<dt>"property": "String" (<bcp14>REQUIRED</bcp14>)
</dt>
<dd>The name that can be used by the client to request the sort criterion;</t>
          <t>&quot;default&quot;: &quot;Boolean&quot; (REQUIRED) criterion.
</dd>

<dt>"default": "Boolean" (<bcp14>REQUIRED</bcp14>)
</dt>
<dd>Indicator of whether the sort criterion is applied by default. An RDAP server MUST <bcp14>MUST</bcp14> define only one default sorting property for each object class;</t>
          <t>&quot;jsonPath&quot;: &quot;String&quot; (OPTIONAL) the class.
</dd>

<dt>"jsonPath": "String" (<bcp14>OPTIONAL</bcp14>)
</dt>
<dd>The JSONPath expression of the RDAP field corresponding to the property;</t>
	  <t>&quot;links&quot;: &quot;Link[]&quot; (OPTIONAL) an property.
</dd>

<dt>"links": "Link[]" (<bcp14>OPTIONAL</bcp14>)
</dt>
<dd>An array of links as described in <xref target="RFC8288"/> containing the
query string that applies the sort criterion.</t>
	  </list></t>
	</list></t> criterion.
</dd>

</dl>

</dd>

</dl>

        <t>At least one of the &quot;currentSort&quot; "currentSort" and &quot;availableSorts&quot; "availableSorts" properties MUST
        <bcp14>MUST</bcp14> be present.</t>
        <t>The &quot;paging_metadata&quot; "paging_metadata" element contains the following fields:</t>
        <t><list style="symbols">
	  <t>&quot;totalCount&quot;: &quot;Numeric&quot; (OPTIONAL) a

<dl newline="true">

<dt>"totalCount": "Numeric" (<bcp14>OPTIONAL</bcp14>)
</dt>
<dd>A numeric value representing the total number of objects found.  It MUST
<bcp14>MUST</bcp14> be provided if and only if the query string contains the &quot;count&quot; parameter;<vspace blankLines='1'/></t>
	  <t>&quot;pageSize&quot;: &quot;Numeric&quot; (OPTIONAL) a
"count" parameter.
</dd>

<dt>"pageSize": "Numeric" (<bcp14>OPTIONAL</bcp14>)
</dt>
<dd>A numeric value representing the number of objects that should have been
returned in the current page.  It MUST <bcp14>MUST</bcp14> be provided if and only
if the total number of objects exceeds the page size.  This property is
redundant for RDAP clients because the page size can be derived from the
length of the search results array but, array, but it can be helpful if the end user
interacts with the server through a web browser;<vspace blankLines='1'/></t>
	  <t>&quot;pageNumber&quot;: &quot;Numeric&quot; (OPTIONAL) a browser.
</dd>

<dt>"pageNumber": "Numeric" (<bcp14>OPTIONAL</bcp14>)
</dt>
<dd>A numeric value representing the number of the current page in the result
set.  It MUST <bcp14>MUST</bcp14> be provided if and only if the total number of
objects found exceeds the page size;<vspace blankLines='1'/></t>
	  <t>&quot;links&quot;: &quot;Link[]&quot; (OPTIONAL) an size.
</dd>

<dt>"links": "Link[]" (<bcp14>OPTIONAL</bcp14>)
</dt>
<dd>An array of links as described in <xref target="RFC8288"/> containing the
reference to the next page.  In this specification, only forward pagination is
described because it is all that is necessary to traverse the result set.</t>
	</list></t> set.
</dd>
</dl>

        <section anchor="rdap-conformance" title="RDAP Conformance"> anchor="rdap-conformance">
          <name>RDAP Conformance</name>
          <t>Servers returning the &quot;paging_metadata&quot; "paging_metadata" element in their response MUST
          <bcp14>MUST</bcp14> include the string literal &quot;paging&quot; "paging" in the
          rdapConformance array.  Servers returning the &quot;sorting_metadata&quot; "sorting_metadata"
          element MUST <bcp14>MUST</bcp14> include the string literal &quot;sorting&quot;.</t>
          "sorting".</t>
        </section>
      </section>
      <section anchor="count-parameter" title="&quot;count&quot; Parameter"> anchor="count-parameter">
        <name>"count" Parameter</name>
        <t>Currently, the RDAP protocol does not allow a client to determine
        the total number of the 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.</t>
        <t>The &quot;count&quot; "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.</t>
        <t>The following is an example of an RDAP query including the &quot;count&quot; "count" parameter:</t>

        <t>https://example.com/rdap/domains?name=example*.com&amp;count=true</t>
        <t>https://example.com/rdap/domains?name=example*.com&amp;count=true
        </t>
        <t>The ABNF syntax is the following:</t>
		<t><list style="empty">
		<t>count
<sourcecode type="abnf">
   count = &quot;count=&quot; "count=" ( trueValue / falseValue )</t>
		<t>trueValue )
   trueValue = (&quot;true&quot; ("true" / &quot;yes&quot; "yes" / &quot;1&quot;)</t>
		<t>falseValue "1")
   falseValue = (&quot;false&quot; ("false" / &quot;no&quot; "no" / &quot;0&quot;)</t>
		</list></t> "0")
</sourcecode>
        <t>A trueValue means that the server MUST <bcp14>MUST</bcp14> provide the
        total number of the objects in the &quot;totalCount&quot; "totalCount" field of the &quot;paging_metadata&quot;
        "paging_metadata" element (<xref
        target="count-in-response-example"/>).  A falseValue means that the
        server MUST NOT <bcp14>MUST NOT</bcp14> provide this number.</t>
        <figure anchor="count-in-response-example" title="Example anchor="count-in-response-example">
          <name>Example of RDAP response Response with &quot;paging_metadata&quot; element containing the &quot;totalCount&quot; field">
        <artwork xml:space="preserve"> "paging_metadata" Element Containing the "totalCount" Field</name>
<sourcecode type="json">
{
  "rdapConformance": [
        "rdap_level_0",
        "paging"
  ],
  ...
  "paging_metadata": {
    "totalCount": 43
  },
  "domainSearchResults": [
    ...
  ]
}
        </artwork>
</sourcecode>
        </figure>
      </section>
      <section anchor="sort-parameter" title="&quot;sort&quot; Parameter">

	<t>The RDAP protocol anchor="sort-parameter">
        <name>"sort" Parameter</name>
        <t>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.</t>
        <t>The &quot;sort&quot; "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:</t>

	<t><list style="empty">
	<t>sort
<sourcecode type="abnf">
   sort = &quot;sort=&quot; "sort=" sortItem *( &quot;,&quot; "," sortItem )
   sortItem )</t>
	<t>sortItem = property-ref [&quot;:&quot; [":" ( &quot;a&quot; "a" / &quot;d&quot; "d" ) ]</t>
      <t>property-ref ]
   property-ref = ALPHA *( ALPHA / DIGIT / &quot;_&quot; "_" ) </t>
	</list></t>

	<t>&quot;a&quot;
</sourcecode>

        <t>"a" means that an ascending sort MUST <bcp14>MUST</bcp14> be applied, &quot;d&quot; applied; "d" means that a descending sort MUST <bcp14>MUST</bcp14> be applied.  If the sort direction is absent, an ascending sort MUST <bcp14>MUST</bcp14> be applied.</t>
        <t>The following are examples of RDAP queries including that include the &quot;sort&quot; "sort" parameter:</t>

    <t>https://example.com/rdap/domains?name=example*.com&amp;sort=name</t>

    <t>https://example.com/rdap/domains?name=example*.com&amp;sort=registrationDate:d</t>

    <t>https://example.com/rdap/domains?name=example*.com&amp;sort=lockedDate,name</t>

<t>
https://example.com/rdap/domains?name=example*.com&amp;sort=name
</t>
<t>
https://example.com/rdap/
domains?name=example*.com&amp;sort=registrationDate:d
</t>
<t>
https://example.com/rdap/
domains?name=example*.com&amp;sort=lockedDate,name
</t>
        <t>Except for sorting IP addresses and values denoting dates and times, servers MUST <bcp14>MUST</bcp14> implement sorting according to the JSON value type of the RDAP field the sorting property refers to.  That is, JSON strings MUST <bcp14>MUST</bcp14> be sorted lexicographically lexicographically, and JSON numbers MUST <bcp14>MUST</bcp14> be sorted numerically.  Values denoting dates and times MUST <bcp14>MUST</bcp14> be sorted in chronological order.  If IP addresses are represented as JSON strings, they MUST <bcp14>MUST</bcp14> be sorted based on their numeric conversion.</t>

        <t>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: 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.  Builtin  Built-in functions and libraries for converting IP addresses into numbers are available in most known programming languages and relational database management systems.</t>
        <t>If the &quot;sort&quot; "sort" parameter presents an allowed sorting property, it MUST <bcp14>MUST</bcp14> be provided in the &quot;currentSort&quot; "currentSort" field of the &quot;sorting_metadata&quot; "sorting_metadata" element.</t>
        <section anchor="sorting_properties" title="Sorting anchor="sorting_properties">
          <name>Sorting Properties Declaration"> Declaration</name>
          <t>In the &quot;sort&quot; "sort" parameter ABNF syntax, the element named &quot;property-ref&quot; "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).</t>
          <t>JSONPath is a syntax, originally based on the XML XPath notation <xref target="W3C.CR-xpath-31-20161213"/>, target="W3C.CR-xpath-31-20170321"/>, which represents a path to select an element (or a set of elements) in a JSON document <xref target="RFC8259"/>.  For example, the jsonpath to select the value of the ASCII name inside an RDAP domain lookup response is &quot;$.ldhName&quot;, "$.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 <xref target="RFC6901"/>.</t>
          <t>While JSONPath or and JSON Pointer are both commonly adopted
          notations to select any value inside JSON data, neither is
          particularly coincise concise and easy to use (e.g. &quot;$.domainSearchResults[*].events[?(@.eventAction=&apos;registration&apos;)].eventDate&quot;
          (e.g., "$.domainSearchResults[*].events[?(@.eventAction='registration')].eventDate"
          is the jsonpath of the registration date in an RDAP domain search
          response).</t>
          <t>Therefore, this specification defines the &quot;property-ref&quot; "property-ref" element in terms of names identifying RDAP properties.  However, not all the RDAP properties are suitable to be used in sort criteria, such as:</t>

        <t><list style="symbols"> criteria. These properties include:</t>
          <ul>
            <li>
              <t>properties providing service information (e.g. (e.g., links, notices, remarks);<vspace blankLines='1' /></t> and remarks)</t>
            </li>
            <li>
              <t>multivalued properties (e.g. (e.g., status, roles, variants);<vspace blankLines='1' /></t>
	  <t>properties and variants)</t>
            </li>
            <li>properties representing relationships to other objects (e.g. entities).</t>
	</list></t> (e.g., entities)</li>
          </ul>
          <t>On the contrary, properties expressed as values of other
          properties (e.g. (e.g., registration date) could be used in such a
          context.</t>
          <t>A list of properties an RDAP server MAY <bcp14>MAY</bcp14> implement
          is defined.  The properties are divided into two groups: object common
          object-common properties and object specific object-specific properties.</t>

        <t><list style="symbols">
	  <t>Object common

          <ul>
            <li><t>Object-common properties.  Object common Object-common properties are derived from merging the &quot;eventAction&quot; "eventAction" and the &quot;eventDate&quot; "eventDate" properties. The following values of the &quot;sort&quot; "sort" parameter are defined:
	  <list style="symbols">
	    <t>registrationDate</t>
	    <t>reregistrationDate</t>
	    <t>lastChangedDate</t>
	    <t>expirationDate</t>
	    <t>deletionDate</t>
	    <t>reinstantiationDate</t>
	    <t>transferDate</t>
	    <t>lockedDate</t>
	    <t>unlockedDate</t>
	  </list></t>
	  </list></t>
	  <t><list style="symbols">
	  <t>Object specific defined:</t>

<ul>

<li>registrationDate
</li>

<li>reregistrationDate
</li>

<li>lastChangedDate
</li>

<li>expirationDate
</li>

<li>deletionDate
</li>

<li>reinstantiationDate
</li>

<li>transferDate
</li>

<li>lockedDate
</li>

<li>unlockedDate
</li>

</ul>

</li>

<li><t>Object-specific properties. Note that some of these properties are also defined as query path segments. These properties include:
	  <list style="symbols">
	    <t>Domain: name</t>
	    <t>Nameserver: include:</t>
<ul>
<li>Domain: name
</li>

<li>Nameserver: name, ipv4, ipv6.</t>
	    <t>Entity: ipv6
</li>

<li>Entity: fn, handle, org, email, voice, country, cc, city.</t>
	  </list></t>
	</list></t> city
</li>

</ul>

            </li>
          </ul>

          <t>The correspondence between these sorting properties and the RDAP
          object classes is shown in <xref
          target="table_sorting_properties_definition"/>.  Some of the sorting
          properties defined for the RDAP entity class are related to jCard
          elements <xref target="RFC7095"/> but, being target="RFC7095"/>, but because jCard is the JSON format
          for vCard <xref target="RFC6350"/>, vCard, the corresponding definitions
          are included in the vCard specification.</t> specification <xref target="RFC6350"/>.</t>
          <t>An RDAP server MUST NOT <bcp14>MUST NOT</bcp14> use the defined sorting
          properties with a meaning other than the one that described in <xref
          target="table_sorting_properties_definition"/>.</t>

    <texttable anchor="table_sorting_properties_definition" title="Sorting properties definition">
	<ttcol
          <table anchor="table_sorting_properties_definition">
            <name>Definitions of Sorting Properties</name>
            <thead>
              <tr>
                <th align="left">Object class</ttcol>
	<ttcol class</th>
                <th align="left">Sorting property</ttcol>
	<ttcol property</th>
                <th align="left">RDAP property</ttcol>
	<ttcol property</th>
                <th align="left">RFC 7483</ttcol>
	<ttcol 7483</th>
                <th align="left">RFC 6350</ttcol>
	<ttcol 6350</th>
                <th align="left">RFC 8605</ttcol>
	<c>Searchable objects</c><c>Common properties</c><c>eventAction 8605</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td align="left">Searchable objects</td>
                <td align="left">Common properties</td>
                <td align="left">eventAction values suffixed by &quot;Date&quot;</c><c>4.5</c><c></c><c></c>
	<c></c><c></c><c></c><c></c><c></c><c></c>
	<c>Domain</c><c>name</c><c>unicodeName/ ldhName</c><c>5.3</c><c></c><c></c>
	<c></c><c></c><c></c><c></c><c></c><c></c>
	<c>Nameserver</c><c>name</c><c>unicodeName/ ldhName</c><c>5.2</c><c></c><c></c>
	<c></c><c>ipv4</c><c>v4 ipAddress</c><c>5.2</c><c></c><c></c>
	<c></c><c>ipv6</c><c>v6 ipAddress</c><c>5.2</c><c></c><c></c>
	<c></c><c></c><c></c><c></c><c></c><c></c>
	<c>Entity</c><c>handle</c><c>handle</c><c>5.1</c><c></c><c></c>
	<c></c><c>fn</c><c>jCard fn</c><c>5.1</c><c>6.2.1</c><c></c>
	<c></c><c>org</c><c>jCard org</c><c>5.1</c><c>6.6.4</c><c></c>
	<c></c><c>voice</c><c>jCard "Date"</td>
                <td align="left"><xref target="RFC7483" section="4.5" sectionFormat="bare"/></td>
                <td align="left"/>
                <td align="left"/>
              </tr>

              <tr>
                <td align="left">Domain</td>
                <td align="left">name</td>
                <td align="left">unicodeName/ ldhName</td>
                <td align="left"><xref target="RFC7483" section="5.3" sectionFormat="bare"/></td>
                <td align="left"/>
                <td align="left"/>
              </tr>

              <tr>
                <td align="left">Nameserver</td>
                <td align="left">name</td>
                <td align="left">unicodeName/ ldhName</td>
                <td align="left"><xref target="RFC7483" section="5.2" sectionFormat="bare"/></td>
                <td align="left"/>
                <td align="left"/>
              </tr>
              <tr>
                <td align="left"/>
                <td align="left">ipv4</td>
                <td align="left">v4 ipAddress</td>
                <td align="left"><xref target="RFC7483" section="5.2" sectionFormat="bare"/></td>
                <td align="left"/>
                <td align="left"/>
              </tr>
              <tr>
                <td align="left"/>
                <td align="left">ipv6</td>
                <td align="left">v6 ipAddress</td>
                <td align="left"><xref target="RFC7483" section="5.2" sectionFormat="bare"/></td>
                <td align="left"/>
                <td align="left"/>
              </tr>

              <tr>
                <td align="left">Entity</td>
                <td align="left">handle</td>
                <td align="left">handle</td>
                <td align="left"><xref target="RFC7483" section="5.1" sectionFormat="bare"/></td>
                <td align="left"/>
                <td align="left"/>
              </tr>
              <tr>
                <td align="left"/>
                <td align="left">fn</td>
                <td align="left">jCard fn</td>
                <td align="left"><xref target="RFC7483" section="5.1" sectionFormat="bare"/></td>
                <td align="left"><xref target="RFC6350" section="6.2.1" sectionFormat="bare"/></td>
                <td align="left"/>
              </tr>
              <tr>
                <td align="left"/>
                <td align="left">org</td>
                <td align="left">jCard org</td>
                <td align="left"><xref target="RFC7483" section="5.1" sectionFormat="bare"/></td>
                <td align="left"><xref target="RFC6350" section="6.6.4" sectionFormat="bare"/></td>
                <td align="left"/>
              </tr>
              <tr>
                <td align="left"/>
                <td align="left">voice</td>
                <td align="left">jCard tel with type=&quot;voice&quot;</c><c>5.1</c><c>6.4.1</c><c></c>
	<c></c><c>email</c><c>jCard email</c><c>5.1</c><c>6.4.2</c><c></c>
	<c></c><c>country</c><c>country type="voice"</td>
                <td align="left"><xref target="RFC7483" section="5.1" sectionFormat="bare"/></td>
                <td align="left"><xref target="RFC6350" section="6.4.1" sectionFormat="bare"/></td>
                <td align="left"/>
              </tr>
              <tr>
                <td align="left"/>
                <td align="left">email</td>
                <td align="left">jCard email</td>
                <td align="left"><xref target="RFC7483" section="5.1" sectionFormat="bare"/></td>
                <td align="left"><xref target="RFC6350" section="6.4.2" sectionFormat="bare"/></td>
                <td align="left"/>
              </tr>
              <tr>
                <td align="left"/>
                <td align="left">country</td>
                <td align="left">country name in jCard adr</c><c>5.1</c><c>6.3.1</c><c></c>
	<c></c><c>cc</c><c>country adr</td>
                <td align="left"><xref target="RFC7483" section="5.1" sectionFormat="bare"/></td>
                <td align="left"><xref target="RFC6350" section="6.3.1" sectionFormat="bare"/></td>
                <td align="left"/>
              </tr>
              <tr>
                <td align="left"/>
                <td align="left">cc</td>
                <td align="left">country code in jCard adr</c><c>5.1</c><c></c><c>3.1</c>
	<c></c><c>city</c><c>locality adr</td>
                <td align="left"><xref target="RFC7483" section="5.1" sectionFormat="bare"/></td>
                <td align="left"/>
                <td align="left"><xref target="RFC8605" section="3.1" sectionFormat="bare"/></td>
              </tr>
              <tr>
                <td align="left"/>
                <td align="left">city</td>
                <td align="left">locality in jCard adr</c><c>5.1</c><c>6.3.1</c><c></c>
	</texttable> adr</td>
                <td align="left"><xref target="RFC7483" section="5.1" sectionFormat="bare"/></td>
                <td align="left"><xref target="RFC6350" section="6.3.1" sectionFormat="bare"/></td>
                <td align="left"/>
              </tr>
            </tbody>
          </table>
          <t>Regarding the definitions in <xref target="table_sorting_properties_definition"/>, some further considerations are needed to disambiguate some cases:</t>
        <t><list style="symbols">
        <t>since
          <ul>
            <li>
              <t>Since the response to a search on either domains or nameservers might include both A-labels and U-labels <xref target="RFC5890"/> in general, a consistent sorting policy MUST <bcp14>MUST</bcp14> treat the unicodeName and ldhName as two representations of the same value.  The unicodeName value MUST <bcp14>MUST</bcp14> be used while sorting if it is present; when the unicodeName is unavailable, the value of the ldhName MUST <bcp14>MUST</bcp14> be used instead;<vspace blankLines='1' /></t>
        <t>the instead.</t>
            </li>
            <li>
              <t>The jCard &quot;sort-as&quot; "sort-as" parameter MUST <bcp14>MUST</bcp14> be ignored for the sorting capability described in this document;<vspace blankLines='1' /></t>
	  <t>even document.</t>
            </li>
            <li>
              <t>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 <bcp14>MUST</bcp14> be applied to the first value;<vspace blankLines='1' /></t>
       <t>multiple value.</t>
            </li>
            <li>
              <t>Multiple events with a given action on an object might be returned.  If this occurs, sorting MUST <bcp14>MUST</bcp14> be applied to the most recent event;<vspace blankLines='1' /></t>
	<t>except event.</t>

            </li>
            <li>Except for handle values, all the sorting properties defined for entity objects can be multivalued according to the definition of vCard as given in <xref target="RFC6350"/>.  When more than one value is presented, sorting MUST <bcp14>MUST</bcp14> be applied to the preferred value identified by the parameter pref=&quot;1&quot;. pref="1".  If the pref "pref" parameter is missing, sorting MUST <bcp14>MUST</bcp14> be applied to the first value.</t>
	</list></t> value.</li>
          </ul>
          <t>The &quot;jsonPath&quot; "jsonPath" field in the &quot;sorting_metadata&quot; "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 <xref target="jsonpath-operators"/>.</t>

        <t><list style="symbols">
          <ul >
            <li>
              <t>Searchable objects
              <list style="hanging">
              <t hangText="registrationDate"><vspace blankLines='1' />$.domainSearchResults[*].events[?(@.eventAction==&quot;registration&quot;)].eventDate<vspace blankLines='1' /></t>
              <t hangText="reregistrationDate"><vspace blankLines='1' />$.domainSearchResults[*].events[?(@.eventAction==&quot;reregistration&quot;)].eventDate<vspace blankLines='1' /></t>
              <t hangText="lastChangedDate"><vspace blankLines='1' />$.domainSearchResults[*].events[?(@.eventAction==&quot;last changed&quot;)].eventDate<vspace blankLines='1' /></t>
              <t hangText="expirationDate"><vspace blankLines='1' />$.domainSearchResults[*].events[?(@.eventAction==&quot;expiration&quot;)].eventDate<vspace blankLines='1' /></t>
              <t hangText="deletionDate"><vspace blankLines='1' />$.domainSearchResults[*].events[?(@.eventAction==&quot;deletion&quot;)].eventDate<vspace blankLines='1' /></t>
              <t hangText="reinstantiationDate"><vspace blankLines='1' />$.domainSearchResults[*].events[?(@.eventAction==&quot;reinstantiation&quot;)].eventDate<vspace blankLines='1' /></t>
              <t hangText="transferDate"><vspace blankLines='1' />$.domainSearchResults[*].events[?(@.eventAction==&quot;transfer&quot;)].eventDate<vspace blankLines='1' /></t>
              <t hangText="lockedDate"><vspace blankLines='1' />$.domainSearchResults[*].events[?(@.eventAction==&quot;locked&quot;)].eventDate<vspace blankLines='1' /></t>
              <t hangText="unlockedDate"><vspace blankLines='1' />$.domainSearchResults[*].events[?(@.eventAction==&quot;unlocked&quot;)].eventDate<vspace blankLines='1' /></t>
 		   </list>
              </t>
              <dl newline="true">
                <dt>registrationDate</dt>

                <dd>
<t>$.domainSearchResults[*].events[?(@.eventAction=="registration")].eventDate</t>
                </dd>
                <dt>reregistrationDate</dt>
                <dd>
                  <t>$.domainSearchResults[*].events[?(@.eventAction=="reregistration")].eventDate</t>

                </dd>
                <dt>lastChangedDate</dt>
                <dd>
                  <t>$.domainSearchResults[*].events[?(@.eventAction=="last changed")].eventDate</t>

                </dd>
                <dt>expirationDate</dt>
                <dd>
                  <t>$.domainSearchResults[*].events[?(@.eventAction=="expiration")].eventDate</t>

                </dd>
                <dt>deletionDate</dt>
                <dd>
                  <t>$.domainSearchResults[*].events[?(@.eventAction=="deletion")].eventDate</t>

                </dd>
                <dt>reinstantiationDate</dt>
                <dd>
                  <t>$.domainSearchResults[*].events[?(@.eventAction=="reinstantiation")].eventDate</t>

                </dd>
                <dt>transferDate</dt>
                <dd>
                  <t>$.domainSearchResults[*].events[?(@.eventAction=="transfer")].eventDate</t>

                </dd>
                <dt>lockedDate</dt>
                <dd>
                  <t>$.domainSearchResults[*].events[?(@.eventAction=="locked")].eventDate</t>

                </dd>
                <dt>unlockedDate</dt>
                <dd>
                  <t>$.domainSearchResults[*].events[?(@.eventAction=="unlocked")].eventDate</t>

                </dd>
              </dl>
            </li>
            <li>
              <t>Domain
              <list style="hanging">
		   <t hangText="name"><vspace blankLines='1' />$.domainSearchResults[*].[unicodeName,ldhName]<vspace blankLines='1' /></t>
 		   </list>
              </t>
              <dl newline="true">
                <dt>name</dt>
                <dd>
                  <t>$.domainSearchResults[*].[unicodeName,ldhName]</t>

                </dd>
              </dl>
            </li>
            <li>
              <t>Nameserver
              <list style="hanging">
		   <t hangText="name"><vspace blankLines='1' />$.nameserverSearchResults[*].[unicodeName,ldhName]<vspace blankLines='1' /></t>
		   <t hangText="ipv4"><vspace blankLines='1' />$.nameserverSearchResults[*].ipAddresses.v4[0]<vspace blankLines='1' /></t>
		   <t hangText="ipv6"><vspace blankLines='1' />$.nameserverSearchResults[*].ipAddresses.v6[0]<vspace blankLines='1' /></t>
 		   </list>
              </t>
              <dl newline="true">
                <dt>name</dt>
                <dd>
                  <t>$.nameserverSearchResults[*].[unicodeName,ldhName]</t>

                </dd>
                <dt>ipv4</dt>
                <dd>
                  <t>$.nameserverSearchResults[*].ipAddresses.v4[0]</t>

                </dd>
                <dt>ipv6</dt>
                <dd>
                  <t>$.nameserverSearchResults[*].ipAddresses.v6[0]</t>

                </dd>
              </dl>
            </li>
            <li>
              <t>Entity
              <list style="hanging">
		   <t hangText="handle"><vspace blankLines='1' />$.entitySearchResults[*].handle<vspace blankLines='1' /></t>
		   <t hangText="fn"><vspace blankLines='1' />$.entitySearchResults[*].vcardArray[1][?(@[0]==&quot;fn&quot;)][3]<vspace blankLines='1' /></t>
		   <t hangText="org"><vspace blankLines='1' />$.entitySearchResults[*].vcardArray[1][?(@[0]==&quot;org&quot;)][3]<vspace blankLines='1' /></t>
		   <t hangText="voice"><vspace blankLines='1' />$.entitySearchResults[*].vcardArray[1][?(@[0]==&quot;tel&quot; &amp;&amp; @[1].type==&quot;voice&quot;)][3]<vspace blankLines='1' /></t>
		   <t hangText="email"><vspace blankLines='1' />$.entitySearchResults[*].vcardArray[1][?(@[0]==&quot;email&quot;)][3]<vspace blankLines='1' /></t>
		   <t hangText="country"><vspace blankLines='1' />$.entitySearchResults[*].vcardArray[1][?(@[0]==&quot;adr&quot;)][3][6]<vspace blankLines='1' /></t>
		   <t hangText="cc"><vspace blankLines='1' />$.entitySearchResults[*].vcardArray[1][?(@[0]==&quot;adr&quot;)][1].cc<vspace blankLines='1' /></t>
		   <t hangText="city"><vspace blankLines='1' />$.entitySearchResults[*].vcardArray[1][?(@[0]==&quot;adr&quot;)][3][3]<vspace blankLines='1' /></t>
 		   </list>
              </t>
</list></t>
              <dl newline="true">
                <dt>handle</dt>
                <dd>
                  <t>$.entitySearchResults[*].handle</t>

                </dd>
                <dt>fn</dt>
                <dd>
                  <t>$.entitySearchResults[*].vcardArray[1][?(@[0]=="fn")][3]</t>

                </dd>
                <dt>org</dt>
                <dd>
                  <t>$.entitySearchResults[*].vcardArray[1][?(@[0]=="org")][3]</t>

                </dd>
                <dt>voice</dt>
                <dd>
                  <t>$.entitySearchResults[*].vcardArray[1][?(@[0]=="tel" &amp;&amp; @[1].type=="voice")][3]</t>

                </dd>
                <dt>email</dt>
                <dd>
                  <t>$.entitySearchResults[*].vcardArray[1][?(@[0]=="email")][3]</t>

                </dd>
                <dt>country</dt>
                <dd>
                  <t>$.entitySearchResults[*].vcardArray[1][?(@[0]=="adr")][3][6]</t>

                </dd>
                <dt>cc</dt>
                <dd>
                  <t>$.entitySearchResults[*].vcardArray[1][?(@[0]=="adr")][1].cc</t>

                </dd>
                <dt>city</dt>
                <dd>
                  <t>$.entitySearchResults[*].vcardArray[1][?(@[0]=="adr")][3][3]</t>

                </dd>
              </dl>
            </li>
          </ul>
          <t>Additional notes on the provided jsonpaths:</t>
	<t><list style="symbols">
	<t>those
          <ul>
            <li>
              <t>Those related to the event dates are defined only for the &quot;domain&quot;
              "domain" object.  To obtain the equivalent jsonpaths for &quot;entity&quot;
              "entity" and &quot;nameserver&quot;, "nameserver", the path segment &quot;domainSearchResults&quot;
              "domainSearchResults" must be replaced with &quot;entitySearchResults&quot;
              "entitySearchResults" and &quot;nameserverSearchResults&quot; respectively;<vspace blankLines='1' /></t>
	<t>those "nameserverSearchResults",
              respectively.</t>

            </li>
            <li>Those related to jCard elements are specified without taking
            into account the &quot;pref&quot; "pref" parameter.  Servers that sort those values
            identified by the pref "pref" parameter SHOULD <bcp14>SHOULD</bcp14> update a
            jsonpath by adding an appropriate filter.  For example, if the
            email values identified by pref=&quot;1&quot; pref="1" are considered for sorting,
            the jsonpath of the &quot;email&quot; "email" sorting property should be: $.entitySearchResults[*].vcardArray[1][?(@[0]==&quot;email&quot; be
            $.entitySearchResults[*].vcardArray[1][?(@[0]=="email" &amp;&amp; @[1].pref==&quot;1&quot;)][3]</t>
	</list></t>
            @[1].pref=="1")][3].</li>

          </ul>
        </section>

        <section anchor="sorting_links" title="Representing anchor="sorting_links">
          <name>Representing Sorting Links"> Links</name>
          <t>An RDAP server MAY <bcp14>MAY</bcp14> use the &quot;links&quot; "links" array of the &quot;sorting_metadata&quot; "sorting_metadata" element to provide ready-made references <xref target="RFC8288"/> to the available sort criteria (<xref target="sort-link-in-response-example"/>).  Each link represents a reference to an alternate view of the results.</t>
          <t>The &quot;value&quot;, &quot;rel&quot; "value", "rel", and &quot;href&quot; "href" JSON values MUST <bcp14>MUST</bcp14> be specified.  All other JSON values are OPTIONAL.</t> <bcp14>OPTIONAL</bcp14>.</t>
          <figure anchor="sort-link-in-response-example" title="Example anchor="sort-link-in-response-example">
            <name>Example of a &quot;sorting_metadata&quot; instance "sorting_metadata" Instance to implement result sorting">
        <artwork xml:space="preserve"><![CDATA[ Implement Result Sorting</name>

          <sourcecode type="json">
{
  "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",
                   &amp;sort=name",
         "rel": "alternate",
         "href": "https://example.com/rdap/domains?name=example*.com
                  &sort=registrationDate",
                  &amp;sort=registrationDate",
         "title": "Result Ascending Sort Link",
         "type": "application/rdap+json"
         },
         {
         "value": "https://example.com/rdap/domains?name=example*.com
                   &sort=name",
                   &amp;sort=name",
         "rel": "alternate",
         "href": "https://example.com/rdap/domains?name=example*.com
                  &sort=registrationDate:d",
                  &amp;sort=registrationDate:d",
         "title": "Result Descending Sort Link",
         "type": "application/rdap+json"
         }
       ]
       },
       ...
     ]
  },
  "domainSearchResults": [
    ...
  ]
}
        ]]></artwork>
	  </sourcecode>
          </figure>
        </section>
      </section>
      <section anchor="cursor-parameter" title="&quot;cursor&quot; Parameter"> anchor="cursor-parameter">
        <name>"cursor" Parameter</name>

        <t>The cursor "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 "cursor" parameter to represent
        offset pagination information, the cursor "cursor" value &quot;b2Zmc2V0PTEwMCxsaW1pdD01MA==&quot;
        "b2Zmc2V0PTEwMCxsaW1pdD01MA==" is the Base64 base64 encoding of &quot;offset=100,limit=50&quot;.
        "offset=100,limit=50".  Likewise, in a simple implementation to
        represent keyset pagination information, the cursor "cursor" value &quot;ZXhhbXBsZS1OLmNvbQ==&quot;
        "ZXhhbXBsZS1OLmNvbQ==" represents the Base64 base64 encoding of &quot;key=example-N.com&quot;
        "key=example-N.com" whereby the key value identifies the last row of
        the current page.</t>

        <t>Note that this specification uses a Base64 base64 encoding for cursor
        obfuscation just for example.  RDAP servers are NOT RECOMMENDED <bcp14>NOT
        RECOMMENDED</bcp14> to obfuscate a cursor the "cursor" value through a mere Base64
        base64 encoding.</t>

        <t>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 <xref
        target="approaches-to-result-pagination"/>.</t>

        <t>The ABNF syntax of the cursor "cursor" parameter is the following:</t>
		<t><list style="empty">
		<t>cursor
<sourcecode type="abnf">
   cursor = &quot;cursor=&quot; "cursor=" 1*( ALPHA / DIGIT / &quot;/&quot; "/" / &quot;=&quot; "=" / &quot;-&quot; "-" / &quot;_&quot; )</t>
		</list></t> "_" )
</sourcecode>
        <t>The following is an example of an RDAP query including the &quot;cursor&quot; "cursor" parameter:</t>
        <t>https://example.com/rdap/domains?name=example*.com
&amp;cursor=wJlCDLIl6KTWypN7T6vc6nWEmEYe99Hjf1XY1xmqV-M=
        </t>
        <section anchor="cursor_paging_links" title="Representing anchor="cursor_paging_links">
          <name>Representing Paging Links"> Links</name>
          <t>An RDAP server SHOULD <bcp14>SHOULD</bcp14> use the &quot;links&quot; "links" array of the &quot;paging_metadata&quot; "paging_metadata" element to provide a ready-made reference <xref target="RFC8288"/> to the next page of the result set (<xref target="cursor-pagination-link-in-response-example"/>).  Examples of additional &quot;rel&quot; "rel" values a server MAY <bcp14>MAY</bcp14> implement are &quot;first&quot;, &quot;last&quot;, "first", "last", and &quot;prev&quot;.</t> "prev".</t>
          <figure anchor="cursor-pagination-link-in-response-example" title="Example anchor="cursor-pagination-link-in-response-example">
            <name>Example of a &quot;paging_metadata&quot; instance "paging_metadata" Instance to implement cursor pagination">
        <artwork xml:space="preserve"><![CDATA[ Implement Cursor Pagination</name>
<sourcecode type="json">
{
  "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=",
              &amp;cursor=wJlCDLIl6KTWypN7T6vc6nWEmEYe99Hjf1XY1xmqV-M=",
      "title": "Result Pagination Link",
      "type": "application/rdap+json"
      }
    ]
  },
  "domainSearchResults": [
    ...
  ]
}
        ]]></artwork>
</sourcecode>
          </figure>
        </section>
      </section>
    </section>
    <section anchor="negative-answers" title="Negative Answers"> anchor="negative-answers">
      <name>Negative Answers</name>

      <t>The constraints for the parameters values of parameters are defined by their ABNF
      syntax.  Therefore, each request that includes an invalid value for a
      parameter SHOULD <bcp14>SHOULD</bcp14> produce an HTTP 400 (Bad Request)
      response code.  The same response SHOULD <bcp14>SHOULD</bcp14> be returned in
      the following cases:

<list style="symbols">

</t>
      <ul>

        <li>
<t>if in both sorting by either single and multi sort or multiple properties, the client provides an
unsupported value for the &quot;sort&quot; "sort" parameter, as well as a value related to an
object property not included in the response;<vspace blankLines='1' /></t>
<t>if response
</t>

        </li>
        <li>if the client submits an invalid value for the &quot;cursor&quot; parameter.</t>
</list></t> "cursor" parameter</li>
      </ul>
      <t>Optionally, the response MAY <bcp14>MAY</bcp14> include additional information regarding either the supported sorting properties or the correct cursor values "cursor" value in the HTTP entity body (<xref target="sorting-property-error"/>).</t>

      <figure anchor="sorting-property-error" title="Example anchor="sorting-property-error">
        <name>Example of RDAP error response due Error Response Due to an invalid domain sorting property included Invalid Domain Sorting Property Included in the request">
        <artwork xml:space="preserve"> Request</name>
<sourcecode type="json">
{
    "errorCode": 400,
    "title": "Domain sorting property 'unknownproperty' 'unknown' is not valid",
    "description": [
        "Supported domain sorting properties are: 'aproperty', 'anotherproperty'." are:"
        "'aproperty', 'anotherproperty'"
    ]

}
        </artwork>
</sourcecode>
      </figure>
    </section>
    <section anchor="implementation-considerations" title="Implementation Considerations"> anchor="implementation-considerations">
      <name>Implementation Considerations</name>
      <t>Implementation of the new parameters is technically feasible, as
      operators for counting, sorting sorting, and paging are currently supported by
      the major relational database management systems.  Similar operators are
      completely or partially supported by the most well-known NoSQL databases (e.g.
      (e.g., MongoDB, CouchDB, HBase, Cassandra, Hadoop). Hadoop, etc.).  Additional
      implementation notes are included in <xref
      target="additional-implementation-notes"/>.</t>
    </section>
    <section anchor="IANA-considerations" title="IANA Considerations"> anchor="IANA-considerations">
      <name>IANA Considerations</name>

      <t>IANA is requested to register has registered the following values in the RDAP Extensions Registry:</t>

<t><list style="none">
      <t>Extension "RDAP Extensions"
      registry:</t>

<dl spacing="compact">

<dt>Extension identifier: paging</t>
      <t>Registry
</dt>
<dd>paging
</dd>

<dt>Registry operator: Any</t>
      <t>Published
</dt>
<dd>Any
</dd>

<dt>Published specification: This document.</t>
      <t>Contact: IETF &lt;iesg@ietf.org&gt;</t>
      <t>Intended
</dt>
<dd>RFC 8977
</dd>

<dt>Contact:
</dt>
<dd>IETF &lt;iesg@ietf.org&gt;
</dd>

<dt>Intended usage: This
</dt>
<dd>This extension describes a best practice for result set paging.</t>
</list></t>

<t><list style="none">
      <t>Extension paging.
</dd>

</dl>

<dl spacing="compact">

<dt>Extension identifier: sorting</t>
      <t>Registry
</dt>
<dd>sorting
</dd>

<dt>Registry operator: Any</t>
      <t>Published
</dt>
<dd>Any
</dd>

<dt>Published specification: This document.</t>
      <t>Contact: IETF &lt;iesg@ietf.org&gt;</t>
      <t>Intended
</dt>
<dd>RFC 8977
</dd>

<dt>Contact:
</dt>
<dd>IETF &lt;iesg@ietf.org&gt;
</dd>

<dt>Intended usage: This
</dt>
<dd>This extension describes a best practice for result set sorting.</t>
</list></t> sorting.
</dd>

</dl>

    </section>

    <section anchor="impl-status" title="Implementation Status">
      <t>NOTE: Please remove anchor="security-considerations">
      <name>Security Considerations</name>
      <t>Security services for the operations specified in this section document are described in <xref target="RFC7481"/>.</t>
      <t>A search query typically requires more server resources (such as memory, CPU cycles, and the reference to RFC 7942 prior network bandwidth) when compared to publication as an RFC.</t>

      <t>This section records a lookup query.  This increases the status risk of known implementations of the protocol defined by this specification at the time of posting of this Internet-Draft, and is based on a proposal described in <xref target="RFC7942"/>.  The description of implementations in this section is intended to assist the IETF in its decision processes in progressing drafts to RFCs.  Please note that the listing of any individual implementation here does not imply endorsement by the IETF.  Furthermore, no effort has been spent to verify the information presented here that was supplied by IETF contributors.  This is not intended as, and must not be construed to be, a catalog of available implementations or their features.  Readers are advised to note that other implementations may exist.</t>

      <t>According to RFC 7942, &quot;this will allow reviewers and working groups to assign due consideration to documents that have the benefit of running code, which may serve as evidence of valuable experimentation and feedback that have made the implemented protocols more mature.  It is up to the individual working groups to use this information as they see fit&quot;.</t>

      <section anchor="iit-cnr-registro-it" title="IIT-CNR/Registro.it">
        <t><list style="none">
	  <t>Responsible Organization: Institute of Informatics and Telematics of the National Research Council (IIT-CNR)/Registro.it</t>
	  <t>Location: https://rdap.pubtest.nic.it/</t>
	  <t>Description: This implementation includes support for RDAP queries using data from .it public test environment.</t>
	  <t>Level of Maturity: This is an "alpha" test implementation.</t>
	  <t>Coverage: This implementation includes all of the features described in this specification.</t>
	  <t>Contact Information: Mario Loffredo, mario.loffredo@iit.cnr.it</t>
	</list></t>
      </section>

      <section anchor="apnic" title="APNIC">
        <t><list style="none">
	  <t>Responsible Organization: Asia-Pacific Network Information Centre</t>
	  <t>Location: https://github.com/APNIC-net/rdap-rmp-demo/tree/sorting-and-paging</t>
	  <t>Description: A proof-of-concept for RDAP mirroring.</t>
	  <t>Level of Maturity: This is a proof-of-concept implementation.</t>
	  <t>Coverage: This implementation includes all of the features described in the specification except for nameserver sorting and unicodeName sorting.</t>
	  <t>Contact Information: Tom Harrison, tomh@apnic.net</t>
	</list></t>
      </section>

    </section>

   <section anchor="security-considerations" title="Security Considerations">
      <t>Security services for the operations specified in this document are described in <xref target="RFC7481"/>.</t>

      <t>A search query typically requires more server resources (such as memory, CPU cycles, and network bandwidth) when compared to a lookup query.  This increases the risk of server resource exhaustion and subsequent denial server resource exhaustion and subsequent denial of service.  This risk can be mitigated by either restricting search functionality or limiting the rate of search requests.  Servers can also reduce their load by truncating the results in a response.  However, this last security policy can result in a higher inefficiency or risk due to acting on incomplete information if the RDAP server does not provide any functionality to return the truncated results.</t>
      <t>The new parameters presented in this document provide RDAP operators with a way to implement a server that reduces inefficiency risks.  The &quot;count&quot; "count" parameter gives the client the ability to evaluate the completeness of a response.  The &quot;sort&quot; "sort" parameter allows the client to obtain the most relevant information at the beginning of the result set.  This can reduce the number of unnecessary search requests.  Finally, the &quot;cursor&quot; "cursor" parameter enables the user to scroll the result set by submitting a sequence of sustainable queries within server-acceptable limits.</t>
    </section>
  </middle>
  <back>
    <references title="Normative References">
      &RFC2119;
      &RFC5234;
      &RFC5890;
      &RFC6350;
      &RFC7095;
      &RFC7230;
      &RFC7231;
      &RFC7480;
      &RFC7481;
      &RFC7482;
      &RFC7483;
      &RFC7942;
      &RFC8174;
      &RFC8259;
      &RFC8288;
      &RFC8605;

    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5234.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5890.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6350.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7095.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7230.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7231.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7480.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7481.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7482.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7483.xml"/>

        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8259.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8288.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8605.xml"/>
      </references>

    <references title="Informative References">
      <references>
        <name>Informative References</name>

        <reference anchor='CURSOR' target='https://www.sitepoint.com/paginating-real-time-data-cursor-based-pagination/'> anchor="CURSOR" target="https://www.sitepoint.com/paginating-real-time-data-cursor-based-pagination/">
          <front>
            <title>Paginating Real-Time Data with Keyset Cursor Based Pagination</title>
            <author initials='R.' surname='Nimesh' fullname='Rakhitha Nimesh'> initials="R." surname="Nimesh" fullname="Rakhitha Nimesh">
		</author>
            <date year='2014' month='July' /> year="2014" month="July"/>
          </front>
        </reference>

        <reference anchor='CURSOR-API1' target='https://developers.facebook.com/docs/graph-api/using-graph-api'> anchor="CURSOR-API1" target="https://developers.facebook.com/docs/graph-api/using-graph-api">
          <front>
		<title>facebook
            <title>Facebook for developers - Developers -- Using the Graph API</title>
            <author>
		<organization>facebook.com</organization>
              <organization>Facebook</organization>
            </author>
            <date year='2017' month='July' />
          </front>
        </reference>

        <reference anchor='CURSOR-API2' target='https://developer.twitter.com/en/docs/ads/general/guides/pagination.html'> anchor="CURSOR-API2" target="https://developer.twitter.com/en/docs/twitter-ads-api">
          <front>
		<title>Pagination</title>
            <title>Twitter Ads API</title>
            <author>
		<organization>twitter.com</organization>
              <organization>Twitter</organization>
            </author>
            <date year='2017'/> />
          </front>
        </reference>

        <reference anchor='GOESSNER-JSON-PATH' target='http://goessner.net/articles/JsonPath/'> anchor="GOESSNER-JSON-PATH" target="https://goessner.net/articles/JsonPath/">
          <front>
            <title>JSONPath - XPath for JSON</title>
            <author initials='S.' surname='Goessner' fullname='Stefan Goessner'> initials="S." surname="Goessner" fullname="Stefan Goessner">
                </author>
            <date year='2007'/> year="2007" month="February"/>
          </front>
        </reference>

        <reference anchor='HATEOAS' target='https://www.e4developer.com/2018/02/16/hateoas-simple-explanation/'> anchor="HATEOAS" target="https://www.e4developer.com/2018/02/16/hateoas-simple-explanation/">
          <front>
            <title>HATEOAS - a simple explanation</title>
            <author initials='B.' surname='Jedrzejewski' fullname='Bartosz Jedrzejewski'> initials="B." surname="Jedrzejewski" fullname="Bartosz Jedrzejewski">
		</author>
            <date year='2018'/> year="2018" month="February"/>
          </front>
        </reference>

        <reference anchor='JSONPATH-COMPARISON' target='https://cburgmer.github.io/json-path-comparison/'> anchor="JSONPATH-COMPARISON" target="https://cburgmer.github.io/json-path-comparison/">
          <front>
            <title>JSONPath Comparison</title>
            <author/>
            <date year='2020'/> />
          </front>
        </reference>

        <reference anchor='JSONPATH-WG' target='https://datatracker.ietf.org/wg/jsonpath/documents/'> anchor="JSONPATH-WG" target="https://datatracker.ietf.org/wg/jsonpath/about/">
          <front>
            <title>JSON Path (jsonpath)</title>
		<author/>
                <date year='2020'/>
            <author><organization>IETF</organization></author>
            <date/>
          </front>
        </reference>

        <reference anchor='OData-Part1'  target='http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part1-protocol/odata-v4.0-errata03-os-part1-protocol-complete.pdf'> anchor="ODATA-PART1" target="https://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part1-protocol/odata-v4.0-errata03-os-part1-protocol-complete.pdf">
          <front>
            <title>OData Version 4.0. Part 1: Protocol Plus Errata 03</title>
            <author initials='M.' surname='Pizzo' fullname='Michael Pizzo'> initials="M." surname="Pizzo" fullname="Michael Pizzo">
		</author>
            <author initials='R.' surname='Handl' fullname='Ralf Handl'> initials="R." surname="Handl" fullname="Ralf Handl">
		</author>
            <author initials='M.' surname='Zurmuehl' fullname='Martin Zurmuehl'> initials="M." surname="Zurmuehl" fullname="Martin Zurmuehl">
		</author>
            <date year='2016' month='June' /> year="2016" month="June"/>
          </front>
        </reference>

        <reference anchor='REST' target='http://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf'> anchor="REST" target="https://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf">
          <front>
            <title>Architectural Styles and the Design of Network-based Software Architectures</title>
            <author initials='R.' surname='Fielding' fullname='Roy initials="R." surname="Fielding" fullname="Roy Thomas Fielding'> Fielding">
              <organization>PH.D. DISSERTATION, UNIVERSITY OF CALIFORNIA, IRVINE</organization>
            </author>
            <date year='2000'/> year="2000"/>
          </front>
        </reference>
      &RFC6901;

        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6901.xml"/>

        <reference anchor='SEEK' target='https://www.eversql.com/faster-pagination-in-mysql-why-order-by-with-limit-and-offset-is-slow/'> anchor="SEEK" target="https://www.eversql.com/faster-pagination-in-mysql-why-order-by-with-limit-and-offset-is-slow/">
          <front>
            <title>Faster Pagination in Mysql - Why Order By With Limit and Offset is Slow?</title>
            <author>
		<organization>EverSQL.com</organization>
              <organization>EverSQL</organization>
            </author>
            <date year='2017' month='July' /> year="2017" month="July"/>
          </front>
        </reference>

        <reference anchor="W3C.CR-xpath-31-20170321" target="https://www.w3.org/TR/2017/REC-xpath-31-20170321/">
          <front>
            <title>XML Path Language (XPath) 3.1</title>
            <author initials="J." surname="Robie" fullname="Jonathan Robie">
              <organization/>
            </author>
            <author initials="M." surname="Dyck" fullname="Michael Dyck">
              <organization/>
            </author>
            <author initials="J." surname="Spiegel" fullname="Josh Spiegel">
              <organization/>
            </author>
            <date month="March" year="2017"/>
          </front>
          <refcontent>World Wide Web Consortium Recommendation REC-xpath-31-20170321</refcontent>
        </reference>
        &W3C.CR-xpath-31-20161213;
      </references>

    </references>

    <section anchor="jsonpath-operators" title="JSONPath operators"> anchor="jsonpath-operators">
      <name>JSONPath Operators</name>
      <t>The jsonpaths used in this document are provided according to the Goessner v.0.8.0 proposal <xref target="GOESSNER-JSON-PATH"/>.</t>
      <t>Such specification requires that implementations support a set of &quot;basic operators&quot;.
      "basic operators".  These operators are used to access the elements of a
      JSON structure like objects and arrays, and as well as their subelements, respectively, object subelements
      (object members and array items. items, respectively).  No operations are
      defined for retrieving parent or sibling elements of a given element.
      The root element is always referred to as $ regardless of it being an
      object or array.</t>
      <t>Additionally, the specification permits implementations to support
      arbitrary script expressions.  These can be used to index into an object
      or array, or to filter elements from an array.  While script expression
      behavior is implementation-defined, most implementations support the
      basic relational and logical operators, operators as well as both object member and
      array item access, sufficiently similar for the purpose of this
      document.  Commonly-supported  Commonly supported operators/functions divided into &quot;top-level operators&quot;
      "top-level operators" and &quot;filter operators&quot; "filter operators" are documented in Tables <xref target="table_json_path_top_level_operators"/>
      target="table_json_path_top_level_operators" format="counter"/> and <xref target="table_json_path_filter_operators"/>
      target="table_json_path_filter_operators" format="counter"/>, respectively.</t>
      <t>For more information on implementation interoperability issues, see [JSONPATH-COMPARISON].  As at
      <xref target="JSONPATH-COMPARISON" format="default"/>.  At the time
      of writing, work is beginning on a standardization effort, too: see [JSONPATH-WG].</t>

	<texttable anchor="table_json_path_top_level_operators" title="JSONPath Top-Level Operators">
	<ttcol align="left">Operator</ttcol>
	<ttcol align="left">Description</ttcol>
	<c>$</c><c>Root element</c>
	<c>.&lt;name&gt;</c><c>Object member effort too (see
      <xref target="JSONPATH-WG" format="default"/>).</t>
      <table anchor="table_json_path_top_level_operators">
        <name>JSONPath Top-Level Operators</name>
        <thead>
          <tr>
            <th align="left">Operator</th>
            <th align="left">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">$</td>
            <td align="left">Root element</td>
          </tr>
          <tr>
            <td align="left">.&lt;name&gt;</td>
            <td align="left">Object member access (dot-notation)</c>
	<c>['&lt;name&gt;']</c><c>Object (dot-notation)</td>
          </tr>
          <tr>
            <td align="left">['&lt;name&gt;']</td>
            <td align="left">Object member access (bracket-notation)</c>
	<c>[&lt;number&gt;]</c><c>Array (bracket-notation)</td>
          </tr>
          <tr>
            <td align="left">[&lt;number&gt;]</td>
            <td align="left">Array item access</c>
	<c>*</c><c>All access</td>
          </tr>
          <tr>
            <td align="left">*</td>
            <td align="left">All elements within the specified scope</c>
	<c>[?(&lt;expression&gt;)]</c><c>Filter expression</c>
	</texttable>

	<texttable anchor="table_json_path_filter_operators" title="JSONPath scope</td>
          </tr>
          <tr>
            <td align="left">[?(&lt;expression&gt;)]</td>
            <td align="left">Filter expression</td>
          </tr>
        </tbody>
      </table>
      <table anchor="table_json_path_filter_operators">
        <name>JSONPath Filter Operators">
	<ttcol align="left">Operator</ttcol>
	<ttcol align="left">Description</ttcol>
	<c>@</c><c>Current Operators</name>
        <thead>
          <tr>
            <th align="left">Operator</th>
            <th align="left">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">@</td>
            <td align="left">Current element being processed</c>
	<c>.&lt;name&gt;</c><c>Object processed</td>
          </tr>
          <tr>
            <td align="left">.&lt;name&gt;</td>
            <td align="left">Object member access</c>
    <c>.[&lt;name1&gt;,&lt;name2&gt;]</c><c>Union access</td>
          </tr>
          <tr>
            <td align="left">.[&lt;name1&gt;,&lt;name2&gt;]</td>
            <td align="left">Union of object members</c>
	<c>[&lt;number&gt;]</c><c>Array members</td>
          </tr>
          <tr>
            <td align="left">[&lt;number&gt;]</td>
            <td align="left">Array item access</c>
	<c>==</c><c>Left access</td>
          </tr>
          <tr>
            <td align="left">==</td>
            <td align="left">Left is equal to right</c>
	<c>!=</c><c>Left right</td>
          </tr>
          <tr>
            <td align="left">!=</td>
            <td align="left">Left is not equal to right</c>
	<c>&lt;</c><c>Left right</td>
          </tr>
          <tr>
            <td align="left">&lt;</td>
            <td align="left">Left is less than right</c>
	<c>&lt;=</c><c>Left right</td>
          </tr>
          <tr>
            <td align="left">&lt;=</td>
            <td align="left">Left is less than or equal to right</c>
	<c>&gt;</c><c>Left right</td>
          </tr>
          <tr>
            <td align="left">&gt;</td>
            <td align="left">Left is greater than right</c>
	<c>&gt;=</c><c>Left right</td>
          </tr>
          <tr>
            <td align="left">&gt;=</td>
            <td align="left">Left is greater than or equal to right</c>
	<c>&amp;&amp;</c><c>Logical conjunction</c>
	<c>||</c><c>Logical disjunction</c>
	</texttable> right</td>
          </tr>
          <tr>
            <td align="left">&amp;&amp;</td>
            <td align="left">Logical conjunction</td>
          </tr>
          <tr>
            <td align="left">||</td>
            <td align="left">Logical disjunction</td>
          </tr>
        </tbody>
      </table>
    </section>
    <section anchor="approaches-to-result-pagination" title="Approaches anchor="approaches-to-result-pagination">

      <name>Approaches to Result Pagination"> Pagination</name>
      <t>An RDAP query could return a response with hundreds, even thousands, of objects, especially when partial matching is used.  For this reason, the cursor "cursor" parameter addressing result pagination is defined to make responses easier to handle.</t>
      <t>Presently, the most popular methods to implement pagination in a REST API include offset pagination and keyset pagination.  Neither pagination method requires the server to handle the result set in a storage area across multiple requests since a new result set is generated each time a request is submitted.  Therefore, they are preferred to any other method requiring the management of a REST session.</t>
      <t>Using limit and offset operators represents the traditionally used method to implement result pagination.  Both of them can be used individually:
 <list style="symbols">
	  <t>&quot;limit=N&quot;: means
      </t>
<dl>

<dt>"limit=N":
</dt>
<dd>means that the server returns the first N objects of the result set;<vspace blankLines='1' /></t>
	  <t>&quot;offset=N&quot;: means set
</dd>

<dt>"offset=N":
</dt>
<dd>means that the server skips the first N objects and returns objects starting from position N+1.</t>
	</list></t> N+1
</dd>

</dl>

      <t>When limit and offset are used together, they provide the ability to identify a specific portion of the result set.  For example, the pair &quot;offset=100,limit=50&quot; "offset=100,limit=50" returns the first 50 objects starting from position 101 of the result set.</t>
      <t>Though easy to implement, offset pagination also includes drawbacks:
         <list style="symbols">
	    <t>when
      </t>
      <ul>
        <li>
          <t>When offset has a very high value, scrolling the result set could take some time;<vspace blankLines='1' /></t>
	    <t>it time.</t>

        </li>
        <li>
          <t>It always requires fetching all rows before dropping as many rows as specified by offset;<vspace blankLines='1' /></t>
          <t>it offset.</t>

        </li>
        <li>It may return inconsistent pages when data are frequently updated (i.e. (i.e., real-time data).</t>
	  </list></t> data).</li>
      </ul>
      <t>Keyset pagination <xref target="SEEK"/> adds a query condition that enables the selection of the only data not yet returned.  This method has been taken as the basis for the implementation of a &quot;cursor&quot; "cursor" parameter <xref target="CURSOR"/> by some REST API providers <xref target="CURSOR-API1"/> <xref target="CURSOR-API2"/>.  The cursor is an a URL-safe string opaque to the client URL-safe string and representing a logical pointer to the first result of the next page.</t>

      <t>Nevertheless, even keyset pagination can be troublesome:
         <list style="symbols">
	    <t>it
      </t>
      <ul>
        <li>
          <t>It needs at least one key field;<vspace blankLines='1' /></t>
         <t>it field.</t>

        </li>
        <li>
          <t>It does not allow sorting simply by any field because the sorting
          criterion must contain a key;<vspace blankLines='1' /></t>
	    <t>it key.</t>

        </li>
        <li>

          <t>It works best with full composite values support supported by data base database
          management systems (i.e. [x,y]>[a,b]), (i.e., [x,y]&gt;[a,b]); emulation is possible but
          inelegant and less efficient;<vspace blankLines='1' /></t>
	    <t>it efficient.</t>

        </li>
        <li>
          <t>It does not allow direct navigation to arbitrary pages because
          the result set must be scrolled in sequential order starting from
          the initial page;<vspace blankLines='1' /></t>
	    <t>implementing bi-directional page.</t>

        </li>
        <li>Implementing bidirectional navigation is tedious because all
        comparison and sort operations have to be reversed.</t>
	  </list></t> reversed.</li>
      </ul>
      <section anchor="pagination-in-rdap" title="Specific anchor="pagination-in-rdap">
        <name>Specific Issues Raised by RDAP"> RDAP</name>
        <t>Some additional considerations can be made in the RDAP context:
         <list style="symbols">
	    <t>an
        </t>
        <ul>
          <li>
            <t>An RDAP object is a conceptual aggregation of information
            generally collected from more than one data structure (e.g. table) (e.g.,
            table), and this makes it even harder to implement keyset
            pagination, a task that is already quite difficult.  For example,
            the entity object can include information from different data
            structures (registrars, registrants, contacts, resellers), each
            one with its key field mapping the RDAP entity handle;<vspace blankLines='1' /></t>
	    <t>depending handle.</t>

          </li>
          <li>
            <t>Depending on the number of page results as well as the number
            and the complexity of the properties of each RDAP object in the
            response, the time required by offset pagination to skip the
            previous pages could be much faster than the processing time
            needed to build the current page.  In fact, RDAP objects are
            usually formed by information belonging to multiple data
            structures and containing multivalued properties (i.e. arrays) and, (i.e., arrays);
            therefore, data selection might therefore be a time consuming time-consuming
            process.  This situation occurs even though the selection is
            supported by indexes;<vspace blankLines='1' /></t>
	    <t>depending indexes.</t>

          </li>
          <li>Depending on the access levels defined by each RDAP operator,
          the increase in complexity and the decrease in flexibility of keyset
          pagination in comparison to offset pagination could be considered impractical.</t>
	  </list></t>
          impractical.</li>
        </ul>
        <t>Ultimately, both pagination methods have benefits and
        drawbacks.</t>
      </section>
    </section>
    <section anchor="additional-implementation-notes" title="Additional Implementation Notes"> anchor="additional-implementation-notes">

      <name>Implementation Notes</name>

      <t>This section contains an overview of the main choices made during the
      implementation of the capabilities defined above in this document in the RDAP public test
      server of Registro.it at the Institute of Informatics and Telematics of
      the National Research Counci Council (IIT-CNR).  The content of this section
      can represent a guidance for those implementers who plan to provide RDAP
      users with those capabilities.  The RDAP public test server can be
      accessed at https://rdap.pubtest.nic.it/. <eref target="https://rdap.pubtest.nic.it/"
      brackets="angle"/>.  Further documentation about the server features is
      available at https://rdap.pubtest.nic.it/doc/README.html.</t>

          <section title="Sorting"> <eref target="https://rdap.pubtest.nic.it/doc/README.html"
      brackets="angle"/>.</t>

      <section>
        <name>Sorting</name>
        <t>If no sort criterion is specified in the query string, the results are sorted by a default property: &quot;name&quot; "name" for domains and nameservers, &quot;handle&quot; and "handle" for entities.  The server supports multiple property sorting but the &quot;sorting_metadata&quot; "sorting_metadata" object includes only the links to alternative result set views sorted by a single property just to show the list of sorting properties allowed for each searchable object.  The server supports all the object specific object-specific sorting properties described in the specification except for nameserver sorting based on unicodeName, that is, the &quot;name&quot; "name" sorting property is mapped onto the &quot;ldhName&quot; "ldhName" response field.  Regarding the object common object-common properties, the sorting by registrationDate, expirationDate, lastChangedDate lastChangedDate, and transferDate is supported.</t>
      </section>

          <section title="Counting">
      <section>
        <name>Counting</name>

        <t>The counting operation is implemented through a separate query.  Some relational database management systems support custom operators to get the total count together with the rows, but the resulting query can be considerably more expensive than that performed without the total count.  Therefore, as &quot;totalCount&quot; "totalCount" is an optional response information, fetching always fetching the total number of rows has been considered an inefficient solution.  Furthermore, to avoid the processing of unnecessary queries, when the &quot;count&quot; "count" parameter is included in the submitted query, it is not also repeated in the query strings of the &quot;links&quot; "links" array provided in both &quot;paging_metadata&quot; "paging_metadata" and &quot;sorting_metadata&quot; "sorting_metadata" objects.</t>
      </section>

      <section title="Paging">
      <section>
        <name>Paging</name>

        <t>The server implements the cursor pagination through the keyset
        pagination when sorting by a unique property is requested or the
        default sort is applied, applied. Otherwise, it implements the cursor
        pagination through the offset pagination otherwise. pagination.  As most of the relational database
        management systems don't support the comparison of full composite
        values natively, the implementation of full keyset pagination seem to
        be troublesome so, at least initially, a selective applicability of
        keyset pagination is advisable.  Moreover, the &quot;cursor&quot; "cursor" value encodes
        not only information about pagination but also about the search
        pattern and the other query parameters in order to check the
        consistency of the entire query string.  If the &quot;cursor&quot; "cursor" value is
        inconsistent with the rest of the query string, the server returns an
        error response.</t>
      </section>
    </section>
    <section title="Acknowledgements" numbered="no"> numbered="false">
      <name>Acknowledgements</name>
      <t>The authors would like to acknowledge Brian Mountford, Tom Harrison, Karl <contact fullname="Brian Mountford"/>, <contact fullname="Tom Harrison"/>, <contact fullname="Karl Heinz Wolf, Jasdip Singh, Erik Kline, Éric Vyncke, Benjamin Kaduk and Roman Danyliw Wolf"/>, <contact fullname="Jasdip Singh"/>, <contact fullname="Erik Kline"/>, <contact fullname="Éric Vyncke"/>, <contact fullname="Benjamin Kaduk"/>, and <contact fullname="Roman Danyliw"/> for their contribution contributions to the development of this document.</t>
    </section>

    <section title="Change Log" numbered="no">
      <t>
        <list style="hanging">
          <t hangText="00:">Initial working group version ported from draft-loffredo-regext-rdap-sorting-and-paging-05</t>
	    <t hangText="01:">Removed both &quot;offset&quot; and &quot;nextOffset&quot; to keep &quot;paging_metadata&quot;  consistent between the pagination methods.  Renamed &quot;Considerations about Paging Implementation&quot; section in &quot;&quot;cursor&quot; Parameter&quot;.  Removed &quot;FOR DISCUSSION&quot; items.  Provided a more detailed description of both &quot;sorting_metadata&quot; and &quot;paging_metadata&quot; objects.</t>
	    <t hangText="02:">Removed both &quot;offset&quot; and &quot;limit&quot; parameters.  Added ABNF syntax of the cursor parameter.  Rearranged the layout of some sections.  Removed some items from &quot;Informative References&quot; section.  Changed &quot;IANA Considerations&quot; section.</t>
	    <t hangText="03:">Added &quot;cc&quot; to the list of sorting properties in &quot;Sorting Properties Declaration&quot; section.  Added RFC8605 to the list of &quot;Informative References&quot;.</t>
	    <t hangText="04:">Replaced &quot;ldhName&quot; with &quot;name&quot; in the &quot;Sorting Properties Declaration&quot; section.  Clarified the sorting logic for the JSON value types and the sorting policy for multivalued fields.</t>
	    <t hangText="05:">Clarified the logic of sorting on IP addresses.  Clarified the mapping between the sorting properties and the RDAP response fields.  Updated &quot;Acknowledgements&quot; section.</t>
	    <t hangText="06:">Renamed &quot;pageCount&quot; to &quot;pageSize&quot; and added &quot;pageNumber&quot; in the &quot;paging_metadata&quot; object.</t>
	    <t hangText="07:">Added &quot;Paging Responses to POST Requests&quot; section.</t>
	    <t hangText="08:">Added &quot;Approaches to Result Pagination&quot; section to appendix.  Added the case of requesting a sort on a property not included in the response to the errors listed in the &quot;Negative Answers&quot; section.</t>
	    <t hangText="09:">Updated the &quot;Implementation Status&quot; section to include APNIC implementation.  Moved the &quot;RDAP Conformance&quot; section up in the document.  Removed the &quot;Paging Responses to POST Requests&quot; section.  Updated the &quot;Acknowledgements&quot; section.  Removed unused references.  In the &quot;Sorting Properties Declaration&quot; section:
        <list style="symbols">
	  <t>clarified the logic of sorting on events;</t>
	  <t>corrected the jsonpath of the &quot;lastChanged&quot; sorting property;</t>
	  <t>provided a JSONPath example taking into account the vCard &quot;pref&quot; parameter.</t>
	</list>
         </t>
	    <t hangText="10:">Corrected the jsonpaths of both &quot;fn&quot; and &quot;org&quot; sorting properties in Table 2.  Corrected JSON content in <xref target="sort-link-in-response-example"/>.  Moved <xref target="W3C.CR-xpath-31-20161213"/> and <xref target="RFC7942"/> to the &quot;Normative References&quot;.  Changed the rdapConformance tags &quot;sorting_level_0&quot; and &quot;paging_level_0&quot; to &quot;sorting&quot; and &quot;paging&quot; respectively.</t>
		<t hangText="11:">Added the &quot;JSONPath operators&quot; section to appendix.</t>
		<t hangText="12:">Changed the content of &quot;JSONPath operators&quot; section.</t>
		<t hangText="13:">Minor pre-AD review edits.</t>
		<t hangText="14:">Additionl minor pre-AD review edits.</t>
        <t hangText="15:">In section &quot;&quot;sort&quot; Parameter&quot; added a paragraph providing conversions of IP addresses into their numerical representations.  In section &quot;Sorting Properties Declaration&quot; rearranged Table 2 in a list to make the content more readable.  Other minor edits due to AD review.</t>
	  <t hangText="16:">In section &quot;Introduction&quot; replaced &quot;... large result set that could be truncated ...&quot; with &quot;... large result set that is often truncated ...&quot; as suggested by Gen-ART reviewer.  Added <xref target="additional-implementation-notes"/>.</t>
       <t hangText="17:">Edits made:
          <list style="symbols">
       <t>in the &quot;Sorting and Paging Metadata&quot; section:
        <list style="symbols">
          <t>replaced &quot;Members are:&quot; with &quot;The AvailableSort object includes the following members:&quot;;</t>
          <t>clarified that an RDAP server MUST define only one default sorting property for each object class;</t>
        </list>
        </t>
       <t>in the &quot;Negative Answers&quot; section:
           <list style="symbols">
           <t>replaced the phrase &quot;the response MAY include additional information regarding the negative answer&quot; with the phrase &quot;the response MAY include additional information regarding either the supported sorting properties or the correct cursor value&quot;;</t>
           <t>added a new example;</t>
           </list>
       </t>
       <t>clarified the required members of a Link object in the &quot;Representing Sorting Links&quot; section;</t>
        <t>corrected the [REST] reference in the &quot;Informative References&quot; section;</t>
        <t>replaced the phrase &quot;and subsequent denial of service due to abuse&quot; with the phrase &quot;and subsequent denial of service&quot; in &quot;Security Considerations&quot; section.</t>
	  </list>
       </t>

            <t hangText="18:">Edits made:
                <list style="symbols">
                    <t>in the &quot;Introduction&quot; section:
                        <list style="symbols">
                            <t>revised the reasons for using query parameters instead of HTTP headers;</t>
                        </list>
                    </t>
                    <t>in the &quot;Sorting and Paging Metadata&quot; section:
                        <list style="symbols">
                            <t>replaced the phrase &quot;number of objects returned in the current page&quot; with the phrase &quot;number of objects that should have been returned in the current page&quot; in the definition of the &quot;pageSize&quot; field;</t>
                        </list>
                    </t>
                    <t>in the &quot;&quot;sort&quot; Parameter&quot; section:
                        <list style="symbols">
                            <t>clarified the sorting logic for values denoting dates and times;</t>
                            <t>replaced the IPv6 address &quot;2001:0db8:85a3:0000:0000:8a2e:0370:7334&quot; with &quot;2001:0db8:85a3:0:0:8a2e:0370:7334&quot;;</t>
                        </list>
                    </t>
                    <t>in the &quot;Sorting Properties Declaration&quot; section:
                        <list style="symbols">
                            <t>replaced the sorting properties &quot;ipV4&quot; and &quot;ipV6&quot; with &quot;ipv4&quot; and &quot;ipv6&quot;;</t>
                            <t>replaced the sentence &quot;Therefore, the assumption of having a single IPv4 and/or IPv6 value for a nameserver cannot be considered too stringent.&quot; with the sentence &quot;Therefore, this specification makes the assumption that nameservers have a single IPv4 and/or IPv6 value.&quot;</t>
                            <t>clarified that the sorting properties MUST NOT be used with a with a meaning other than the one described this document;</t>
                            <t>specified that JSONPath operators used in this section are those defined in &quot;Appendix A&quot;;</t>
                        </list>
                    </t>
                    <t>in the &quot;&quot;cursor&quot; Parameter&quot; section:
                        <list style="symbols">
                            <t>corrected the Base64 encoding of &quot;offset=100,limit=50&quot;;</t>
                            <t>clarified that RDAP servers are NOT RECOMMENDED to obfuscate a cursor value through a mere Base64 encoding;</t>
                        </list>
                    </t>
                    <t>changed last sentence of second paragraph of the &quot;Security Considerations&quot; section;</t>
                    <t>updated the &quot;Acknowledgements&quot; section;</t>
                    <t>in &quot;Appendix A&quot;:
                        <list style="symbols">
                            <t>changed introductory paragraph;</t>
                            <t>replaced &quot;opaque URL-safe string&quot; with &quot;opaque to client URL-safe string&quot;;</t>
                        </list>
                    </t>
                    <t>added JSONPath union operator in Table 2 of &quot;Appendix B&quot;</t>
                    <t>changed the explanation of offset and limit operators in &quot;Appendix B&quot;;</t>
                    <t>converted the figures containing only RDAP queries into texts;</t>
                    <t>changed the wildcard prefixed patterns into wildcard suffixed in all the RDAP queries;</t>
                    <t>cleaned the text.</t>
                </list>
            </t>
            <t hangText="19:">Replaced the words &quot;encryption/encrypt&quot; with &quot;obfuscation/obfuscate&quot; in the &quot;&quot;cursor&quot; Parameter&quot; section.</t>
            <t hangText="20:">Added a final paragraph to <xref target="jsonpath-operators"/> to reference the comparison between JSONPath operators and IETF JSONPath WG web site.</t>
	</list>
      </t>
    </section>

  </back>
</rfc>