Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A data domain (domain) refers to a data model, such as student or course, and is defined by the parties responsible for data governance. The data domain defines the model schema and other attributes for that focus. Common examples of data domains are customers, students, employees, parts, and product orders.

...

Federated domains do not store their data in YOUnite but retrieve and update the data on the systems in which it resides. For example, MIS, ERP, or CRM systems. Federated domains require adaptors, metadata, and governance configurations and are covered in detail *TODO: TUTORIAL ON FEDERATED*

Domain Model Schemas

A domain Model Schema refers to the attributes (properties), format, and other metadata that defines how a specific domain should expect to store the data (either in the YOUnite Data Store or Federated), for the purposes of standardizing how data is exchanged between systems. The Data Governance Steward is responsible for configuring and maintaining domain model schemas. A  domain model schema is a JSON object describing/defining the properties for the domain's schema. The root node of the model schema is the properties element. See Valid Property Names and Valid Types for ModelSchema Properties below.

...

The root node of the model schema is the properties element. See Valid Property Names and Valid Types for ModelSchema Model Schema Properties below for details.

A domain version is defined with a domain JSON Object as described below:

...

uniquenessRules
propertyrequiredvalid valuesdescription
modelSchemayesSee Model Schema Properties and Post a Domain below for details.A JSON model describing the schema for the data domain; it defines the properties that make up the domains schema. The root node of the model schema is the properties element. See Valid Property Names and Valid Types for ModelSchema Properties below.
descriptionno0 to 255 characters long. If longer it will be truncated.A human readable description of the domain version.
displayPropertyyesA valid model schema property name. See the Display Property below for details.A property defined in the modelSchema that acts as an index for the domain. The data values for the displayProperty must always be unique. See Retrieving Data Records; the Display Property below. 
uniquenessRulesnoOne or more valid model schema property names. See the UniquenessRules Property below for details.Required data and their associated rules that are cached to ensure duplicate data entries are not POSTed to the domain. This defaults to the displayProperty if it is not provided. See UniquenessRules Property below. 

Once the domain/version has been created you can POST data records to, and retrieve data records from, the domain.

...

The information below provides further important domain property details on:

...

Each domain must have a display property (displayProperty). The display property acts as a primary key for the domain. For example, the "states" domain above uses the abbreviation property as the display property. example, the "states" domain below uses the abbreviation property as the display property.


Code Block
languagejs
{
	"name": "states",
	"version": 1,
	"json": {
		"name" : "California", 
		"abbreviation" : "CA"
	}
 }

Use the /drs endpoint and the appropriate domain and display property to GET a data record:

...

GET /drs?filters=name:states,version:1,displayProperty:CA

Note: See Posting a Data Record and Retrieving a Data Record sections for further details on posting/retrieving data records.

Display Property Rules
  • The value provided for the displayProperty must be unique between all domain entries of a given domain type (e.g. each entry in the "state" domain must have a unique stateName).
  • Only one property in a domain can be the displayProperty. If more than one property is required to ensure uniqueness see the Uniqueness Rules Property below.
  • Display properties are limited to type STRING.
  • Properties designated as the displayProperty are required; i.e. null values are not allowed.
  • Display properties are case sensitive e.g. "California" is NOT equal to "california".

...

Code Block
titleExample 2
{
	"properties": {
		...
		"owner": {
			"name": {...},
			"phone": {...},
			....
		},
		"pet": {
			"name": {...},
			"classification": {...},
			....
		},
		....
	}
}

Valid Model Schema Types
Anchor
validTypes
validTypes

Each property with the exception of a node, requires a type property e.g.:

...

Enumerations (enums) can be either a primitive type (stringint, or a number) or, a cross-reference to an entire set or subset of data records in another domain.

...

  • POST a Domain Version

    POST /domains/versions/7f28180b-7d9f-42b5-b5ed-d4a0e7ec09fc

    Code Block
    languagetext
    {
    	"displayProperty": "abbreviation",
    	"uniquenessRules": "abbreviation",
    	"description": "A reference list of states in the North American States: USA, Mexico and Canada",
    	"modelSchema" {
    		"properties": {
    			"name": {
    				"type": "string",
    				"description": "The state's official name",
    				"min": 2,
    				"max": 80,
    				"required": true
    			},
    			"abbreviation": {
    				"type": "string",
    				"description": "The state's official abbreviation",
    				"min": 2,
    				"max": 2,
    				"required": true
    			}
    		}
    	}
    }



The following JSON is another simple example of a model for a domain version.

POST /domains/versions/2a556060-e694-4b61-a3bb-67beda37da13

Code Block
languagetext
{
	"displayProperty": "countrycode",
	"modelSchema" {
		"properties": {
			"name": {
				"type": "string",
				"min": 2,
				"max": 80,
				"required": true
			},
			"countrycode": {
				"type": "string",
				"min": 3,
				"max": 3,
				"required": true,
				"description": "ISO Standard 3-character Country Code"
			},
			"population": {
				"type": "int",
				"required": false
			},
			"capital": {
				"city": {
					"type": "string",
					"required": true
				},
				"districtOrState": {
					"type": "string",
					"required": true
				}
			}
		}
	}
}

Note: Inside the value portion of the modelSchema node, all of the double quotes must be escaped with a backslash (\). Newlines have been added above for readability but they should not be included in the request body. The request should look like this:

Code Block
languagetext
{
    "name": "countries",
	"displayProperty": "countrycode"
	"modelSchema": "{ \"properties\": { \"name\": { \"type\": \"string\", \"min\": 2, \"max\": 80, \"required\": true }, \"countrycode\": { \"type\": \"string\", \"min\": 3, \"max\": 3, \"required\": true, \"description\": \"ISO Standard 3-character Country Code\" }, \"population\": { \"type\": \"int\", \"required\": false }, \"capital\": { \"city\": { \"type\": \"string\", \"required\": true }, \"districtOrState\": { \"type\": \"string\", \"required\": true } } } }"
}


The response code on success

...

is: 201 CREATED

Posting Data Records to the Domain
Anchor
postDR
postDR

Once the domain/version has been created, data records can be POSTed to it using the /dr endpoint: 

...

Note: In a federated domain you will need to Map the data record.

Retrieving Data Records from the Domain
Anchor
retrieveDR
retrieveDR

The data records for a the default version of a domain can be retrieved with the following:

...