From cb32b5cd1355de92ce32caed9dafdff333d7d8b7 Mon Sep 17 00:00:00 2001 From: tjohnson-scottlogic Date: Thu, 1 Oct 2020 15:36:34 +0100 Subject: [PATCH 1/4] fix(#1708): Update schema to support the beta relational data feature --- .../profileschema/datahelix.schema.json | 69 ++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/profile/src/main/resources/profileschema/datahelix.schema.json b/profile/src/main/resources/profileschema/datahelix.schema.json index 7bf07b4d8..8589ae9bd 100644 --- a/profile/src/main/resources/profileschema/datahelix.schema.json +++ b/profile/src/main/resources/profileschema/datahelix.schema.json @@ -30,6 +30,13 @@ "items": { "$ref": "#/definitions/constraint" } + }, + "relationships": { + "title": "Defines any child objects", + "type": "array", + "items": { + "$ref": "#/definitions/relationship" + } } }, "definitions": { @@ -947,7 +954,67 @@ "type": "string" } } + }, + "relationship": { + "title": "Defines any nested child objects", + "type": "object", + "additionalProperties": false, + "required": [ + "name" + ], + "default": { + "name": "relationshipName", + "type": "string", + "formatting": "", + "unique": false, + "nullable": true + }, + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "profileFile": { + "type": "string" + }, + "profile": { + "type": "object", + "additionalProperties": false, + "required": [ + "fields" + ], + "properties": { + "additionalProperties": false, + "description": { + "title": "A description of what data the sub-profile is modelling", + "type": "string" + }, + "fields": { + "title": "The fields that data will be produced for. Field names must begin with an alphabetic character.", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "additionalItems": false, + "items": { + "$ref": "#/definitions/field" + } + }, + "constraints": { + "title": "The constraints on the data to be output", + "type": "array", + "additionalItems": false, + "items": { + "$ref": "#/definitions/constraint" + } + } + } + }, + "extents": { + "type": "array" + } + } } } } - From 008154e411f4fb87be55d2d1359101fdb0a3b527 Mon Sep 17 00:00:00 2001 From: Tim Johnson Date: Thu, 1 Oct 2020 17:05:26 +0100 Subject: [PATCH 2/4] Add ref to relational data --- docs/UserGuide.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index f9479c0a0..4ef2188e9 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -153,6 +153,8 @@ These sections are combined to form the [complete profile](#Example-Profile). * For a larger profile example see [The schema documentation](user/Schema.md) * Further examples can be found in [the Examples folder](https://github.com/finos/datahelix/tree/master/examples) +A Beta feature has been developed for generating nested data (as a step towards support for relational data), for further information see [this](RelationalData.md) page. + # Fields Fields are the "slots" of data that can take values. Typical fields might be _email_address_ or _user_id_. By default, any piece of data is valid for a field. This is an example field object for the profile: From e3594299e78a3b032025e1f2db274a6c1405c73d Mon Sep 17 00:00:00 2001 From: Tim Johnson Date: Fri, 2 Oct 2020 08:31:23 +0100 Subject: [PATCH 3/4] Update docs/UserGuide.md Co-authored-by: Simon Laing <44162572+sl-slaing@users.noreply.github.com> --- docs/UserGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 4ef2188e9..6f20f308e 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -153,7 +153,7 @@ These sections are combined to form the [complete profile](#Example-Profile). * For a larger profile example see [The schema documentation](user/Schema.md) * Further examples can be found in [the Examples folder](https://github.com/finos/datahelix/tree/master/examples) -A Beta feature has been developed for generating nested data (as a step towards support for relational data), for further information see [this](RelationalData.md) page. +A Beta feature has been developed for generating nested data (as a step towards support for relational data), for further information see [the Relational data documentation](RelationalData.md). # Fields From f2d7f0b0ee63329d5dfb11d1dc9e405ddc98a779 Mon Sep 17 00:00:00 2001 From: tjohnson-scottlogic Date: Fri, 2 Oct 2020 11:53:50 +0100 Subject: [PATCH 4/4] Add support for recursive relationships --- .../main/resources/profileschema/datahelix.schema.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/profile/src/main/resources/profileschema/datahelix.schema.json b/profile/src/main/resources/profileschema/datahelix.schema.json index 8589ae9bd..62e2896a7 100644 --- a/profile/src/main/resources/profileschema/datahelix.schema.json +++ b/profile/src/main/resources/profileschema/datahelix.schema.json @@ -1008,7 +1008,14 @@ "items": { "$ref": "#/definitions/constraint" } - } + }, + "relationships": { + "title": "Defines any child objects", + "type": "array", + "items": { + "$ref": "#/definitions/relationship" + } + } } }, "extents": {