From ca1297b356f26288c2dfe518dbd19208779d426b Mon Sep 17 00:00:00 2001 From: Michael Baudis <675030+mbaudis@users.noreply.github.com> Date: Thu, 22 Dec 2022 12:37:07 +0100 Subject: [PATCH 1/2] removing the validation directories The validation directories are confusing & not part of the framework itself. --- docs/formats-standards.md | 12 +- .../validation/beaconCommonComponents.json | 54 --------- .../requests/validation/filteringTerms.json | 109 ------------------ .../validation/beaconCommonComponents.yaml | 37 ------ .../requests/validation/filteringTerms.yaml | 88 -------------- 5 files changed, 4 insertions(+), 296 deletions(-) delete mode 100644 framework/json/common/validation/beaconCommonComponents.json delete mode 100644 framework/json/requests/validation/filteringTerms.json delete mode 100644 framework/src/common/validation/beaconCommonComponents.yaml delete mode 100644 framework/src/requests/validation/filteringTerms.yaml diff --git a/docs/formats-standards.md b/docs/formats-standards.md index e22885c73..403a666fe 100644 --- a/docs/formats-standards.md +++ b/docs/formats-standards.md @@ -23,28 +23,24 @@ The Beacon v2 specification is written in [YAML](https://yaml.org). The original framework |-- json | |-- common - | | |-- examples - | | `-- validation + | | `-- examples | |-- configuration | | `-- examples | |-- requests | | |-- examples-fullDocuments - | | |-- examples-sections - | | `-- validation + | | `-- examples-sections | `-- responses | |-- examples-fullDocuments | |-- examples-sections | `-- sections `-- src |-- common - | |-- examples - | `-- validation + | `-- examples |-- configuration | `-- examples |-- requests | |-- examples-fullDocuments - | |-- examples-sections - | `-- validation + | `-- examples-sections `-- responses |-- examples-fullDocuments |-- examples-sections diff --git a/framework/json/common/validation/beaconCommonComponents.json b/framework/json/common/validation/beaconCommonComponents.json deleted file mode 100644 index 99bb55603..000000000 --- a/framework/json/common/validation/beaconCommonComponents.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "$schema": { - "description": "Added here to allow the example to comply with the 'additionalProperties:true' restriction.", - "type": "string" - }, - "apiVersion": { - "$ref": "../beaconCommonComponents.json#/definitions/ApiVersion" - }, - "beaconError": { - "$ref": "../beaconCommonComponents.json#/definitions/BeaconError" - }, - "beaconId": { - "$ref": "../beaconCommonComponents.json#/definitions/BeaconId" - }, - "exists": { - "$ref": "../beaconCommonComponents.json#/definitions/Exists" - }, - "filters": { - "$ref": "../beaconCommonComponents.json#/definitions/Filters" - }, - "handover": { - "$ref": "../beaconCommonComponents.json#/definitions/Handover" - }, - "handoverType": { - "$ref": "../beaconCommonComponents.json#/definitions/HandoverType" - }, - "includeResultsetResponses": { - "$ref": "../beaconCommonComponents.json#/definitions/IncludeResultsetResponses" - }, - "info": { - "$ref": "../beaconCommonComponents.json#/definitions/Info" - }, - "listOfHandovers": { - "$ref": "../beaconCommonComponents.json#/definitions/ListOfHandovers" - }, - "listOfSchemas": { - "$ref": "../beaconCommonComponents.json#/definitions/ListOfSchemas" - }, - "numTotalResults": { - "$ref": "../beaconCommonComponents.json#/definitions/NumTotalResults" - }, - "pagination": { - "$ref": "../beaconCommonComponents.json#/definitions/Pagination" - }, - "schemasPerEntity": { - "$ref": "../beaconCommonComponents.json#/definitions/SchemasPerEntity" - } - }, - "title": "Schema for validating Beacon Common Components examples", - "type": "object" -} \ No newline at end of file diff --git a/framework/json/requests/validation/filteringTerms.json b/framework/json/requests/validation/filteringTerms.json deleted file mode 100644 index e4d51516e..000000000 --- a/framework/json/requests/validation/filteringTerms.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "definitions": { - "AlphanumericFilter": { - "description": "Filter results based on operators and values applied to alphanumeric fields.", - "properties": { - "id": { - "description": "Field identfier to be queried.", - "example": "age", - "type": "string" - }, - "operator": { - "default": "=", - "description": "Defines how the value relates to the field `id`.", - "enum": [ - "=", - "<", - ">", - "!", - ">=", - "<=" - ], - "example": ">", - "type": "string" - }, - "value": { - "description": "Alphanumeric search term to be used within the query which can contain wildcard characters (%) to denote any number of unknown characters. Values can be assocatied with units if applicable.", - "example": "P70Y", - "type": "string" - } - }, - "required": [ - "id", - "operator", - "value" - ], - "type": "object" - }, - "CustomFilter": { - "description": "Filter results to include records that contain a custom term defined by this Beacon.", - "properties": { - "id": { - "description": "Custom filter terms should contain a unique identifier.", - "example": "demographic.ethnicity:asian", - "type": "string" - } - }, - "required": [ - "id" - ], - "type": "object" - }, - "OntologyFilter": { - "description": "Filter results to include records that contain a specific ontology term.", - "properties": { - "id": { - "description": "Term ID to be queried, using CURIE syntax where possible.", - "example": "HP:0002664", - "type": "string" - }, - "includeDescendantTerms": { - "default": true, - "description": "Define if the Beacon should implement the ontology hierarchy, thus query the descendant terms of `id`.", - "type": "boolean" - }, - "similarity": { - "default": "exact", - "description": "Allow the Beacon to return results which do not match the filter exactly, but do match to a certain degree of similarity. The Beacon defines the semantic similarity model implemented and how to apply the thresholds of 'high', 'medium' and 'low' similarity.", - "enum": [ - "exact", - "high", - "medium", - "low" - ], - "type": "string" - } - }, - "required": [ - "id" - ], - "type": "object" - } - }, - "description": "Rules for selecting records based upon the field values those records contain. Filters are seperated by the logical AND operator.", - "properties": { - "$schema": { - "description": "Added here to allow the example to comply with the 'additionalProperties:true' restriction.", - "type": "string" - }, - "filters": { - "items": { - "anyOf": [ - { - "$ref": "#/definitions/OntologyFilter" - }, - { - "$ref": "#/definitions/AlphanumericFilter" - }, - { - "$ref": "#/definitions/CustomFilter" - } - ] - }, - "type": "array" - } - }, - "title": "Filtering Term Element" -} \ No newline at end of file diff --git a/framework/src/common/validation/beaconCommonComponents.yaml b/framework/src/common/validation/beaconCommonComponents.yaml deleted file mode 100644 index ac0b6d9f3..000000000 --- a/framework/src/common/validation/beaconCommonComponents.yaml +++ /dev/null @@ -1,37 +0,0 @@ -$schema: https://json-schema.org/draft/2020-12/schema -title: Schema for validating Beacon Common Components examples -type: object -properties: - $schema: - type: string - description: Added here to allow the example to comply with the 'additionalProperties:true' - restriction. - beaconId: - $ref: ../beaconCommonComponents.yaml#/definitions/BeaconId - apiVersion: - $ref: ../beaconCommonComponents.yaml#/definitions/ApiVersion - beaconError: - $ref: ../beaconCommonComponents.yaml#/definitions/BeaconError - listOfSchemas: - $ref: ../beaconCommonComponents.yaml#/definitions/ListOfSchemas - schemasPerEntity: - $ref: ../beaconCommonComponents.yaml#/definitions/SchemasPerEntity - pagination: - $ref: ../beaconCommonComponents.yaml#/definitions/Pagination - includeResultsetResponses: - $ref: ../beaconCommonComponents.yaml#/definitions/IncludeResultsetResponses - filters: - $ref: ../beaconCommonComponents.yaml#/definitions/Filters - exists: - $ref: ../beaconCommonComponents.yaml#/definitions/Exists - numTotalResults: - $ref: ../beaconCommonComponents.yaml#/definitions/NumTotalResults - info: - $ref: ../beaconCommonComponents.yaml#/definitions/Info - handover: - $ref: ../beaconCommonComponents.yaml#/definitions/Handover - handoverType: - $ref: ../beaconCommonComponents.yaml#/definitions/HandoverType - listOfHandovers: - $ref: ../beaconCommonComponents.yaml#/definitions/ListOfHandovers -additionalProperties: false diff --git a/framework/src/requests/validation/filteringTerms.yaml b/framework/src/requests/validation/filteringTerms.yaml deleted file mode 100644 index 6fa00be82..000000000 --- a/framework/src/requests/validation/filteringTerms.yaml +++ /dev/null @@ -1,88 +0,0 @@ -$schema: https://json-schema.org/draft/2020-12/schema -title: Filtering Term Element -description: Rules for selecting records based upon the field values those records - contain. Filters are seperated by the logical AND operator. -properties: - $schema: - type: string - description: Added here to allow the example to comply with the 'additionalProperties:true' - restriction. - filters: - type: array - items: - anyOf: - - $ref: '#/definitions/OntologyFilter' - - $ref: '#/definitions/AlphanumericFilter' - - $ref: '#/definitions/CustomFilter' -definitions: - OntologyFilter: - type: object - description: Filter results to include records that contain a specific ontology - term. - required: - - id - properties: - id: - type: string - description: Term ID to be queried, using CURIE syntax where possible. - example: HP:0002664 - includeDescendantTerms: - type: boolean - default: true - description: Define if the Beacon should implement the ontology hierarchy, - thus query the descendant terms of `id`. - similarity: - type: string - enum: - - exact - - high - - medium - - low - default: exact - description: Allow the Beacon to return results which do not match the filter - exactly, but do match to a certain degree of similarity. The Beacon defines - the semantic similarity model implemented and how to apply the thresholds - of 'high', 'medium' and 'low' similarity. - AlphanumericFilter: - description: Filter results based on operators and values applied to alphanumeric - fields. - type: object - required: - - id - - operator - - value - properties: - id: - type: string - description: Field identfier to be queried. - example: age - operator: - type: string - enum: - - '=' - - < - - '>' - - '!' - - '>=' - - <= - description: Defines how the value relates to the field `id`. - default: '=' - example: '>' - value: - type: string - description: Alphanumeric search term to be used within the query which can - contain wildcard characters (%) to denote any number of unknown characters. Values - can be assocatied with units if applicable. - example: P70Y - CustomFilter: - type: object - description: Filter results to include records that contain a custom term defined - by this Beacon. - required: - - id - properties: - id: - type: string - description: Custom filter terms should contain a unique identifier. - example: demographic.ethnicity:asian -additionalProperties: false From 2b12b2311178c8e64eb5366d62ca665816072d58 Mon Sep 17 00:00:00 2001 From: Jordi Rambla Date: Tue, 28 Mar 2023 18:26:48 +0200 Subject: [PATCH 2/2] Removing mentions to "aggregated" granularity in the code. --- framework/src/common/beaconCommonComponents.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/framework/src/common/beaconCommonComponents.yaml b/framework/src/common/beaconCommonComponents.yaml index c0044ed5c..5ffee4cd0 100644 --- a/framework/src/common/beaconCommonComponents.yaml +++ b/framework/src/common/beaconCommonComponents.yaml @@ -137,7 +137,6 @@ definitions: * `boolean`: returns true/false' responses * `count`: adds the total number of positive results found - * `aggregated`: returns summary, aggregated or distribution like responses * `record`: returns details for every row. In cases where a Beacon prefers to return records with fewer than allattributes, different strategies have to be considered w/o adding them to the current design, e.g.: @@ -147,7 +146,6 @@ definitions: enum: - boolean - count - - aggregated - record default: boolean TestMode: