A Links and Relations

Business object relationships are represented in the response as URLs that define the relationship between the current business object and the business object that the link points to.

Describe links Object Structure

links is a JSON object where the value is always a URL link and the link name is defined according to the rel of the link. The links object is generated for each resource collection, item, and for the resource itself.

Note that URL links in the resource describe will be generated using a template placeholder value ({id}) when there is not enough information to determine all parts of the URL. For example, the following child link provides a URL with the placeholder for the value of the specific Department resource:

"item" : {
     "links" : [ {
        "rel" : "child",
        "href" : "<base_url>/Department/{id}/child/Employee",
        "name" : "Employee",
        "kind" : "collection",
        "cardinality" : {
          "value" : "1 to *",
          "sourceAttributes" : "DepartmentId",
          "destinationAttributes" : "DepartmentId"
        }

rel Attribute Values

The rel attribute defines the type of link relationship between the current resource and the resource which the link points to. Relationships may be specified by any of the values shown in the table below.

Table A-1 Link Relationship in the REST Resource Describe

Link Relationship Description

self

Always generated for a resource. The href points to the resource itself or to the resource describe. In the links object, the link name is self for this rel.

parent

Always generated for a nested resource. The href points to the self link of the parent resource. In the links object, the link name is parent for this rel.

child

Generated when the resource has nested children. The href points to the nested collection. In the links object, the link name is the accessor name for this rel.

current

Generated in the resource version describe when multiple resource version identifiers exist. The href points to the most recent version identifier, as defined by the web application’s version definition.

predecessor-version

Generated in the resource version describe when multiple resource version identifiers exist. The href points to the previous version identifier, as defined by the web application’s version definition.

successor-version

Generated in the resource version describe when multiple resource version identifiers exist. The href points to the next most recent version identifier, as defined by the web application’s version definition.

describe

Generated in the resource version describe. The href points to the resource catalog describe for all resources of the same version.

href Attribute Value

The href attribute defines the URL to the linked resource or resource describe.

cardinality Attribute Values

The cardinality attribute is an optional attribute that defines the cardinality between the source resource and the destination resource. This attribute will be available only when the rel attribute value is child and the resource type is vnd.oracle.adf.description+json. This cardinality attribute has the following attributes.

  • value: The value of the cardinality. Example: "1 to *"

  • sourceAttributes: The attribute in the source resource used to link to the destination resource.

  • destinationAttributes: The attribute in the destination resource used to link to the source resource.