diff --git a/CHANGELOG.md b/CHANGELOG.md index 4612940bc..23e896033 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed * Fixed `POST`queries for `g_variant` (w/ examples) - * Removed 'json' references inside the yaml version (PR [#43] (https://github.com/ga4gh-beacon/beacon-v2/pull/43)) + * Removed 'json' references inside the yaml version (PR [#43](https://github.com/ga4gh-beacon/beacon-v2/pull/43)) + * added missing `type: object` to `ResultsetInstance` (PR [#82](https://github.com/ga4gh-beacon/beacon-v2/pull/82)) ### Deprecated diff --git a/framework/json/common/beaconCommonComponents.json b/framework/json/common/beaconCommonComponents.json index 728c35267..a6b922664 100644 --- a/framework/json/common/beaconCommonComponents.json +++ b/framework/json/common/beaconCommonComponents.json @@ -76,11 +76,10 @@ }, "Granularity": { "default": "boolean", - "description": "Level of detail of the response:\n* `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.:\n - keeping non-mandatory attributes empty\n - Beacon to provide a minimal record definition", + "description": "Level of detail of the response:\n* `boolean`: returns true/false' responses * `count`: adds the total number of positive results found * `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.:\n - keeping non-mandatory attributes empty\n - Beacon to provide a minimal record definition", "enum": [ "boolean", "count", - "aggregated", "record" ], "type": "string" @@ -111,15 +110,19 @@ }, "HandoverType": { "$ref": "./ontologyTerm.json", - "description": "Handover type, as an Ontology_term object with CURIE syntax for the `id` value. Use `CUSTOM` for the `id` when no ontology is available.", + "description": "Handover type, as an Ontology_term object with CURIE syntax for the `id` value. Use \"CUSTOM:123455\" CURIE-style `id` when no ontology is available.", "examples": [ { - "id": "EFO:0004157", - "label": "BAM format" + "id": "EDAM:2572", + "label": "BAM" }, { - "id": "CUSTOM", - "label": "download genomic variants in .pgxseg file format" + "id": "EDAM:3016", + "label": "VCF" + }, + { + "id": "CUSTOM:pgxseg", + "label": "genomic variants in .pgxseg file format" } ] }, 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/json/responses/sections/beaconResultsets.json b/framework/json/responses/sections/beaconResultsets.json index 6ddeb3a88..a54e43030 100644 --- a/framework/json/responses/sections/beaconResultsets.json +++ b/framework/json/responses/sections/beaconResultsets.json @@ -44,7 +44,8 @@ "exists", "resultsCount", "results" - ] + ], + "type": "object" } }, "description": "Sets of results to be returned as query response.", diff --git a/framework/src/common/beaconCommonComponents.yaml b/framework/src/common/beaconCommonComponents.yaml index c0044ed5c..f8f479fa5 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: @@ -265,11 +263,13 @@ definitions: example: https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0/ HandoverType: description: >- - Handover type, as an Ontology_term object with CURIE syntax for the `id` value. - Use `CUSTOM` for the `id` when no ontology is available. + Handover type, as an Ontology_term object with CURIE syntax for the `id` + value. Use "CUSTOM:123455" CURIE-style `id` when no ontology is available. $ref: ./ontologyTerm.yaml examples: - - id: EFO:0004157 - label: BAM format - - id: CUSTOM - label: download genomic variants in .pgxseg file format + - id: EDAM:2572 + label: BAM + - id: EDAM:3016 + label: VCF + - id: CUSTOM:pgxseg + label: genomic variants in .pgxseg file format 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 diff --git a/framework/src/responses/sections/beaconResultsets.yaml b/framework/src/responses/sections/beaconResultsets.yaml index 246ef8277..09835db13 100644 --- a/framework/src/responses/sections/beaconResultsets.yaml +++ b/framework/src/responses/sections/beaconResultsets.yaml @@ -15,6 +15,7 @@ required: additionalProperties: true definitions: ResultsetInstance: + type: object properties: id: description: id of the resultset diff --git a/models/json/beacon-v2-default-model/common/disease.json b/models/json/beacon-v2-default-model/common/disease.json index 5da7a797d..d50bbfdfa 100644 --- a/models/json/beacon-v2-default-model/common/disease.json +++ b/models/json/beacon-v2-default-model/common/disease.json @@ -6,30 +6,22 @@ "$ref": "./timeElement.json", "examples": [ { - "ageGroup": { - "id": "NCIT:C49685", - "label": "Adult 18-65 Years Old" - } + "id": "NCIT:C49685", + "label": "Adult 18-65 Years Old" }, { - "age": { - "iso8601duration": "P32Y6M1D" - } + "iso8601duration": "P32Y6M1D" }, { - "ageRange": { - "end": { - "iso8601duration": "P59Y" - }, - "start": { - "iso8601duration": "P18Y" - } + "end": { + "iso8601duration": "P59Y" + }, + "start": { + "iso8601duration": "P18Y" } }, { - "age": { - "iso8601duration": "P2M4D" - } + "iso8601duration": "P2M4D" } ] }, diff --git a/models/json/beacon-v2-default-model/genomicVariations/requestParameters.json b/models/json/beacon-v2-default-model/genomicVariations/requestParameters.json index 48381aaf7..e469211f4 100644 --- a/models/json/beacon-v2-default-model/genomicVariations/requestParameters.json +++ b/models/json/beacon-v2-default-model/genomicVariations/requestParameters.json @@ -17,14 +17,14 @@ "$ref": "./requestParametersComponents.json#/definitions/Assembly" }, "end": { - "description": "Precise or bracketing the end of the variants of interest: * (0-based, exclusive) - see `start` * for bracket queries, provide 2 values (e.g. [111,222]).\"", + "description": "Precise or bracketing the end of the variants of interest: * (0-based, exclusive) - see `start` * for bracket queries, provide 2 values (e.g. [111,222]).", "items": { "format": "int64", "minimum": 1, "type": "integer" }, "maxItems": 2, - "minItems": 0, + "minItems": 1, "type": "array" }, "geneId": { @@ -52,7 +52,7 @@ "$ref": "./requestParametersComponents.json#/definitions/RefSeqId" }, "start": { - "description": "Precise or fuzzy start coordinate position(s), allele locus (0-based, inclusive). * `start` only:\n - for single positions, e.g. the start of a specified sequence\n alteration where the size is given through the specified `alternateBases`\n - typical use are queries for SNV and small InDels\n - the use of `start` without an `end` parameter requires the use of\n `alternateBases`\n* `start` and `end`:\n - for searching any variant falling fully or partially within the range\n between `start` and `end` (a.k.a. \"range query\")\n - additional use of `variantType` OR `alternateBases` can limit the\n scope of the query\n - by convention, partial overlaps of variants with the indicated genomic\n range are accepted; for specific overlap requirements the 4-parameter\n \"Bracket Queries\" should be employed\n* 2 values in both `start` and `end` for constructing a \"Bracket Query\":\n - can be used to match any contiguous genomic interval, e.g. for querying\n imprecise positions\n - identifies all structural variants starting between `start[0]` and `start[1]`,\n and ending between `end[0]` <-> `end[1]`\n - single or double sided precise matches can be achieved by setting\n `start[1]=start[0]+1` and `end[1]=end[0]+1`", + "description": "Precise or fuzzy start coordinate position(s), allele locus (0-based, inclusive). * `start` only:\n - for single positions, e.g. the start of a specified sequence\nalteration where the size is given through the specified `alternateBases`\n - typical use are queries for SNV and small InDels\n - the use of `start` without an `end` parameter requires the use of\n`alternateBases`\n* 1 value each in both `start` and `end`:\n - for searching any variant falling fully or partially within the range\n between `start` and `end` (a.k.a. \"range query\")\n - additional use of `variantType` OR `alternateBases` can limit the\n scope of the query\n - by convention, partial overlaps of variants with the indicated genomic\n range are accepted; for specific overlap requirements the 4-parameter\n \"Bracket Queries\" should be employed\n* 2 values in both `start` and `end` for constructing a \"Bracket Query\":\n - can be used to match any contiguous genomic interval, e.g. for querying\n imprecise positions\n - identifies all structural variants starting between `start[0]` and `start[1]`,\n and ending between `end[0]` <-> `end[1]`\n - single or double sided precise matches can be achieved by setting\n `start[1]=start[0]+1` and `end[1]=end[0]+1`", "items": { "format": "int64", "minimum": 0, @@ -87,4 +87,4 @@ }, "type": "object" } -} \ No newline at end of file +} diff --git a/models/src/beacon-v2-default-model/common/disease.yaml b/models/src/beacon-v2-default-model/common/disease.yaml index a4f5f5719..c6472dad6 100644 --- a/models/src/beacon-v2-default-model/common/disease.yaml +++ b/models/src/beacon-v2-default-model/common/disease.yaml @@ -20,18 +20,14 @@ properties: ageOfOnset: $ref: ./timeElement.yaml examples: - - ageGroup: - id: NCIT:C49685 - label: Adult 18-65 Years Old - - age: - iso8601duration: P32Y6M1D - - ageRange: - start: - iso8601duration: P18Y - end: - iso8601duration: P59Y - - age: - iso8601duration: P2M4D + - id: NCIT:C49685 + label: Adult 18-65 Years Old + - iso8601duration: P32Y6M1D + - start: + iso8601duration: P18Y + end: + iso8601duration: P59Y + - iso8601duration: P2M4D stage: description: 'Ontology term from Ontology for General Medical Science (OGMS), e.g. acute onset (OGMS:0000119). Provenance: GA4GH Phenopackets v2 `Disease.disease_stage`' diff --git a/models/src/beacon-v2-default-model/genomicVariations/requestParameters.yaml b/models/src/beacon-v2-default-model/genomicVariations/requestParameters.yaml index 37c5b9e48..112bdb2ab 100644 --- a/models/src/beacon-v2-default-model/genomicVariations/requestParameters.yaml +++ b/models/src/beacon-v2-default-model/genomicVariations/requestParameters.yaml @@ -16,7 +16,7 @@ g_variant: - typical use are queries for SNV and small InDels - the use of `start` without an `end` parameter requires the use of `alternateBases` - * `start` and `end`: + * 1 value in both `start` and `end`: - for searching any variant falling fully or partially within the range between `start` and `end` (a.k.a. "range query") - additional use of `variantType` OR `alternateBases` can limit the @@ -48,7 +48,7 @@ g_variant: type: integer format: int64 minimum: 1 - minItems: 0 + minItems: 1 maxItems: 2 referenceBases: $ref: ./requestParametersComponents.yaml#/definitions/ReferenceBases