Dependencies for an Entity

/api/repositories/{repository}/entities/{entity}/dependencies
Parameter Type Purpose
repository string the name of the Repository
entity int The ID of the entity to view

Get

GET /api/repositories/(string: repository)/entities/(int: entityID)/dependencies

Lists discovered dependencies of the corresponding Entity

GET /api/repositories/test/entities/1/dependencies HTTP/1.1
Accept: application/json
Response Code Reason
200 No error
400 Bad Request
500 Server error

The response will be a Standard Response, with a list of dependencies in the corresponding Entity.

Columns

The columns array will contain the list of columns for each data row.

Human Name Column Name Description
Lh Attrs _lhnames The attributes that determine the rh attribute
Rh Attr _rhname The attribute that is determined by the lh attribute(s)
Status __STATUS Whether the dependency is Discovered or Permanent.
Verified _verified Whether the rule quality has been verified against all rows.
Job JOB_ID The scheduler job that created this rule.
Quality % GOODNESS A measure of how well the attributes form a dependency
Confirming LR Values CONFIRMATIONS The number of lh values that do determine their rh value.
Conflicting LH Values _conflicting_lh_values The number of distinct lh values that do not determine their rh value
Resolved % _resolved The percentage of conflicting LH Values that have been resolved
Normalise Flag _normalise Dependency can be included in a normalisation (1=true, 0=false)
Conflicting Rows _conflicting_rows The number of rows where the lh value does not determine their rh value
Verified Date _checked_date When the dependency was last verified.
Verified By CHECKED_BY Who verified the dependency.
Created Date _created_date When the dependency rule was created.
Created By CREATED_BY Who created the dependency rule.
Dependency Key _fd_key Internal key for this dependency
Rh Attr ID RH_ATTR Ids of the right hand attributes that form the primary key
Lh Attr Ids LH_ATTRS Ids of the left hand attributes that form the primary key

Data Row

The data row array will contain the list of dependencies in the corresponding Entity:

