Introduction

A data domain version (domain version) can cross-reference (ref) another in its definition creating a relationship between two or more domain versions.

Federated Cross-references

Federated Data Records are identified by a UUID and a list of adaptors that where that Data Record is stored. This allows "assembling" data records by querying the adaptors that have the data record and compiling the results. If a Federated domain has a cross-reference, when it is assembled, the cross-reference will be assembled as well. See Accessing Data Records for more information regarding assembling data records.

Cross-references are established by specifying the relationship in Lucene syntax. This relationship is specified in the query property. Additionally, the relationship may be one-to-one or one-to-many using the multivalued property.

Note that ONLY DR Key properties of the parent and child records may be used in the query that establishes the relationship. Therefore, any properties that may be required for this relationship should be included in the DR Key properties.

A Quick Example

In the following example, a student domain version makes a cross-reference to the country:v1 domain-version, and a one-to-one relationship is established by linking the property homeCountry in student:v1 to id in country:v1.

NOTES

  1. query is in Lucene syntax.

  2. Properties of the parent record are referenced by enclosing in ${…​} syntax.

  3. Properties of both the parent and child records referenced in query MUST be included in DR Key Properties.

{
  "modelSchema": {
    "properties": {
      "studentID": {
        "type": "string",
        "required": true
      },
      "name": {
        "type": "string"
      },
      "homeCountryId": {
        "type": "string"
      },
      "homeCountry": {
        "$ref": "/domains/country:v1",
        "query": "id:${homeCountryId}"
      },
      "birthday": {
        "type": "string"
      }
    }
  },
  "drKeyProperties": [
    "studentID",
    "homeCountryId"
  ]
}