"rows": [
{
    "dataRow": [
    "Account Holder",
    "Deactivated Date",
    "Discovered",
    "Yes",
    "1",
    "99.875",
    "1602",
    "1",
    "",
    "0",
    "3",
    "2015/02/12 13:36:48",
    "bob",
    "2015/02/12 13:36:48",
    "bob",
    "19 14",
    "19",
    "14"
    ],
    "metadata": {
        "url": "/api/repositories/test/entities/1/dependencies/19-14/conflicts/"
    }
}

If there are no dependencies in the Entity, rows will be an empty string.

Post

List Dependencies

POST /api/repositories/(string: repository)/entities/(int: entityID)/dependencies

Lists all dependencies of the corresponding entity, allow user to pass in supported options (Paging, Columns, Sorting & Cache) see Standard Request for more information on these options.

POST /api/repositories/{repository}/entities/{entity}/dependencies HTTP/1.1
Content-Type: application/json

{
    "command": "get",
    "options": {
        "pageStart": "1",
        "pageSize": "65"
    }
}
Response Code Reason
200 Success
400 Bad Request
500 Server error

The request packet must contain the command element. The options elements is optional.

The response will be a Standard Response, with a list of all dependencies in the corresponding Entity.

The columns array will contain the list of columns for each data row as listed in above columns.

The data row will contain the list of all dependencies in the corresponding Entity similar to ones listed in above data row

Create

POST /api/repositories/test/entities/1/dependencies HTTP/1.1
Content-Type: application/json

{
    "command": "create",
    "data": {
        "jobName": "Create Dependency",
        "attributes": {
            "rhs": "1",
            "lhs": "2 3 4"
        },
        "scheduleNow":"0",
        "scheduleTime":"2016-11-22 11:40:45"
    }
}
Response Code Reason
200 No error
400 Invalid data passed with request
500 Server error

The request requires a Standard Request packet. Available commands are:

Command Description
create Create dependency

The request packet must contain the command and data elements. The following fields should be sent as part of data:

Name Mandatory Default Value Description
jobName Yes NA Name of the create dependency job
attributes Yes NA It should contain right hand attribute id and left hand attribute ids.
rhs Yes NA Right hand attribute id.
lhs Yes NA Left hand attribute ids.
scheduleNow No NA Yes (1) / No (0)
scheduleTime No NA What time to start. Required: No (if scheduleNow is 1) / Yes (if scheduleNow is 0).

If scheduleNow is 0 and scheduleTime is not provided, the job will run immediately.

scheduleNow field can be formatted as follows:

Value Description
1 Schedule the job immediately
0 Schedule the job at a given date and time (requires scheduleTime field)

scheduleTime field can be formatted as follows:

Value Example
YYYY-Month-DD HH:MM:SS 2016-JANUARY-01 10:30:45
YYYY/Month/DD HH:MM:SS 2016/JANUARY/01 10:30:45
YYYY-Mon-DD HH:MM:SS 2016-JAN-01 10:30:45
YYYY/Mon/DD HH:MM:SS 2016/JAN/01 10:30:45
YYYY-MM-DD HH:MM:SS 2016-01-01 10:30:45
YYYY/MM/DD HH:MM:SS 2016/01/01 10:30:45

The response will contain the URL of the scheduled job.

"uri": "/api/repositories/test/scheduler/277"

Discover

POST /api/repositories/test/entities/1/dependencies HTTP/1.1
Content-Type: application/json

{
    "command": "discover",
    "data": {
        "jobName":"restjob1",
        "firstRow": "1",
        "sampleSize": "50",
        "rowsToSample": {
            "option": "every",
            "value": "1"
        },
        "consistency": "95",
        "sparsity": "4",
        "maxLhs" : "4",
        "scheduleNow":"0",
        "scheduleTime":"2016-11-22 11:40:45"
    }
}
Response Code Reason
200 No error
400 Invalid data passed with request
500 Server error

The request requires a Standard Request packet. Available commands are:

Command Description
discover Discover dependencies.

The request packet must contain the command and data elements. The following fields should be sent as part of data:

Name Mandatory Default Value Description
jobName Yes NA Name of the scheduled dicover dependencies job
firstRow Yes 1 Start sampling at a given row. The value should be set between 1 and maximum number of rows available.
sampleSize Yes 1 How many rows to sample? The value should be set between 1 and maximum number of rows available.
rowsToSample Yes NA The options provided here are mutually exclusive. Options are explained further below.
consistency Yes NA How consistent should your dependencies be in %? The percentage should be between 1 & 100.
sparsity Yes NA Which attributes do you want to exclude. Those less then x% distinct? The percentage should be between 1 & 100.
maxLhs Yes NA Maximum number of attributes that can form a compound. The value should be between 1 and maximum number of attributes.
scheduleNow No NA Yes (1) / No (0)
scheduleTime No NA What time to start. Required: No (if scheduleNow is 1) / Yes (if scheduleNow is 0)

If scheduleNow is 0 and scheduleTime is not provided, the job will run immediately.

scheduleNow field can be formatted as follows:

Value Example
YYYY-Month-DD HH:MM:SS 2016-JANUARY-01 10:30:45
YYYY/Month/DD HH:MM:SS 2016/JANUARY/01 10:30:45
YYYY-Mon-DD HH:MM:SS 2016-JAN-01 10:30:45
YYYY/Mon/DD HH:MM:SS 2016/JAN/01 10:30:45
YYYY-MM-DD HH:MM:SS 2016-01-01 10:30:45
YYYY/MM/DD HH:MM:SS 2016/01/01 10:30:45

The rowsToSample allow one to select which rows to include in sampling. The options for rowsToSample are detailed below, they are mutually exclusive, hence you can only selected one of the following options:

Option Description
every Which rows to sample? For every row set value to 1. For every 5 rows set value to 5 and so on.
randomPercent Sample random percentage of rows. The percentage should be set between 1 and 100.
prevRandomSelection Re-use previous random selection. This option must only be set to 1 if you have previously sampled rows using ‘randomPercent’ option.

The response will contain the URL of the scheduled job.

"uri": "/api/repositories/test/scheduler/276"

Edit Dependencies

Setting Dependencies as Discovered or Permanent

POST /api/repositories/(string: repository)/entities/(int: entityID)/dependencies/

Set one or more dependencies as discovered/permanent for the corresponding entity.

POST /api/repositories/{repository}/entities/1/dependencies/discovered HTTP/1.1
Content-Type: application/json

{
    "command": "edit",
    "data": {
        "status": "Discovered",
        "dependencyKeys": ["5 2","6 2","8 2"]
    }
}
Response Code Reason
204 Success (No Content)
400 Bad Request
500 Server error

The request packet must contain the command and data element.

The required fields to set dependencies as permanent or discovered are:

  • status
  • dependencyKeys

The dependencies can be set as permanent or discovered as follows:

  • Set status field to Permanent to make the dependencies permanent
  • Set status field to Discovered to make the dependencies discovered
  • Set dependencyKeys field to an array containing one or more dependency keys

Delete

Deleting single dependency

DELETE /api/repositories/{repository}/entities/{entity}/dependencies/{dependencyKey}

Delete the given dependency

DELETE /api/repositories/test/entities/1/dependencies/5-2 HTTP/1.1
Response Code Reason
204 Success
400 Invalid parameters
500 Server error

Deleting multiple dependencies

DELETE /api/repositories/{repository}/entities/{entity}/dependencies/

Delete multiple dependencies

DELETE /api/repositories/test/entities/1/dependencies/ HTTP/1.1
Content-Type: application/json

{
    "command": "delete",
    "data": {
        "dependencyKeys": ["5 2", "6 2", "8 2"]
    }
}
Response Code Reason
204 Success
400 Invalid parameters
500 Server error

The delete packet must contain the command and data elements. The following fields should be sent as part of data:

Field Purpose
dependencyKeys A list of dependency keys.

Export

Some or all of the rows may be exported as a scheduled task.

POST /api/repositories/jupiter/entities/1/dependencies HTTP/1.1
Content-Type: application/json

{
    "command": "export",
    "data": {
        "filename": "filename.csv",
        "filetype": "csv",
        "encoding": "utf-8"
    },
    "options": {
        "columns": ["__STATUS", "_verified", "_fd_key"],
        "where": "Status = 'Discovered'"
    }
}
Response Code Reason
200 No error
400 Invalid data passed with request
500 Server error

The request packet must contain the command and data elements. The options element is not required, but may specify the columns to export, and/or the rows to filter.

The following table shows which fields are required in the data element:

Field Required
filename Y
filetype N
encoding N

If filetype is not specified, it defaults to csv. If encoding is not specified, it defaults to the server native encoding.

The response will contain the URL of the scheduled task and the link to download the exported file.

{
    "job": "/api/repositories/jupiter/scheduler/1",
    "file": "/api/repositories/jupiter/download/filename.csv"
}

Dependencies for an Attribute

/api/repositories/{repository}/entities/{entity}/attributes/{attribute}/dependencies
Parameter Type Purpose
repository string the name of the Repository
entity int The ID of the entity to view
attribute int The ID of the attribute to view

Get

GET /api/repositories/(string: repository)/entities/(int: entityID)/attributes/(int: attributeID)/dependencies

Lists all dependencies of the corresponding attribute

GET /api/repositories/test/entities/1/attributes/1/dependencies HTTP/1.1
Accept: application/json
Response Code Reason
200 No error
400 Bad Request
500 Server error

The response will be a Standard Response, with a list of all dependencies in the corresponding Attributes.

Columns

The columns array will contain the list of columns for each data row as listed in above columns.

Data Row

The data row will contain the list of dependencies in the corresponding Attributes:

"rows": [
{
    "dataRow": [
    "Line 01",
    "Line 02",
    "Permanent",
    "Yes",
    "7",
    "100.000",
    "50",
    "",
    "",
    "1",
    "",
    "2015/03/16 09:22:54",
    "bob@TEST-7",
    "2015/03/16 09:22:54",
    "bob@TEST-7",
    "2 1",
    "2",
    "1"
    ],
    "metadata": {
    "url": "/api/repositories/test/entities/1/attributes/1/dependencies/2-1/conflicts/"
    }
},
{
    "dataRow": [
    "Line 03",
    "Line 01",
    "Discovered",
    "Yes",
    "1",
    "98.000",
    "49",
    "1",
    "",
    "0",
    "2",
    "2015/02/05 11:53:02",
    "bob@TEST-7",
    "2015/02/05 11:53:02",
    "bob@TEST-7",
    "1 3",
    "1",
    "3"
    ],
    "metadata": {
    "url": "/api/repositories/test/entities/1/attributes/1/dependencies/1-3/conflicts/"
    }
}
]

If there are no dependencies in the Attributes, rows will be an empty string.

Post

List Dependencies

POST /api/repositories/(string: repository)/entities/(int: entityID)/attributes/(int: attributeID)/dependencies

Lists all dependencies of the corresponding attribute, allow user to pass in supported options (Paging, Columns, Sorting & Cache) see Standard Request for more information on these options.

POST /api/repositories/{repository}/entities/1/attributes/1/dependencies HTTP/1.1
Content-Type: application/json

{
    "command": "get",
    "options": {
        "pageStart": "1",
        "pageSize": "65"
    }
}
Response Code Reason
200 Success
400 Bad Request
500 Server error

The request packet must contain the command element. The options elements is optional.

The response will be a Standard Response, with a list of all dependencies in the corresponding Attributes.

The columns array will contain the list of columns for each data row as listed in above columns.

The data row will contain the list of all dependencies in the corresponding Attributes similar to ones listed in above data row

Edit Dependencies

Setting Dependencies as Discovered or Permanent

POST /api/repositories/(string: repository)/entities/(int: entityID)/attributes/(int: attributeID)/dependencies/

Set one or more dependencies as discovered/permanent for the corresponding attribute.

POST /api/repositories/{repository}/entities/1/attributes/5/dependencies/discovered HTTP/1.1
Content-Type: application/json

{
    "command": "edit",
    "data": {
        "status": "Discovered",
        "dependencyKeys": ["5 2","6 2","8 2"]
    }
}
Response Code Reason
204 Success (No Content)
400 Bad Request
500 Server error

The request packet must contain the command and data element.

The required fields to set dependencies as permanent or discovered are:

  • status
  • dependencyKeys

The dependencies can be set as permanent or discovered as follows:

  • Set status field to Permanent to make the dependencies permanent
  • Set status field to Discovered to make the dependencies discovered
  • Set dependencyKeys field to an array containing one or more dependency keys

Delete

Deleting single dependency

DELETE /api/repositories/{repository}/entities/{entity}/attributes/{attribute}/dependencies/{dependencyKey}

Delete the given dependency

DELETE /api/repositories/test/entities/1/attributes/5/dependencies/5-2 HTTP/1.1
Response Code Reason
204 Success
400 Invalid parameters
500 Server error

Deleting multiple dependencies

DELETE /api/repositories/{repository}/entities/{entity}/attributes/{attribute}/dependencies/

Delete multiple dependencies

DELETE /api/repositories/test/entities/1/attributes/5/dependencies/ HTTP/1.1
Content-Type: application/json

{
    "command": "delete",
    "data": {
        "dependencyKeys": ["5 2", "5 {1 2 3 4}", "5 {6 7}"]
    }
}
Response Code Reason
204 Success
400 Invalid parameters
500 Server error

The delete packet must contain the command and data elements. The following fields should be sent as part of data:

Field Purpose
dependencyKeys A list of dependency keys.