From fda7bd9b45802f44070994d68b5008c04eaa0976 Mon Sep 17 00:00:00 2001 From: Michael Baudis <675030+mbaudis@users.noreply.github.com> Date: Wed, 7 Feb 2024 11:25:31 +0100 Subject: [PATCH] 1.4.2 --- bycon/__init__.py | 5 +- bycon/beaconServer/beacon.py | 19 +- bycon/beaconServer/cohorts.py | 9 +- bycon/beaconServer/configuration.py | 9 +- bycon/beaconServer/datasets.py | 10 +- bycon/beaconServer/entry_types.py | 8 +- bycon/beaconServer/filtering_terms.py | 9 +- bycon/beaconServer/info.py | 9 +- bycon/beaconServer/map.py | 7 +- bycon/beaconServer/service_info.py | 8 +- ...ples-from-NCIT-filters-no-descendants.json | 8 +- .../PUT-biosamples-from-NCIT-filters.json | 12 +- .../tests/PUT-core-from-NCIT-filters.json | 12 +- .../PUT-individuals-from-NCIT-filters.json | 9 +- .../PUT-phenopackets-from-NCIT-filters.json | 11 +- .../PUT-variants-for-CDKN2A-DEL-gliomas.json | 10 +- .../tests/PUT-variants-for-biosampleIds.json | 6 +- .../PUT-variants-for-specific-alt-bases.json | 15 +- bycon/beaconServer/tests/terminal-examples.md | 29 +- ...s (conflicted copy 2024-01-18 173140).yaml | 513 ----------- bycon/config/argument_definitions.yaml | 22 +- bycon/config/beacon_defaults.yaml | 4 - bycon/config/config.yaml | 26 +- bycon/config/datatable_mappings.yaml | 31 + bycon/config/filter_definitions.yaml | 4 +- bycon/lib/args_parsing.py | 68 +- bycon/lib/beacon_response_generation.py | 210 ++--- bycon/lib/bycon_helpers.py | 72 +- bycon/lib/cgi_parsing.py | 73 +- bycon/lib/dataset_parsing.py | 13 +- bycon/lib/genome_utils.py | 13 +- bycon/lib/handover_generation.py | 22 +- bycon/lib/parse_filters_request.py | 23 +- bycon/lib/parse_variant_request.py | 2 +- bycon/lib/query_generation.py | 50 +- bycon/lib/read_specs.py | 8 +- bycon/lib/response_remapping.py | 10 +- bycon/lib/service_utils.py | 16 +- bycon/schemas/bin/beaconYamler.py | 18 +- .../responses/byconautServiceResponse.json | 30 +- .../responses/byconautServiceResults.json | 30 +- .../framework/json/common/basicElement.json | 14 +- .../json/common/beaconCommonComponents.json | 322 +++---- .../json/common/elementWithDescription.json | 16 +- .../beaconCommonComponents-example.json | 60 +- .../elementWithDescription-example.json | 4 +- .../examples/ontologizedElement-example.json | 2 +- .../referenceToAnSchema-MAX-example.json | 2 +- .../json/common/ontologizedElement.json | 18 +- .../framework/json/common/ontologyTerm.json | 16 +- .../json/common/referenceToAnSchema.json | 20 +- .../validation/beaconCommonComponents.json | 54 +- .../beaconConfigurationSchema.json | 58 +- .../json/configuration/beaconMapSchema.json | 86 +- .../configuration/entryTypeDefinition.json | 78 +- .../json/configuration/entryTypesSchema.json | 26 +- .../examples/beaconConfiguration-example.json | 74 +- .../examples/beaconMap-example.json | 16 +- ...triesCollectionDefinition_MIN_example.json | 26 +- .../entriesCollectionDefinition_example.json | 36 +- .../entryTypeDefinition-MIN-example.json | 12 +- .../configuration/filteringTermsSchema.json | 48 +- bycon/schemas/framework/json/endpoints.json | 294 +++---- .../json/requests/beaconRequestBody.json | 36 +- .../json/requests/beaconRequestMeta.json | 12 +- .../beaconRequestBody-MAX-example.json | 24 +- .../filteringTerms-example.json | 8 +- .../requestParameters-example.json | 4 +- .../json/requests/filteringTerms.json | 170 ++-- .../json/requests/requestParameters.json | 12 +- .../requests/validation/filteringTerms.json | 150 ++-- .../json/responses/beaconBooleanResponse.json | 36 +- .../responses/beaconCollectionsResponse.json | 32 +- .../beaconConfigurationResponse.json | 12 +- .../json/responses/beaconCountResponse.json | 36 +- .../responses/beaconEntryTypesResponse.json | 12 +- .../json/responses/beaconErrorResponse.json | 16 +- .../beaconFilteringTermsResponse.json | 12 +- .../json/responses/beaconInfoResponse.json | 12 +- .../json/responses/beaconMapResponse.json | 12 +- .../responses/beaconResultsetsResponse.json | 32 +- .../beaconBooleanResponse-example.json | 24 +- ...beaconCollectionsResponse-MID-example.json | 54 +- ...beaconCollectionsResponse-MIN-example.json | 30 +- .../beaconConfigurationResponse-example.json | 76 +- .../beaconCountResponse-example.json | 68 +- .../beaconEntryTypesResponse-example.json | 54 +- .../beaconErrorResponse_example.json | 36 +- .../beaconFilteringTermsResponse-example.json | 38 +- .../beaconInfo-MAX-example.json | 44 +- .../beaconInfo-MIN-example.json | 6 +- .../beaconMapResponse-example.json | 22 +- .../beaconResultsetResponse-MIN-example.json | 24 +- ...aconInformationalResponseMeta-example.json | 2 +- ...conReceivedRequestSummary-MAX-example.json | 30 +- ...conReceivedRequestSummary-MIN-example.json | 4 +- .../beaconResponseMeta-example.json | 30 +- .../beaconResultsetEmpty-example.json | 4 +- .../beaconResultsets-MAX-example.json | 32 +- .../beaconResultsets-MID-example.json | 12 +- .../ga4gh-service-info-1-0-0-schema.json | 176 ++-- .../beaconBooleanResponseSection.json | 14 +- .../sections/beaconCountResponseSection.json | 12 +- .../sections/beaconFilteringTermsResults.json | 112 +-- .../responses/sections/beaconInfoResults.json | 202 ++--- .../beaconInformationalResponseMeta.json | 18 +- .../beaconReceivedRequestSummary.json | 44 +- .../sections/beaconResponseMeta.json | 34 +- .../responses/sections/beaconResultsets.json | 80 +- .../beaconSummaryResponseSection.json | 12 +- .../responses/beaconCollectionsResponse.yaml | 16 +- .../pgxBiosample.json | 250 +++--- .../pgxCallset.json | 286 +++---- .../pgxCollation.json | 218 ++--- .../pgxIndividual.json | 96 +-- .../pgxVariant.json | 108 +-- .../analyses/defaultSchema.json | 74 +- .../progenetix-model/analyses/endpoints.json | 264 +++--- .../examples/analyses-MAX-example.json | 8 +- .../examples/analyses-MIN-example.json | 2 +- .../progenetix-model/beaconConfiguration.json | 218 ++--- .../json/progenetix-model/beaconMap.json | 184 ++-- .../biosamples/defaultSchema.json | 200 ++--- .../biosamples/endpoints.json | 364 ++++---- .../examples/biosample-MID-example.json | 12 +- .../examples/biosample-MIN-example.json | 2 +- .../cohorts/defaultSchema.json | 446 +++++----- .../progenetix-model/cohorts/endpoints.json | 406 ++++----- .../cohorts/examples/cohorts-MAX-example.json | 100 +-- .../cohorts/examples/cohorts-MID-example.json | 52 +- .../cohorts/examples/cohorts-MIN-example.json | 4 +- .../progenetix-model/common/GeoLocation.json | 90 +- .../progenetix-model/common/VRSallele.json | 190 ++--- .../common/VRScopyNumberChange.json | 176 ++-- .../json/progenetix-model/common/age.json | 10 +- .../progenetix-model/common/ageRange.json | 18 +- .../progenetix-model/common/ancestry.json | 22 +- .../progenetix-model/common/celllineInfo.json | 32 +- .../common/commonDefinitions.json | 104 +-- .../progenetix-model/common/complexValue.json | 44 +- .../common/dataUseConditions.json | 58 +- .../json/progenetix-model/common/disease.json | 76 +- .../progenetix-model/common/doseInterval.json | 22 +- .../progenetix-model/common/evidence.json | 10 +- .../progenetix-model/common/exposure.json | 42 +- .../common/externalReference.json | 24 +- .../json/progenetix-model/common/file.json | 48 +- .../common/gestationalAge.json | 28 +- .../progenetix-model/common/measurement.json | 34 +- .../progenetix-model/common/metaData.json | 26 +- .../progenetix-model/common/ontologyTerm.json | 16 +- .../progenetix-model/common/pedigree.json | 150 ++-- .../common/phenotypicFeature.json | 56 +- .../progenetix-model/common/procedure.json | 52 +- .../progenetix-model/common/provenance.json | 12 +- .../progenetix-model/common/quantity.json | 16 +- .../common/referenceRange.json | 34 +- .../progenetix-model/common/resource.json | 34 +- .../progenetix-model/common/timeElement.json | 8 +- .../progenetix-model/common/timeInterval.json | 18 +- .../progenetix-model/common/treatment.json | 56 +- .../json/progenetix-model/common/update.json | 14 +- .../json/progenetix-model/common/value.json | 6 +- .../progenetix-model/common/vitalStatus.json | 44 +- .../datasets/defaultSchema.json | 72 +- .../progenetix-model/datasets/endpoints.json | 528 ++++++------ .../examples/dataset-Max-example.json | 18 +- .../json/progenetix-model/endpoints.json | 294 +++---- .../genomicVariations/defaultSchema.json | 800 +++++++++--------- .../genomicVariations/endpoints.json | 502 +++++------ .../examples/genomicVariant-MID-example.json | 140 +-- .../genomicVariant-MIN-VRS-example.json | 26 +- .../examples/genomicVariant-MIN-example.json | 18 +- .../genomicVariations/requestParameters.json | 126 +-- .../requestParametersComponents.json | 26 +- .../individuals/defaultSchema.json | 204 ++--- .../individuals/endpoints.json | 404 ++++----- .../examples/individual-MID-example.json | 40 +- .../individual-with-pedigree-MID-example.json | 58 +- .../examples/pedigree-example.json | 22 +- .../phenopackets/defaultSchema.json | 60 +- .../phenopackets/endpoints.json | 404 ++++----- .../progenetix-model/runs/defaultSchema.json | 90 +- .../json/progenetix-model/runs/endpoints.json | 342 ++++---- .../runs/examples/runs-MAX-example.json | 10 +- .../runs/examples/runs-MIN-example.json | 2 +- .../progenetix-service-schemas/Collation.json | 166 ++-- .../IntervalFrequencies.json | 36 +- .../IntervalFrequencyItem.json | 72 +- .../OntologyClass.json | 22 +- .../OntologyClassGroup.json | 10 +- .../Progenetix.json | 42 +- .../ProgenetixGene.json | 148 ++-- .../Provenance.json | 14 +- .../Publication.json | 176 ++-- .../PublicationSampleCounts.json | 38 +- .../QueryBufferItem.json | 58 +- .../cytobandMapping.json | 8 +- docs/changes.md | 14 + setup.py | 2 +- 200 files changed, 6951 insertions(+), 7588 deletions(-) delete mode 100644 bycon/config/argument_definitions (conflicted copy 2024-01-18 173140).yaml diff --git a/bycon/__init__.py b/bycon/__init__.py index 6884c1cba..432529de9 100644 --- a/bycon/__init__.py +++ b/bycon/__init__.py @@ -29,11 +29,12 @@ from parse_variant_request import * byc: object = { + "args": {}, + "form_data": {}, "pkg_path": pkg_path, "bycon_lib_path": bycon_lib_path, "parsed_config_paths": [], - "env": "server", - "mongohost": environ.get("BYCON_MONGO_HOST", "localhost") + "env": "server" } if not environ.get('HTTP_HOST'): byc.update({"env": "local"}) diff --git a/bycon/beaconServer/beacon.py b/bycon/beaconServer/beacon.py index dfc40b348..d9d444b10 100755 --- a/bycon/beaconServer/beacon.py +++ b/bycon/beaconServer/beacon.py @@ -55,7 +55,6 @@ def beacon(): byc.update({"request_path_root": "beacon"}) rest_path_elements(byc) - get_bycon_args(byc) args_update_form(byc) prdbug(f'beacon.py - request_entity_path_id: {byc.get("request_entity_path_id")}', byc.get("debug_mode")) @@ -99,19 +98,11 @@ def beacon(): exit() - # TODO: replace with proper error response object - byc.update({ - "service_response": {}, - "error_response": { - "error": { - "error_code": 422, - "error_message": "No correct service path provided. Please refer to the documentation at http://docs.progenetix.org" - } - } - }) - - cgi_print_response(byc, 422) - + e_m = "No correct service path provided. Please refer to the documentation at http://docs.progenetix.org" + e_r = BeaconErrorResponse(byc).error(e_m, 422) + print_json_response(e_r, byc["env"]) + + ################################################################################ ################################################################################ diff --git a/bycon/beaconServer/cohorts.py b/bycon/beaconServer/cohorts.py index f1d5f8ba9..4d2309859 100755 --- a/bycon/beaconServer/cohorts.py +++ b/bycon/beaconServer/cohorts.py @@ -24,16 +24,11 @@ def main(): ################################################################################ def cohorts(): - initialize_bycon_service(byc, "cohorts") run_beacon_init_stack(byc) - r = BeaconDataResponse(byc) - byc.update({ - "service_response": r.collectionsResponse(), - "error_response": r.errorResponse() - }) + r = BeaconDataResponse(byc).collectionsResponse() + print_json_response(r, byc["env"]) - cgi_print_response( byc, 200 ) ################################################################################ ################################################################################ diff --git a/bycon/beaconServer/configuration.py b/bycon/beaconServer/configuration.py index c4129b8d1..6b54297d0 100755 --- a/bycon/beaconServer/configuration.py +++ b/bycon/beaconServer/configuration.py @@ -20,14 +20,9 @@ def configuration(): initialize_bycon_service(byc, "configuration") r = BeaconInfoResponse(byc) c_f = get_schema_file_path(byc, "beaconConfiguration") - c = load_yaml_empty_fallback( c_f ) + c = load_yaml_empty_fallback(c_f) + print_json_response(r.populatedInfoResponse(c), byc["env"]) - byc.update({ - "service_response": r.populatedInfoResponse(c), - "error_response": r.errorResponse() - }) - - cgi_print_response( byc, 200 ) ################################################################################ ################################################################################ diff --git a/bycon/beaconServer/datasets.py b/bycon/beaconServer/datasets.py index c96486b92..5e827e4e7 100755 --- a/bycon/beaconServer/datasets.py +++ b/bycon/beaconServer/datasets.py @@ -25,16 +25,10 @@ def main(): ################################################################################ def datasets(): - - initialize_bycon_service(byc) + initialize_bycon_service(byc, "datasets") run_beacon_init_stack(byc) r = BeaconDataResponse(byc) - byc.update({ - "service_response": r.collectionsResponse(), - "error_response": r.errorResponse() - }) - - cgi_print_response( byc, 200 ) + print_json_response(r.collectionsResponse(), byc["env"]) ################################################################################ diff --git a/bycon/beaconServer/entry_types.py b/bycon/beaconServer/entry_types.py index 3d63c5304..fbb9b05fc 100644 --- a/bycon/beaconServer/entry_types.py +++ b/bycon/beaconServer/entry_types.py @@ -26,13 +26,7 @@ def entry_types(): r = BeaconInfoResponse(byc) e_f = get_schema_file_path(byc, "beaconConfiguration") e_t_s = load_yaml_empty_fallback( e_f ) - - byc.update({ - "service_response": r.populatedInfoResponse({"entry_types": e_t_s["entryTypes"] }), - "error_response": r.errorResponse() - }) - - cgi_print_response( byc, 200 ) + print_json_response(r.populatedInfoResponse({"entry_types": e_t_s["entryTypes"] }), byc["env"]) ################################################################################ diff --git a/bycon/beaconServer/filtering_terms.py b/bycon/beaconServer/filtering_terms.py index 1accff8e3..3485019bf 100755 --- a/bycon/beaconServer/filtering_terms.py +++ b/bycon/beaconServer/filtering_terms.py @@ -26,15 +26,8 @@ def main(): def filtering_terms(): initialize_bycon_service(byc, "filtering_terms") run_beacon_init_stack(byc) - r = BeaconDataResponse(byc) - - byc.update({ - "service_response": r.filteringTermsResponse(), - "error_response": r.errorResponse() - }) - - cgi_print_response( byc, 200 ) + print_json_response(r.filteringTermsResponse(), byc["env"]) ################################################################################ diff --git a/bycon/beaconServer/info.py b/bycon/beaconServer/info.py index e7989a271..df8edb698 100755 --- a/bycon/beaconServer/info.py +++ b/bycon/beaconServer/info.py @@ -34,10 +34,7 @@ def info(): if k in pgx_info: beacon_info.update({k:pgx_info[k]}) - byc.update({ - "service_response": r.populatedInfoResponse(beacon_info), - "error_response": r.errorResponse() - }) + response = r.populatedInfoResponse(beacon_info) # TODO: All the schemas really only here? beacon_schemas = [] @@ -46,9 +43,9 @@ def info(): if e_d.get("is_entry_type", True) is True: beacon_schemas.append(b_s) - byc["service_response"]["meta"].update( { "returned_schemas": beacon_schemas } ) + response.update( { "returned_schemas": beacon_schemas } ) + print_json_response(response, byc["env"]) - cgi_print_response( byc, 200 ) ################################################################################ ################################################################################ diff --git a/bycon/beaconServer/map.py b/bycon/beaconServer/map.py index 939a1890b..f763d0b70 100755 --- a/bycon/beaconServer/map.py +++ b/bycon/beaconServer/map.py @@ -25,13 +25,8 @@ def map(): r = BeaconInfoResponse(byc) m_f = get_schema_file_path(byc, "beaconMap") beaconMap = load_yaml_empty_fallback( m_f ) + print_json_response(r.populatedInfoResponse(beaconMap), byc["env"]) - byc.update({ - "service_response": r.populatedInfoResponse(beaconMap), - "error_response": r.errorResponse() - }) - - cgi_print_response( byc, 200 ) ################################################################################ ################################################################################ diff --git a/bycon/beaconServer/service_info.py b/bycon/beaconServer/service_info.py index 2d2366a9d..c2581f7b4 100755 --- a/bycon/beaconServer/service_info.py +++ b/bycon/beaconServer/service_info.py @@ -28,12 +28,12 @@ def service_info(): defs = byc.get("beacon_defaults", {}) b_e_d = defs.get("entity_defaults", {}) pgx_info = b_e_d.get("info", {}) + c = pgx_info.get("content", {}) info = object_instance_from_schema_name(byc, "ga4gh-service-info-1-0-0-schema", "") - for k in info.keys(): - if k in pgx_info: - info.update({k:pgx_info[k]}) - print_json_response( info, byc["env"], 200 ) + if k in c: + info.update({k:c[k]}) + print_json_response(info, byc["env"]) ################################################################################ ################################################################################ diff --git a/bycon/beaconServer/tests/PUT-biosamples-from-NCIT-filters-no-descendants.json b/bycon/beaconServer/tests/PUT-biosamples-from-NCIT-filters-no-descendants.json index 2d2c40bf0..bfff2671f 100644 --- a/bycon/beaconServer/tests/PUT-biosamples-from-NCIT-filters-no-descendants.json +++ b/bycon/beaconServer/tests/PUT-biosamples-from-NCIT-filters-no-descendants.json @@ -15,16 +15,16 @@ "datasetIds": ["progenetix"] } }, + "filters": [ + { "id": "NCIT:C102872", "scope": "analyses", "includeDescendantTerms": false } + ], "filterLogic": "OR" }, "pagination": { "skip": 0, "limit": 10 }, - "filters": [ - { "id": "NCIT:C102872", "scope": "analyses", "includeDescendantTerms": false } - ], "includeResultsetResponses": "HIT", "requestedGranularity": "count", - "debug": 0 + "debugMode": 0 } diff --git a/bycon/beaconServer/tests/PUT-biosamples-from-NCIT-filters.json b/bycon/beaconServer/tests/PUT-biosamples-from-NCIT-filters.json index 8cc4e59e3..9d9f11ec6 100644 --- a/bycon/beaconServer/tests/PUT-biosamples-from-NCIT-filters.json +++ b/bycon/beaconServer/tests/PUT-biosamples-from-NCIT-filters.json @@ -15,18 +15,18 @@ "datasetIds": ["progenetix"] } }, + "filters": [ + { "id": "NCIT:C4536", "scope": "biosamples", "includeDescendantTerms": false }, + { "id": "NCIT:C95597", "scope": "biosamples", "includeDescendantTerms": false }, + { "id": "NCIT:C7712", "scope": "biosamples", "includeDescendantTerms": false } + ], "filterLogic": "OR" }, "pagination": { "skip": 0, "limit": 10 }, - "filters": [ - { "id": "NCIT:C4536", "scope": "biosamples", "includeDescendantTerms": false }, - { "id": "NCIT:C95597", "scope": "biosamples", "includeDescendantTerms": false }, - { "id": "NCIT:C7712", "scope": "biosamples", "includeDescendantTerms": false } - ], "includeResultsetResponses": "HIT", "requestedGranularity": "record", - "debug": 0 + "debugMode": 0 } diff --git a/bycon/beaconServer/tests/PUT-core-from-NCIT-filters.json b/bycon/beaconServer/tests/PUT-core-from-NCIT-filters.json index 75a7699a8..4739e4e0b 100644 --- a/bycon/beaconServer/tests/PUT-core-from-NCIT-filters.json +++ b/bycon/beaconServer/tests/PUT-core-from-NCIT-filters.json @@ -12,12 +12,12 @@ "datasetIds": ["progenetix"] } }, + "filters": [ + { "id": "NCIT:C4536" }, + { "id": "NCIT:C95597" }, + { "id": "NCIT:C7712" } + ], "filterLogic": "OR" }, - "filters": [ - { "id": "NCIT:C4536" }, - { "id": "NCIT:C95597" }, - { "id": "NCIT:C7712" } - ], - "debug": 1 + "debugMode": 1 } diff --git a/bycon/beaconServer/tests/PUT-individuals-from-NCIT-filters.json b/bycon/beaconServer/tests/PUT-individuals-from-NCIT-filters.json index c07bee45d..7e873355f 100644 --- a/bycon/beaconServer/tests/PUT-individuals-from-NCIT-filters.json +++ b/bycon/beaconServer/tests/PUT-individuals-from-NCIT-filters.json @@ -12,12 +12,7 @@ "datasetIds": ["progenetix"] } }, - "filterLogic": "OR" + "filters": [{ "id": "NCIT:C4536" }] }, - "filters": [ - { "id": "NCIT:C4536" }, - { "id": "NCIT:C95597" }, - { "id": "NCIT:C7712" } - ], - "debug": 0 + "debugMode": 0 } diff --git a/bycon/beaconServer/tests/PUT-phenopackets-from-NCIT-filters.json b/bycon/beaconServer/tests/PUT-phenopackets-from-NCIT-filters.json index de83dd479..501986322 100644 --- a/bycon/beaconServer/tests/PUT-phenopackets-from-NCIT-filters.json +++ b/bycon/beaconServer/tests/PUT-phenopackets-from-NCIT-filters.json @@ -15,16 +15,13 @@ "datasetIds": ["progenetix"] } }, - "filterLogic": "OR" + "filters": [ + { "id": "NCIT:C4536" }, + ] }, "pagination": { "skip": 0, "limit": 10 }, - "filters": [ - { "id": "NCIT:C4536" }, - { "id": "NCIT:C95597" }, - { "id": "NCIT:C7712" } - ], - "debug": 1 + "debugMode": 1 } diff --git a/bycon/beaconServer/tests/PUT-variants-for-CDKN2A-DEL-gliomas.json b/bycon/beaconServer/tests/PUT-variants-for-CDKN2A-DEL-gliomas.json index 7c0193b97..af788fb86 100644 --- a/bycon/beaconServer/tests/PUT-variants-for-CDKN2A-DEL-gliomas.json +++ b/bycon/beaconServer/tests/PUT-variants-for-CDKN2A-DEL-gliomas.json @@ -21,14 +21,14 @@ "end": [21967753, 22500000], "variantType": "DEL" } - } + }, + "filters": [ + { "id": "NCIT:C3058" } + ], }, "pagination": { "skip": 0, "limit": 5 }, - "filters": [ - { "id": "NCIT:C3058" } - ], - "debug": 0 + "debugMode": 0 } diff --git a/bycon/beaconServer/tests/PUT-variants-for-biosampleIds.json b/bycon/beaconServer/tests/PUT-variants-for-biosampleIds.json index 85031c81b..afa09491c 100644 --- a/bycon/beaconServer/tests/PUT-variants-for-biosampleIds.json +++ b/bycon/beaconServer/tests/PUT-variants-for-biosampleIds.json @@ -19,8 +19,8 @@ "pgxbs-kftvhaqa", "pgxbs-kftvj1nt" ] - } + }, + "filters": [ ] }, - "filters": [ ], - "debug": 0 + "debugMode": 0 } diff --git a/bycon/beaconServer/tests/PUT-variants-for-specific-alt-bases.json b/bycon/beaconServer/tests/PUT-variants-for-specific-alt-bases.json index b3c8cbe0a..03e910329 100644 --- a/bycon/beaconServer/tests/PUT-variants-for-specific-alt-bases.json +++ b/bycon/beaconServer/tests/PUT-variants-for-specific-alt-bases.json @@ -14,16 +14,19 @@ "datasets": { "datasetIds": ["progenetix"] }, - "referenceName": "NC_000017.11", - "start": [7577120], - "referenceBases": "G", - "alternateBases": "A" - } + "g_variant": { + "referenceName": "refseq:NC_000017.11", + "start": [7577120], + "referenceBases": "G", + "alternateBases": "A" + } + }, + "filters": [] }, "requestedGranularity": "record", "pagination": { "skip": 0, "limit": 5 }, - "filters": [] + "debugMode": true } diff --git a/bycon/beaconServer/tests/terminal-examples.md b/bycon/beaconServer/tests/terminal-examples.md index aad4cc21e..a7114adda 100644 --- a/bycon/beaconServer/tests/terminal-examples.md +++ b/bycon/beaconServer/tests/terminal-examples.md @@ -1,32 +1,5 @@ # Command line tests ``` -./beaconServer/beacon.py --filters "pgx:icdom-81703" --requestedSchema biosample --referenceName 9 --start 10000000,12000000 --end 12500000,15000000 --variantType DEL -``` - -``` -./beaconServer/beacon.py --requestedSchema genomicVariant --referenceName 9 --start 10000000,12000000 --end 12500000,15000000 --variantType DEL --output pgxseg > ~/Desktop/test.pgxseg -``` - -``` -./beaconServer/beacon.py --filters "pgx:icdom-81703" --requestedSchema analysis --referenceName 9 --start 10000000,12000000 --end 12500000,15000000 --variantType DEL --output pgxmatrix > ~/Desktop/test.pgxmatrix -``` - -``` -./beaconServer/beacon.py --filters "NCIT:C3058" --output pgxmatrix > ~/Desktop/NCIT_C3058.pgxmatrix -``` - -``` -./services/cytomapper.py --cytoBands 8q24 -./services/cytomapper.py --chroBases "9:0-50000000" -``` - -``` -./services/genespans.py --geneId TP53 -./services/genespans.py --geneId TP53 --filterPrecision start -``` - -``` -./services/geolocations.py --city Heidel -./services/geolocations.py --geoDistance 20000 --geoLatitude 47.3 --geoLongitude 8.55 +curl --json @PUT-individuals-from-NCIT-filters.json "http://progenetix.org/beacon/individuals/" ``` \ No newline at end of file diff --git a/bycon/config/argument_definitions (conflicted copy 2024-01-18 173140).yaml b/bycon/config/argument_definitions (conflicted copy 2024-01-18 173140).yaml deleted file mode 100644 index 0532e8e9b..000000000 --- a/bycon/config/argument_definitions (conflicted copy 2024-01-18 173140).yaml +++ /dev/null @@ -1,513 +0,0 @@ -# The file defines the command line arguments accepted by the bycon package. -# While the `argDef` parameters contain the standard structure for the `argparse` -# module, they are wrapped in an additional object structure for package-specific -# information. Due to the `argparse` object structure it is assumed that the -# `argDef` object only contains a single key (_i.e._ the parameter name). - -################################################################################ -# standard Beacon parameters -################################################################################ - -# TODO: temporary for auth testing - -user_name: - type: string - pattern: '^\w+$' - cmdFlags: - - --userName - description: faking a user name - -# procedural - -test_mode: - type: string - cmdFlags: - - -t - - --testMode - description: test setting, i.e. returning some random documents - -limit: - type: integer - cmdFlags: - - -l - - --limit - description: limit number of documents; a value of 0 sets to unlimited - -requested_granularity: - type: string - pattern: '^\w+$' - description: >- - The response granularity of the beacon; for "secure" Beacons the default - should be overridden in local definitions (e.g. as "boolean") - cmdFlags: - - --requestedGranularity - description: The requested granularity of the beacon - -request_entity_path_id: - type: string - cmdFlags: - - --requestEntityPathId - description: required data entry point, equal to the first REST path element in Beacon - -requested_schema: - type: string - cmdFlags: - - --requestedSchema - description: requested schema, e.g. biosample - -include_resultset_responses: - type: string - cmdFlags: - - --includeResultsetResponses - description: requested schema, e.g. biosample - -# query / data selection - -dataset_ids: - type: array - items: string - cmdFlags: - - -d - - --datasetIds - description: dataset ids - -filters: - type: array - items: string - cmdFlags: - - --filters - description: prefixed filter values, comma concatenated - -filter_precision: - type: string - cmdFlags: - - --filterPrecision - description: "`either` start or `exact` (`exact being internal default`) for matching filter values" - -# ------------------------------------------------------------------------------ -# variant parameters -# ------------------------------------------------------------------------------ - -assembly_id: - type: string - pattern: '^\w+?[\w\-\.]*?\w*?$' - db_key: assembly_id - cmdFlags: - - --assemblyId - description: assembly id - -reference_name: - type: string - db_key: location.sequence_id - pattern: '^\w+.*?\w?$' - cmdFlags: - - --referenceName - description: chromosome - -mate_name: - type: string - db_key: location.sequence_id - pattern: '^\w+.*?\w?$' - cmdFlags: - - --mateName - description: chromosome - -reference_bases: - type: string - db_key: reference_sequence - pattern: '^[ACGTN]+$' - cmdFlags: - - --referenceBases - description: reference bases - -alternate_bases: - type: string - db_key: sequence - pattern: '^[ACGTN]+$' - cmdFlags: - - --alternateBases - description: alternate bases - -variant_type: - type: string - db_key: variant_state.id - pattern: '^\w+[\w \-\:]\w+?$' - cmdFlags: - - --variantType - description: variant type, e.g. DUP - -start: - type: array - db_key: location.start - items: - type: integer - pattern: '^\d+?$' - cmdFlags: - - --start - description: genomic start position - -end: - type: array - db_key: location.end - items: - type: integer - pattern: '^\d+?$' - cmdFlags: - - --end - description: genomic end position - -variant_min_length: - type: integer - db_key: info.var_length - pattern: '^\d+?$' - cmdFlags: - - --variantMinLength - description: 'variantMinLength: The minimal variant length in bases for e.g. CNV queries.' - -variant_max_length: - type: integer - db_key: info.var_length - pattern: '^\d+?$' - cmdFlags: - - --variantMaxLength - description: 'variantMaxLength: The maximum variant length in bases for e.g. CNV queries.' - -gene_id: - type: string - db_key: Null - pattern: '^\w+?(\w+?(\-\w+?)?)?$' - cmdFlags: - - --geneId - description: gene id - -aminoacid_change: - type: string - db_key: molecular_attributes.aminoacid_changes - pattern: '^\w+?$' - examples: - - V600E - - M734V - - G244A - cmdFlags: - - --aminoacidChange - description: 'Aminoacid alteration in 1 letter format' - -genomic_allele_short_form: - type: string - db_key: identifiers.genomicHGVS_id - pattern: '^\w+.*\w$' - examples: - - NC_000017.11:g.7674232C>G - cmdFlags: - - --genomicAlleleShortForm - description: 'Genomic HGVSId descriptor' - -# ------------------------------------------------------------------------------ -# variant parameters - non-standard -# ------------------------------------------------------------------------------ - -variant_internal_id: - type: string - db_key: variant_internal_id - pattern: '^\w[\w\:\-\,]+?\w$' - examples: - - '11:52900000-134452384:EFO_0030067' - cmdFlags: - - --variantInternalId - description: 'An id value used for all variant instances of the same composition; a kind of `digest`' - -################################################################################ -# non-standard parameters -################################################################################ - -accessid: - type: string - db_key: id - pattern: '^\w[\w\-]+?\w$' - examples: - - 'b59857bc-0c4a-4ac8-804b-6596c6566494' - cmdFlags: - - --accessid - description: 'An accessid; this parameter only makes sense for retrieving handovers etc.' - -id: - type: string - db_key: id - pattern: '^\w[\w\:\-\,]+?\w$' - examples: - - 'pgxvar-5bab576a727983b2e00b8d32' - - 'pgxind-kftx25eh' - cmdFlags: - - --id - description: 'An id; this parameter only makes sense for specific REST entry types' - -ids: - type: array - items: string - cmdFlags: - - --ids - description: 'One or more ids; this parameter only makes sense for specific REST entry types' - -biosample_ids: - type: array - items: string - cmdFlags: - - --biosampleIds - description: biosample ids - -analysis_ids: - type: array - items: string - cmdFlags: - - --analysisIds - description: callset / analysis ids - -callset_ids: - type: array - items: string - cmdFlags: - - --callsetIds - description: callset / analysis ids - -individual_ids: - type: array - items: string - cmdFlags: - - --individualIds - description: subject ids - -variant_ids: - type: array - items: string - cmdFlags: - - --variantIds - description: variant ids - -# ------------------------------------------------------------------------------ -# technical / procedural - non-standard -# ------------------------------------------------------------------------------ - -debug_mode: - type: boolean - cmdFlags: - - --debugMode - description: debug setting - -test_mode_count: - type: integer - cmdFlags: - - --testModeCount - description: setting the number of documents reurned in test mode - default: 5 - -output: - type: string - cmdFlags: - - --output - description: >- - special output format; command line processing uses some predefined text as - standard, but options are e.g. json or pgxseg - -include_handovers: - type: boolean - default: false - cmdFlags: - - --includeHandovers - description: only used for web requests & testing - -only_handovers: - type: boolean - default: false - cmdFlags: - - --onlyHandovers - description: only used for web requests & testing - -method: - type: string - cmdFlags: - - --method - description: >- - special method - -group_by: - type: string - cmdFlags: - - -g - - --groupBy - description: >- - group parameter e.g. for subset splitting - default: text - -parse: - type: string - cmdFlags: - - -p - - --parse - description: input value to be parsed - -mode: - type: string - cmdFlags: - - -m - - --mode - description: mode, e.g. file type - -key: - type: string - cmdFlags: - - -k - - --key - description: some key or word - -update: - type: string - cmdFlags: - - -u - - --update - description: update existing records - -# file I/O -inputfile: - type: string - cmdFlags: - - -i - - --inputfile - description: a custom file to specify input data, usually tab-delimited with special header - -outputdir: - type: string - cmdFlags: - - --outputdir - description: output directory where supported (cmd line) - -outputfile: - type: string - cmdFlags: - - -o - - --outputfile - description: output file where supported (cmd line) - -randno: - type: integer - cmdFlags: - - -r - - --randno - description: random number to limit processing, where supported - default: 0 - -min_number: - type: integer - cmdFlags: - - --minNumber - description: minimal number, e.g. for collations, where supported - default: 0 - -source: - type: string - cmdFlags: - - -s - - --source - description: some source label, e.g. `callsets` - -query: - type: string - cmdFlags: - - -q - - --query - description: complete query string, e.g. `{"biosamples":{"external_references.id":"geo:GSE7428"}}` - -delivery_keys: - type: array - items: string - cmdFlags: - - --deliveryKeys - description: delivery keys - -collation_types: - type: array - items: string - cmdFlags: - - --collationTypes - description: selected collation types, e.g. "EFO" - -with_samples: - type: integer - cmdFlags: - - --withSamples - description: only for the collations; number of code_matches... - -selected_beacons: - type: array - items: string - -# ------------------------------------------------------------------------------ -# genomic parameters -# ------------------------------------------------------------------------------ - -genome_binning: - type: string - cmdFlags: - - --genomeBinning - description: "one of the predefined genome binning keys - default 1Mb" - -cyto_bands: - type: string - db_key: Null - pattern: ^(?:chro?)?([12]?[\dXY])([pq](?:(?:ter)|(?:cen)|(?:[1-4](?:\d(?:\.\d\d*?)?)?)?))?\-?([pq](?:(?:cen)|(?:ter)|(?:[1-4](?:\d(?:\.\d\d*?)?)?)?))?$ - cmdFlags: - - --cytoBands - description: cytobands, e.g. 8q21q24.1 - -chro_bases: - type: string - db_key: Null - pattern: ^(chro?)?([12]?[\dXY])\:(\d+?)(\-(\d+?))?$ - cmdFlags: - - --chroBases - description: only for the cytoband converter ... e.g. 8:0-120000000 - - -################################################################################ -# geographic ... -################################################################################ - -city: - type: string - cmdFlags: - - -c - - --city - description: only for the geolocations... - -geo_latitude: - type: number - cmdFlags: - - --geoLatitude - description: only for the geolocations... - -geo_longitude: - type: number - cmdFlags: - - --geoLongitude - description: only for the geolocations... - -geo_distance: - type: integer - cmdFlags: - - --geoDistance - description: only for the geolocations... - -################################################################################ -# plot ... -################################################################################ - -plot_pars: - type: string - cmdFlags: - - --plotPars - description: plot parameters in form `par=value` concatenated by `::` - -plot_type: - type: string - cmdFlags: - - --plotType - description: plot type (histoplot, samplesplot, arrayplot - more?) \ No newline at end of file diff --git a/bycon/config/argument_definitions.yaml b/bycon/config/argument_definitions.yaml index 94b518886..1ee0aace4 100644 --- a/bycon/config/argument_definitions.yaml +++ b/bycon/config/argument_definitions.yaml @@ -25,6 +25,7 @@ test_mode: - -t - --testMode description: test setting, i.e. returning some random documents + default: false limit: type: integer @@ -83,6 +84,21 @@ filter_precision: cmdFlags: - --filterPrecision description: "`either` start or `exact` (`exact being internal default`) for matching filter values" + default: exact + +filter_logic: + type: string + cmdFlags: + - --filterLogic + description: either OR or AND (translated to the MongoDB $and etc.) + default: AND + +include_descendant_terms: + type: boolean + cmdFlags: + - --includeDescendantTerms + description: global treatment of descendant terms + default: true # ------------------------------------------------------------------------------ # variant parameters @@ -95,6 +111,7 @@ assembly_id: cmdFlags: - --assemblyId description: assembly id + default: GRCh38 reference_name: type: string @@ -327,7 +344,8 @@ method: cmdFlags: - --method description: >- - special method + special method + default: null group_by: type: string @@ -335,7 +353,7 @@ group_by: - -g - --groupBy description: >- - group parameter e.g. for subset splitting + group parameter e.g. for subset splitting default: text parse: diff --git a/bycon/config/beacon_defaults.yaml b/bycon/config/beacon_defaults.yaml index 1d9b9fc84..cb35a0b17 100644 --- a/bycon/config/beacon_defaults.yaml +++ b/bycon/config/beacon_defaults.yaml @@ -18,10 +18,6 @@ defaults: beacon_schema: entity_type: info schema: https://progenetix.org/services/schemas/beaconInfoResults/ - filter_flags: - logic: $and - precision: exact - include_descendant_terms: true ################################################################################ # mappings and aliases ######################################################### diff --git a/bycon/config/config.yaml b/bycon/config/config.yaml index 1d850cdf3..a2fc4958d 100644 --- a/bycon/config/config.yaml +++ b/bycon/config/config.yaml @@ -1,10 +1,8 @@ -args: {} debug_mode: false empty_query_all_count: false error_response: {} errors: [] filters: [] -form_data: {} granularity_levels: none: 0 boolean: 1 @@ -14,7 +12,7 @@ pagination: skip: 0 limit: 250 include_handovers: false -method: '' +# method: '' output: '' queries: {} query_meta: {} @@ -33,10 +31,6 @@ response_entity: schema: https://progenetix.org/services/schemas/genomicVariant/ service_response: {} service_config: {} -test_mode: false -test_mode_count: 5 - -filtering_terms_coll: collations genomes_path: - rsrc @@ -49,12 +43,14 @@ schemas_path: # MongoDB configs ################################################################################ -# special database, auto-generated ###### -housekeeping_db: _byconHousekeepingDB -beacon_info_coll: beaconinfo -handover_coll: querybuffer +db_config: + host: localhost + # special database, auto-generated ###### + housekeeping_db: _byconHousekeepingDB + beacon_info_coll: beaconinfo + handover_coll: querybuffer -# special support database ############## -services_db: _byconServicesDB -genes_coll: genes -geolocs_coll: geolocs + # special support database ############## + services_db: _byconServicesDB + genes_coll: genes + geolocs_coll: geolocs diff --git a/bycon/config/datatable_mappings.yaml b/bycon/config/datatable_mappings.yaml index 0899b0f2e..76227df8f 100644 --- a/bycon/config/datatable_mappings.yaml +++ b/bycon/config/datatable_mappings.yaml @@ -45,6 +45,17 @@ definitions: db_key: label beacon_key: False compact: True + biosample_legacy_id: + description: >- + The legacy identifier for the biosample, which is an identifier + used during import, e.g. the id used in the donor publication or study. + It is *not* considered unique in the database but just used during + import the stage when generating the unique `id` values. + type: string + db_key: info.import_legacy_id + beacon_key: False + indexed: False + compact: False individual_id: type: string db_key: individual_id @@ -273,6 +284,17 @@ definitions: db_key: id indexed: True compact: True + individual_legacy_id: + description: >- + The legacy identifier for the individual, which is an identifier + used during import, e.g. the id used in the donor publication or study. + It is *not* considered unique in the database but just used during + import the stage when generating the unique `id` values. + type: string + db_key: info.import_legacy_id + beacon_key: False + indexed: False + compact: False legacy_ids: type: array items: string @@ -381,6 +403,15 @@ definitions: individual_id: db_key: individual_id indexed: True + analysis_legacy_id: + description: >- + The legacy identifier for the experiment, which is an identifier + used during import, e.g. the id used in the donor publication or study. + type: string + db_key: info.import_legacy_id + beacon_key: False + indexed: False + compact: False legacy_ids: db_key: info.legacy_ids type: array diff --git a/bycon/config/filter_definitions.yaml b/bycon/config/filter_definitions.yaml index ed4f3bb2c..fb75e10c0 100644 --- a/bycon/config/filter_definitions.yaml +++ b/bycon/config/filter_definitions.yaml @@ -266,7 +266,7 @@ GEOseries: replace: - "geo:" - "" - pattern: '^(?:geo:)?GSE\d+?$' + pattern: '^geo:GSE\d+?$' scope: analyses entity: analysis db_key: 'analysis_info.series_id' @@ -287,7 +287,7 @@ GenomePlatforms: replace: - "geo:" - "" - pattern: '^(?:EFO:)|(?:(?:geo:)?GPL)|(?:(?:arrayexpress:)?)[\w\-]+?$' + pattern: '^(?:EFO:)|(?:geo:GPL)|(?:arrayexpress:E)[\w\-]+?$' scope: analyses entity: analysis db_key: 'platform_model.id' diff --git a/bycon/lib/args_parsing.py b/bycon/lib/args_parsing.py index daf0b95d5..b7c9256fc 100644 --- a/bycon/lib/args_parsing.py +++ b/bycon/lib/args_parsing.py @@ -1,43 +1,9 @@ -import argparse -import re +import argparse, re + from humps import camelize, decamelize from bycon_helpers import prdbug -################################################################################ - -def get_bycon_args(byc): - if byc.get("check_args", True) is False: - return - - # Serves as "we've been here before" marker - before the env check. - byc.update({"check_args": False}) - - create_args_parser(byc) - - -################################################################################ - -def create_args_parser(byc): - if not "local" in byc.get("env", "server"): - return - - a_defs = byc.get("argument_definitions") - parser = argparse.ArgumentParser() - for a_n, a_d in a_defs.items(): - if "cmdFlags" in a_d: - argDef = { - "flags": a_d.get("cmdFlags"), - "help": a_d.get("description", "TBD"), - } - default = a_d.get("default") - if default: - argDef.update({"default": default}) - parser.add_argument(*argDef.pop("flags"), **argDef) - - byc.update({"args": parser.parse_args()}) - - ################################################################################ def args_update_form(byc): @@ -45,8 +11,13 @@ def args_update_form(byc): This function adds comand line arguments to the `byc["form_data"]` input parameter collection (in "local" context). """ - if not "args" in byc: + # Serves as "we've been here before" marker - before the env check. + if byc.get("check_args", True) is False: return + byc.update({"check_args": False}) + + create_args_parser(byc) + if not "local" in byc.get("env", "server"): return @@ -70,3 +41,26 @@ def args_update_form(byc): byc["form_data"].update({p_d: arg_vars[p]}) prdbug(f'{p}: {byc["form_data"][p_d]}', byc.get("debug_mode")) + +################################################################################ + +def create_args_parser(byc): + if not "local" in byc.get("env", "server"): + return + + a_defs = byc.get("argument_definitions") + parser = argparse.ArgumentParser() + for a_n, a_d in a_defs.items(): + if "cmdFlags" in a_d: + argDef = { + "flags": a_d.get("cmdFlags"), + "help": a_d.get("description", "TBD"), + } + default = a_d.get("default") + if default: + argDef.update({"default": default}) + parser.add_argument(*argDef.pop("flags"), **argDef) + + byc.update({"args": parser.parse_args()}) + + diff --git a/bycon/lib/beacon_response_generation.py b/bycon/lib/beacon_response_generation.py index 5c6323718..ed9ace818 100644 --- a/bycon/lib/beacon_response_generation.py +++ b/bycon/lib/beacon_response_generation.py @@ -13,6 +13,38 @@ from variant_mapping import ByconVariant from schema_parsing import object_instance_from_schema_name +################################################################################ + +class BeaconErrorResponse: + """ + This response class is used for all the info / map / configuration responses + which have the same type of `meta`. + The responses are then provided by the dedicated methods + """ + + def __init__(self, byc: dict): + self.debug_mode = byc.get("debug_mode", False) + self.beacon_defaults = byc.get("beacon_defaults", {}) + self.entity_defaults = self.beacon_defaults.get("entity_defaults", {"info":{}}) + self.service_config = byc.get("service_config", {}) + self.response_schema = byc.get("response_schema", "beaconInfoResponse") + self.beacon_schema = byc["response_entity"].get("beacon_schema", "___none___") + self.error_response = object_instance_from_schema_name(byc, "beaconErrorResponse", "") + info = self.entity_defaults["info"].get("content", {"api_version": "___none___"}) + r_m = self.error_response["meta"] + for p in ["api_version", "beacon_id"]: + if p in info.keys(): + r_m.update({p: info.get(p, "___none___")}) + + + # -------------------------------------------------------------------------# + + def error(self, error_message="", error_code=422): + self.error_response["error"].update({"error_code": error_code, "error_message": error_message}) + return self.error_response + + + ################################################################################ class BeaconInfoResponse: @@ -51,10 +83,17 @@ def populatedInfoResponse(self, response={}): return self.data_response - # -------------------------------------------------------------------------# + # ------------------------------- private ---------------------------------# + + def __meta_add_parameters(self, response): + info = self.entity_defaults["info"].get("content", {"api_version": "___none___"}) + r_m = response["meta"] + for p in ["api_version", "beacon_id"]: + if p in info.keys(): + r_m.update({p: info.get(p, "___none___")}) + if "returned_schemas" in r_m: + r_m.update({"returned_schemas":[self.beacon_schema]}) - def errorResponse(self): - return self.error_response ################################################################################ @@ -380,6 +419,7 @@ def __init__(self, byc: dict): self.debug_mode = byc.get("debug_mode", False) self.test_mode = byc.get("test_mode", False) self.env = byc.get("env", "server") + self.db_config = byc.get("db_config", {}) self.test_mode_count = byc.get("test_mode_count", 5) self.dataset_ids = byc.get("dataset_ids", []) self.beacon_defaults = byc.get("beacon_defaults", {}) @@ -444,11 +484,11 @@ def __return_filtering_terms(self): query = {"$and": q_list} if self.test_mode is True: - query, error = mongo_test_mode_query(self.dataset_ids[0], f_coll, self.test_mode_count) + query, error = mongo_test_mode_query(self.db_config, self.dataset_ids[0], f_coll, self.test_mode_count) for ds_id in self.dataset_ids: fields = {"_id": 0} - f_s, e = mongo_result_list(ds_id, f_coll, query, fields) + f_s, e = mongo_result_list(self.db_config, ds_id, f_coll, query, fields) t_f_t_s = [] for f in f_s: self.filter_collation_types.add(f.get("collation_type", None)) @@ -600,6 +640,7 @@ def __init__(self, byc: dict): self.debug_mode = byc.get("debug_mode", False) self.beacon_defaults = byc.get("beacon_defaults", {}) self.env = byc.get("env", "server") + self.db_config = byc.get("db_config", {}) self.entity_defaults = self.beacon_defaults.get("entity_defaults", {"info":{}}) self.datasets_results = dict() # the object with matched ids per dataset, per h_o self.datasets_data = dict() # the object with data of requested entity per dataset @@ -671,10 +712,13 @@ def __get_handover_access_key(self): # -------------------------------------------------------------------------# def __result_sets_save_handovers(self): + mdb_c = self.db_config + db_host = mdb_c.get("host", "localhost") + ho_dbname = mdb_c.get("housekeeping_db", "___none___") + ho_collname = mdb_c.get("handover_coll", "___none___") - ho_client = MongoClient(host=environ.get("BYCON_MONGO_HOST", "localhost")) - ho_db = ho_client[ self.byc["housekeeping_db"] ] - ho_coll = ho_db[ self.byc["handover_coll"] ] + ho_client = MongoClient(host=db_host) + ho_coll = ho_client[ho_dbname].ho_db[ho_collname] for ds_id, d_s in self.datasets_results.items(): if not d_s: @@ -790,12 +834,6 @@ def __retrieve_variants_data(self): v = v_coll.find_one({"_id":v_id}) r_s_res.append(v) self.datasets_data.update({ds_id: r_s_res}) - # elif "variants.variant_internal_id" in ds_results: - # for v_id in ds_results["variants.variant_internal_id"]["target_values"]: - # vs = v_coll.find({"variant_internal_id":v_id}) - # for v in vs: - # r_s_res.append(v) - # self.datasets_data.update({ds_id: r_s_res}) ds_v_duration = datetime.datetime.now() - ds_v_start @@ -842,138 +880,20 @@ def __populate_result_sets(self): # common response functions #################################################### ################################################################################ -def cgi_break_on_errors(byc): - if not "error_response" in byc: - return - e = byc["error_response"].get("error", {"error_code": 200}) - e_c = e.get("error_code", 200) - - if int(e_c) > 200: - cgi_print_response(byc, byc["error_response"]) - - -################################################################################ - -def cgi_print_response(byc, status_code): - r_f = "" - f_d = {} - - delint_response(byc) - - if "form_data" in byc: - f_d = byc["form_data"] - - if "responseFormat" in f_d: - r_f = f_d["responseFormat"] - - # This is a simple "de-jsonify", intended to be used for already - # pre-formatted list-like items (i.e. lists only containing objects) - # with simple key-value pairs) - # TODO: universal text table converter ... partially implemented - - if "text" in byc["output"]: - - r = byc["service_response"].get("response", "ERROR: No response element in error_response") - if "result_sets" in r: - r_s = r["result_sets"][0] - byc.update({"service_response": r_s.get("results", [])}) - else: - byc.update({"service_response": r}) - - if isinstance(byc["service_response"], dict): - # TODO: Find where this results/response ambiguity comes from - if "response" in byc["service_response"]: - resp = byc["service_response"]["response"] - elif "results" in byc["service_response"]: - resp = byc["service_response"]["results"] - else: - resp = byc["service_response"] - else: - resp = byc["service_response"] - if isinstance(resp, dict): - resp = json.dumps(camelize(resp), default=str) - else: - l_d = [] - for dp in resp: - v_l = [] - for v in dp.values(): - # print(v) - v_l.append(str(v)) - l_d.append("\t".join(v_l)) - resp = "\n".join(l_d) - - print_text_response(resp, byc["env"], status_code) - - if test_truthy(byc["form_data"].get("only_handovers", False)): - try: - if "result_sets" in byc["service_response"]["response"]: - for rs_i, rs in enumerate(byc["service_response"]["response"]["result_sets"]): - byc["service_response"]["response"]["result_sets"][rs_i].update({"results": []}) - except: - pass - - update_error_code_from_response_summary(byc) - switch_to_error_response(byc) - print_json_response(byc["service_response"], byc["env"]) - - -################################################################################ - -def update_error_code_from_response_summary(byc): - if not "response_summary" in byc["service_response"]: - return - - if not "exists" in byc["service_response"]["response_summary"]: - return - - -################################################################################ - -def switch_to_error_response(byc): - e_c = byc["error_response"]["error"].get("error_code", 200) - - if e_c == 200: - return - - if "meta" in byc["service_response"]: - byc["error_response"].update({"meta": byc["service_response"]["meta"]}) - byc["service_response"] = byc["error_response"] - - -################################################################################ - -def delint_response(byc): - - b_s_r = byc["service_response"] - - byc.update({"service_response": response_delete_none_values(b_s_r)}) - - try: - b_h_r = b_s_r.get("beacon_handovers", []) - if len(b_h_r) < 1: - byc["service_response"].pop("beacon_handovers", None) - if not "url" in b_h_r[0]: - byc["service_response"].pop("beacon_handovers", None) - except: - pass - - -################################################################################ - -def response_delete_none_values(response): - """Delete None values recursively from all of the dictionaries""" +# def response_delete_none_values(response): +# """Delete None values recursively from all of the dictionaries""" - for key, value in list(response.items()): - if isinstance(value, dict): - response_delete_none_values(value) - elif value is None: - del response[key] - elif isinstance(value, list): - for v_i in value: - if isinstance(v_i, dict): - response_delete_none_values(v_i) +# for key, value in list(response.items()): +# if isinstance(value, dict): +# response_delete_none_values(value) +# elif value is None: +# del response[key] +# elif isinstance(value, list): +# for v_i in value: +# if isinstance(v_i, dict): +# response_delete_none_values(v_i) - return response +# return response ################################################################################ @@ -984,7 +904,7 @@ def print_json_response(this={}, env="server", status_code=200): print('status:' + str(status_code)) print() - prjsoncam(this) + prjsoncam(this) # !!! There are some "do not camelize" exceptions downstream print() exit() diff --git a/bycon/lib/bycon_helpers.py b/bycon/lib/bycon_helpers.py index d76f69287..86105cad8 100644 --- a/bycon/lib/bycon_helpers.py +++ b/bycon/lib/bycon_helpers.py @@ -1,9 +1,67 @@ import base36, json, re, time + from isodate import parse_duration from humps import camelize, decamelize from os import environ from pymongo import MongoClient +################################################################################ + +def set_debug_state(debug=False) -> bool: + """ + Function to provide a text response header for debugging purposes, i.e. to + print out the error or test parameters to a browser session. + The common way would be to add either a `/debug=1/` part to a REST path or + to provide a `...&debug=1` query parameter. + """ + + if test_truthy(debug): + print('Content-Type: text') + print() + return True + + r_uri = environ.get('REQUEST_URI', "___none___") + if re.match(r'^.*?[?&/]debugMode?=(\w+?)\b.*?$', r_uri): + d = re.match(r'^.*?[?&/]debugMode?=(\w+?)\b.*?$', r_uri).group(2) + if test_truthy(d): + print('Content-Type: text') + print() + return True + + return False + + +################################################################################ + +def select_this_server(byc: dict) -> str: + """ + Cloudflare based encryption may lead to "http" based server addresses in the + URI, but then the browser ... will complain if the handover URLs won't use + encryption. OTOH for local testing one may need to stick w/ http if no pseudo- + https scenario had been implemented. Therefore handover addresses etc. will + always use https _unless_ the request comes from a host listed a test instance. + """ + + s_uri = str(environ.get('SCRIPT_URI')) + local_paths = byc.get("local_paths", {}) + test_sites = local_paths.get("test_domains", []) + https = "https://" + http = "http://" + + s = f'{https}{environ.get("HTTP_HOST")}' + for site in test_sites: + if site in s_uri: + if https in s_uri: + s = f'{https}{site}' + else: + s = f'{http}{site}' + + # TODO: ERROR hack for https/http mix, CORS... + # ... since cloudflare provides https mapping using this as fallback + + return s + + ################################################################################ def generate_id(prefix): @@ -77,11 +135,12 @@ def return_paginated_list(this, skip, limit): ################################################################################ -def mongo_result_list(db_name, coll_name, query, fields): +def mongo_result_list(db_config, db_name, coll_name, query, fields): results = [] - error = False + error = None - mongo_client = MongoClient(host=environ.get("BYCON_MONGO_HOST", "localhost")) + db_host = db_config.get("host", "localhost") + mongo_client = MongoClient(host=db_host) db_names = list(mongo_client.list_database_names()) if db_name not in db_names: return results, f"{db_name} db `{db_name}` does not exist" @@ -98,13 +157,14 @@ def mongo_result_list(db_name, coll_name, query, fields): ################################################################################ -def mongo_test_mode_query(db_name, coll_name, test_mode_count=5): +def mongo_test_mode_query(db_config, db_name, coll_name, test_mode_count=5): query = {} error = False ids = [] - mongo_client = MongoClient(host=environ.get("BYCON_MONGO_HOST", "localhost")) + db_host = db_config.get("host", "localhost") + mongo_client = MongoClient(host=db_host) db_names = list(mongo_client.list_database_names()) if db_name not in db_names: return results, f"{db_name} db `{db_name}` does not exist" @@ -229,7 +289,6 @@ def get_nested_value(parent, dotted_key, parameter_type="string"): def test_truthy(this): if str(this).lower() in ["1", "true", "y", "yes"]: return True - return False @@ -240,7 +299,6 @@ def decamelize_words(j_d): de_cams = ["gVariants", "gVariant", "sequenceId", "relativeCopyClass", "speciesId", "chromosomeLocation", "genomicLocation"] for d in de_cams: j_d = re.sub(r"\b{}\b".format(d), decamelize(d), j_d) - return j_d diff --git a/bycon/lib/cgi_parsing.py b/bycon/lib/cgi_parsing.py index 72fc4a6b4..8fb61cf8f 100644 --- a/bycon/lib/cgi_parsing.py +++ b/bycon/lib/cgi_parsing.py @@ -3,7 +3,7 @@ from urllib.parse import urlparse, parse_qs, unquote from os import environ -from bycon_helpers import prdbug, test_truthy +from bycon_helpers import prdbug, set_debug_state, test_truthy ################################################################################ @@ -23,63 +23,6 @@ def parse_query(byc): parse_GET(byc) -################################################################################ - -def set_debug_state(debug: int = 0) -> bool: - """ - Function to provide a text response header for debugging purposes, i.e. to - print out the error or test parameters to a browser session. - The common way would be to add either a `/debug=1/` part to a REST path or - to provide a `...&debug=1` query parameter. - """ - - if test_truthy(debug): - print('Content-Type: text') - print() - return True - - r_uri = environ.get('REQUEST_URI', "___none___") - if re.match(r'^.*?[?&/]debug(Mode)?=(\w+?)\b.*?$', r_uri): - d = re.match(r'^.*?[?&/]debug(Mode)?=(\w+?)\b.*?$', r_uri).group(2) - if test_truthy(d): - print('Content-Type: text') - print() - return True - - return False - - -################################################################################ - -def select_this_server(byc: dict) -> str: - """ - Cloudflare based encryption may lead to "http" based server addresses in the - URI, but then the browser ... will complain if the handover URLs won't use - encryption. OTOH for local testing one may need to stick w/ http if no pseudo- - https scenario had been implemented. Therefore handover addresses etc. will - always use https _unless_ the request comes from a host listed a test instance. - """ - - s_uri = str(environ.get('SCRIPT_URI')) - local_paths = byc.get("local_paths", {}) - test_sites = local_paths.get("test_domains", []) - https = "https://" - http = "http://" - - s = f'{https}{environ.get("HTTP_HOST")}' - for site in test_sites: - if site in s_uri: - if https in s_uri: - s = f'{https}{site}' - else: - s = f'{http}{site}' - - # TODO: ERROR hack for https/http mix, CORS... - # ... since cloudflare provides https mapping using this as fallback - - return s - - ################################################################################ def parse_POST(byc): @@ -94,14 +37,19 @@ def parse_POST(byc): if "json" in content_typ: body = sys.stdin.read(int(content_len)) jbod = json.loads(body) + d_m = jbod.get("debugMode", False) + byc.update({"debug_mode": set_debug_state(jbod.get("debugMode"))}) + for j_p in jbod: j_p_d = decamelize(j_p) - if "debug" in j_p: - byc.update({"debug_mode": set_debug_state(jbod.get(j_p))}) + if "debugMode" in j_p: + continue # TODO: this hacks the v2 structure; ideally should use requestParameters schemas - elif "query" in j_p: + if "query" in j_p: for p, v in jbod["query"].items(): - if p == "requestParameters": + if p == "filters": + form.update({p: v}) + elif p == "requestParameters": for rp, rv in v.items(): rp_d = decamelize(rp) if "datasets" in rp: @@ -109,6 +57,7 @@ def parse_POST(byc): form.update({"dataset_ids": rv["datasetIds"]}) elif "g_variant" in rp: for vp, vv in v[rp].items(): + # prdbug(f'{vp}: {vv}', byc.get("debug_mode")) vp_d = decamelize(vp) if vp_d in a_defs: form.update({vp_d: vv}) diff --git a/bycon/lib/dataset_parsing.py b/bycon/lib/dataset_parsing.py index 20063a7da..93b355336 100644 --- a/bycon/lib/dataset_parsing.py +++ b/bycon/lib/dataset_parsing.py @@ -41,14 +41,17 @@ def ds_id_from_accessid(byc): # test of existence... accessid = byc["form_data"].get("accessid", False) - ho_db = byc.get("housekeeping_db", False) - ho_collname = byc.get("handover_coll", False) - if any(x is False for x in [accessid, ho_db, ho_collname]): + mdb_c = byc.get("db_config", {}) + db_host = mdb_c.get("host", "localhost") + ho_dbname = mdb_c.get("housekeeping_db", False) + ho_collname = mdb_c.get("handover_coll", False) + + if any(x is False for x in [accessid, ho_dbname, ho_collname]): return False - ho_client = MongoClient(host=environ.get("BYCON_MONGO_HOST", "localhost")) - h_o = ho_client[ho_db][ho_collname].find_one({"id": accessid}) + ho_client = MongoClient(host=db_host) + h_o = ho_client[ho_dbname][ho_collname].find_one({"id": accessid}) if not h_o: return False diff --git a/bycon/lib/genome_utils.py b/bycon/lib/genome_utils.py index 1bc2af5b2..a3d72f016 100644 --- a/bycon/lib/genome_utils.py +++ b/bycon/lib/genome_utils.py @@ -143,8 +143,8 @@ def __chro_id_data(self): ################################################################################ class GeneInfo: - def __init__(self, dbpars): - self.dbpars = dbpars + def __init__(self, db_config): + self.db_config = db_config self.error = None self.gene_data = [] @@ -167,10 +167,13 @@ def returnGenelist(self, gene_id="___none___"): # -------------------------------------------------------------------------# def __gene_id_data(self, gene_id, single=True): - mongo_client = MongoClient(host=self.dbpars.get("mongohost","localhost")) + mdb_c = self.db_config + db_host = mdb_c.get("host", "localhost") + s_db = mdb_c.get("services_db", "___none___") + g_coll = mdb_c.get("genes_coll", "___none___") + + mongo_client = MongoClient(host=db_host) db_names = list(mongo_client.list_database_names()) - s_db = self.dbpars.get("services_db", "___none___") - g_coll = self.dbpars.get("genes_coll", "___none___") if s_db not in db_names: self.error = f"services db `{s_db}` does not exist" return diff --git a/bycon/lib/handover_generation.py b/bycon/lib/handover_generation.py index 548ae485c..b200522a2 100644 --- a/bycon/lib/handover_generation.py +++ b/bycon/lib/handover_generation.py @@ -4,8 +4,7 @@ from os import environ, pardir, path import sys -from cgi_parsing import select_this_server -from bycon_helpers import hex_2_rgb, prdbug +from bycon_helpers import hex_2_rgb, prdbug, select_this_server from variant_mapping import ByconVariant ################################################################################ @@ -106,9 +105,13 @@ def dataset_response_add_handovers(ds_id, byc): def dataset_results_save_handovers(ds_id, byc): - ho_client = MongoClient(host=environ.get("BYCON_MONGO_HOST", "localhost")) - ho_db = ho_client[ byc["housekeeping_db"] ] - ho_coll = ho_db[ byc[ "handover_coll" ] ] + mdb_c = byc.get("db_config", {}) + db_host = mdb_c.get("host", "localhost") + ho_dbname = mdb_c.get("housekeeping_db", False) + ho_collname = mdb_c.get("handover_coll", False) + + ho_client = MongoClient(host=db_host) + ho_coll = ho_client[ho_dbname][ho_collname] for h_o_k in byc["dataset_results"][ds_id].keys(): @@ -127,7 +130,6 @@ def dataset_results_save_handovers(ds_id, byc): ################################################################################ def handover_create_url(h_o_server, h_o_defs, accessid, byc): - if "script_path_web" in h_o_defs: server = h_o_server if "http" in h_o_defs["script_path_web"]: @@ -137,27 +139,19 @@ def handover_create_url(h_o_server, h_o_defs, accessid, byc): if p in h_o_defs: url += "&{}={}".format(p, h_o_defs[p]) url += h_o_defs.get("url_opts", "") - # p_t = h_o_defs.get("plotType") - # if p_t: - # url += _handover_add_stringified_plot_parameters(byc) - return url - return "" ################################################################################ def _handover_create_ext_url(h_o_server, h_o_defs, bed_file_name, ucsc_pos, byc): - local_paths = byc.get("local_paths") if not local_paths: return False - if "ext_url" in h_o_defs: if "bedfile" in h_o_defs["handoverType"]["id"]: return("{}&position={}&hgt.customText={}{}/{}".format(h_o_defs["ext_url"], ucsc_pos, h_o_server, local_paths.get("server_tmp_dir_web", "/tmp"), bed_file_name)) - return False diff --git a/bycon/lib/parse_filters_request.py b/bycon/lib/parse_filters_request.py index c133b79e1..73e940ff0 100644 --- a/bycon/lib/parse_filters_request.py +++ b/bycon/lib/parse_filters_request.py @@ -1,11 +1,10 @@ import re -from bycon_helpers import prdbug +from bycon_helpers import prdbug, test_truthy ################################################################################ def parse_filters(byc): - get_global_filter_flags(byc) byc.update( { "filters": check_filter_values(byc) } ) @@ -13,23 +12,12 @@ def parse_filters(byc): ################################################################################ def get_global_filter_flags(byc): - + form = byc.get("form_data", {}) ff = { - "logic": byc["filter_flags"]["logic"], - "precision": byc["filter_flags"]["precision"], - "descendants": byc["filter_flags"]["include_descendant_terms"] + "logic": boolean_to_mongo_logic(form.get("filter_logic")), + "precision": form.get("filter_precision"), + "descendants": form.get("include_descendant_terms") } - - if "form_data" in byc: - if "filter_logic" in byc[ "form_data" ]: - ff["logic"] = boolean_to_mongo_logic( byc["form_data"]['filter_logic'] ) - if "filter_precision" in byc[ "form_data" ]: - ff["precision"] = byc["form_data"]['filter_precision'] - if "include_descendant_terms" in byc[ "form_data" ]: - i_d_t = str(byc[ "form_data" ].get("include_descendant_terms", 1)).lower() - if i_d_t in ["0", "-1", "no", "false"]: - ff["descendants"] = False - byc.update( { "filter_flags": ff } ) @@ -44,7 +32,6 @@ def boolean_to_mongo_logic(logic: str = "AND") -> str: ################################################################################ def check_filter_values(byc): - """ The function checks the filter values for a match to any of the filter definitions. The optional `!` flag (no match) is not considered during diff --git a/bycon/lib/parse_variant_request.py b/bycon/lib/parse_variant_request.py index a246ee580..2d8037461 100644 --- a/bycon/lib/parse_variant_request.py +++ b/bycon/lib/parse_variant_request.py @@ -49,7 +49,7 @@ def __parse_variant_parameters(byc): if "integer" in a_defs[ p_k ][ "type" ]: v_p = int( v_p ) v_p_c[ p_k ] = v_p - + byc.update( { "varguments": v_p_c } ) diff --git a/bycon/lib/query_generation.py b/bycon/lib/query_generation.py index 32a81c8f3..cb532b2b2 100644 --- a/bycon/lib/query_generation.py +++ b/bycon/lib/query_generation.py @@ -44,6 +44,11 @@ def __init__(self, byc: dict, dataset_id=False): self.debug_mode = byc.get("debug_mode", False) self.test_mode = byc.get("test_mode", False) self.test_mode_count = int(byc.get('test_mode_count', 5)) + self.defaults = byc.get("beacon_defaults", {}) + self.response_types = self.defaults.get("entity_defaults", {}) + + f_t_d = self.response_types.get("filteringTerm", {}) + self.filtering_terms_coll = f_t_d.get("collection", "___none___") if dataset_id is False: self.ds_id = byc.get("dataset_ids", False)[0] @@ -53,40 +58,27 @@ def __init__(self, byc: dict, dataset_id=False): self.arguments = byc.get("form_data", {}) self.argument_definitions = byc.get("argument_definitions", {}) self.filters = byc.get("filters", []) - self.filtering_terms_coll = byc.get("filtering_terms_coll", "___none___") - - self.dbpars = { - "mongohost": byc.get("mongohost", "localhost"), - "services_db": byc.get("services_db", "___none___"), - "genes_coll": byc.get("genes_coll", "___none___") - } self.requested_entity = byc.get("request_entity_id", False) self.response_entity = byc.get("response_entity_id", False) self.path_id_value = byc.get("request_entity_path_id_value", False) - self.defaults = byc.get("beacon_defaults", {}) - self.variant_request_type = byc.get("variant_request_type", "___none___") self.variant_request_definitions = byc.get("variant_request_definitions", {}) self.varguments = byc.get("varguments", {}) self.filter_definitions = byc.get("filter_definitions", {}) - ff = byc.get("filter_flags", {}) + ff = byc.get("filter_flags", {}) self.filter_descendants = ff.get("descendants", True) self.filter_logic = ff.get("logic", '$and') - self.housekeeping_db = byc.get("housekeeping_db", "___none___") - self.handover_coll = byc.get("handover_coll", "___none___") - self.services_db = byc.get("services_db", "___none___") - self.genes_coll = byc.get("genes_coll", "___none___") + self.db_config = byc.get("db_config", {}) pagination = byc.get("pagination", {"skip": 0, "limit": 0}) self.limit = pagination.get("limit", 0) self.skip = pagination.get("skip", 0) - self.response_types = self.defaults.get("entity_defaults") self.queries = { "expand": True, @@ -210,7 +202,11 @@ def __queries_for_test_mode(self): if not r_c: return - data_db = MongoClient(host=self.dbpars["mongohost"])[self.ds_id] + mdb_c = self.db_config + db_host = mdb_c.get("host", "localhost") + + + data_db = MongoClient(host=db_host)[self.ds_id] data_collnames = data_db.list_collection_names() if r_c not in data_collnames: @@ -279,7 +275,7 @@ def __create_geneVariantRequest_query(self): # query database for gene and use coordinates to create range query vp = self.varguments - gene_data, e = GeneInfo(self.dbpars).returnGene(vp["gene_id"]) + gene_data, e = GeneInfo(self.db_config).returnGene(vp["gene_id"]) # TODO: error report/warning if not gene_data: @@ -441,7 +437,10 @@ def __query_from_filters(self): if len(self.filters) < 1: return - data_db = MongoClient(host=self.dbpars["mongohost"])[self.ds_id] + mdb_c = self.db_config + db_host = mdb_c.get("host", "localhost") + + data_db = MongoClient(host=db_host)[self.ds_id] coll_coll = data_db[ self.filtering_terms_coll ] self.collation_ids = coll_coll.distinct("id", {}) @@ -463,6 +462,7 @@ def __query_from_filters(self): f_info = self.__query_from_collationed_filter(coll_coll, f_val) if f_info is False: f_info = self.__query_from_filter_definitions(f_val) + if f_info is False: continue @@ -501,7 +501,6 @@ def __query_from_filters(self): f_lists[f_entity][f_field].append(f_info["id"]) # now processing the filter lists into the queries - for f_entity in f_lists.keys(): f_s_l = [] for f_field, f_query_vals in f_lists[f_entity].items(): @@ -572,7 +571,7 @@ def __query_from_filter_definitions(self, f_val): # response_add_filter_warnings(self.byc, ftw) return f_info - return f_info + return False # -------------------------------------------------------------------------# @@ -600,9 +599,13 @@ def __query_from_hoid(self): if not accessid: return - ho_client = MongoClient(host=self.dbpars["mongohost"]) - ho_db = ho_client[self.housekeeping_db] - ho_coll = ho_db[self.handover_coll] + mdb_c = self.db_config + db_host = mdb_c.get("host", "localhost") + ho_dbname = mdb_c.get("housekeeping_db", "___none___") + ho_collname = mdb_c.get("handover_coll", "___none___") + + ho_client = MongoClient(host=db_host) + ho_coll = ho_client[ho_dbname].ho_db[ho_collname] h_o = ho_coll.find_one({"id": accessid}) # accessid overrides ... ? @@ -626,7 +629,6 @@ def __query_from_hoid(self): # -------------------------------------------------------------------------# def __update_queries_for_entity(self, query, entity): - logic = self.filter_logic r_t_s = self.response_types r_c = r_t_s[entity].get("collection") diff --git a/bycon/lib/read_specs.py b/bycon/lib/read_specs.py index 6fbfa7f2e..13339c25f 100644 --- a/bycon/lib/read_specs.py +++ b/bycon/lib/read_specs.py @@ -96,12 +96,14 @@ def update_rootpars_from_local(loc_dir, byc): ################################################################################ def dbstats_return_latest(byc): + mdb_c = byc.get("db_config", {}) + db_host = mdb_c.get("host", "localhost") # TODO: This is too hacky & should be moved to an external function # which updates the database_definitions / beacon_info yamls... - info_db = byc["housekeeping_db"] - coll = byc["beacon_info_coll"] - stats = MongoClient(host=environ.get("BYCON_MONGO_HOST", "localhost"))[ info_db ][ coll ].find( { }, { "_id": 0 } ).sort( "date", -1 ).limit( 1 ) + info_db = mdb_c.get("housekeeping_db") + coll = mdb_c.get("beacon_info_coll") + stats = MongoClient(host=db_host)[ info_db ][ coll ].find( { }, { "_id": 0 } ).sort( "date", -1 ).limit( 1 ) return list(stats)[0] diff --git a/bycon/lib/response_remapping.py b/bycon/lib/response_remapping.py index 19d0cf78e..d53697e06 100644 --- a/bycon/lib/response_remapping.py +++ b/bycon/lib/response_remapping.py @@ -1,8 +1,7 @@ import datetime, re from pymongo import MongoClient -from bycon_helpers import prdbug -from cgi_parsing import select_this_server +from bycon_helpers import prdbug, select_this_server from variant_mapping import ByconVariant from os import environ @@ -46,16 +45,11 @@ def remap_variants(r_s_res, byc): variants = [] for d in variant_ids: - d_vs = [var for var in r_s_res if var.get('variant_internal_id', "__none__") == d] - v = { "variant_internal_id": d, "variation": ByconVariant(byc).vrsVariant(d_vs[0]), "case_level_data": [] } - - v["variation"].pop("variant_internal_id", None) - for d_v in d_vs: c_l_v = {} for c_k in ("id", "biosample_id", "info"): @@ -68,7 +62,7 @@ def remap_variants(r_s_res, byc): v["case_level_data"].append(c_l_v) # TODO: Keep legacy pars? - legacy_pars = ["_id", "id", "reference_name", "type", "biosample_id", "callset_id", "individual_id", + legacy_pars = ["_id", "id", "variant_internal_id", "reference_name", "type", "biosample_id", "callset_id", "individual_id", "variant_type", "reference_bases", "alternate_bases", "start", "end", "required", "info"] for p in legacy_pars: v["variation"].pop(p, None) diff --git a/bycon/lib/service_utils.py b/bycon/lib/service_utils.py index 5d5627ec5..23c8c2257 100644 --- a/bycon/lib/service_utils.py +++ b/bycon/lib/service_utils.py @@ -18,6 +18,7 @@ def set_byc_config_pars(byc): config = byc.get("config", {}) for k, v in config.items(): byc.update({k: v}) + byc["db_config"].update({"host": environ.get("BYCON_MONGO_HOST", "localhost")}) ################################################################################ @@ -100,7 +101,6 @@ def initialize_bycon_service(byc, service=False): # name exists read_service_prefs(service, conf_dir, byc) - get_bycon_args(byc) args_update_form(byc) if "defaults" in byc.get("service_config", {}): @@ -163,14 +163,14 @@ def set_io_params(byc): s_v = int(form[sp]) byc["pagination"].update({sp: s_v}) - byc.update({"output": form.get("output", byc["output"])}) - byc.update({"method": form.get("method", byc["method"])}) + # byc.update({"output": form.get("output", "___none___")}) + # byc.update({"method": form.get("method", "___none___")}) - # TODO: this is only used in some services ... - if "method_keys" in byc["service_config"]: - m = form.get("method", "___none___") - if m in byc["service_config"]["method_keys"].keys(): - byc.update({"method": m}) + # # TODO: this is only used in some services ... + # if "method_keys" in byc["service_config"]: + # m = form.get("method", "___none___") + # if m in byc["service_config"]["method_keys"].keys(): + # byc.update({"method": m}) ################################################################################ diff --git a/bycon/schemas/bin/beaconYamler.py b/bycon/schemas/bin/beaconYamler.py index 877cb051c..53453671b 100755 --- a/bycon/schemas/bin/beaconYamler.py +++ b/bycon/schemas/bin/beaconYamler.py @@ -11,7 +11,7 @@ here_path = path.dirname( path.abspath(__file__) ) this_script = re.sub(".py", ".yaml", path.basename( __file__ ) ) with open(path.join( here_path, "config", this_script), 'r') as c_f: - config = yaml.load( c_f , Loader=yaml.FullLoader, sort_keys=False) + config = yaml.load(c_f, Loader=yaml.FullLoader) """podmd The script converts files in directories between yaml <-> json @@ -95,7 +95,7 @@ def _yaml2json(f_n, in_path, out_path, config): i_d = _file_read_and_clean(in_file, config) try: - s = yaml.load( i_d ) + s = yaml.load(i_d, Loader=yaml.FullLoader ) except Exception as e: print("\n¡¡¡¡¡ ###########################\n{}".format(in_file)) print(e) @@ -104,7 +104,7 @@ def _yaml2json(f_n, in_path, out_path, config): _par_replace(s, config) with open(out_file, 'w') as out_f: - out_f.write(json.dumps(OrderedDict(s), indent=4, sort_keys=True, default=str)) + out_f.write(json.dumps(s, indent=4, sort_keys=False, default=str)) ################################################################################ @@ -118,14 +118,14 @@ def _yaml2yaml(f_n, in_path, out_path, config): i_d = _file_read_and_clean(in_file, config) try: - s = yaml.load( i_d ) + s = yaml.load(i_d, Loader=yaml.FullLoader) except Exception as e: _file_conversion_error(e, in_file) return _par_replace(s, config) with open(out_file, 'w') as out_f: - yaml.dump(s, out_f, sort_keys=False) + yaml.dump(s, out_f) ################################################################################ @@ -139,14 +139,14 @@ def _json2yaml(f_n, in_path, out_path, config): i_d = _file_read_and_clean(in_file, config) try: - s = json.loads(i_d) + s = json.loads(i_d, Loader=yaml.FullLoader) except Exception as e: _file_conversion_error(e, in_file) return _par_replace(s, config) with open(out_file, 'w') as out_f: - yaml.dump(s, out_f, sort_keys=False) + yaml.dump(s, out_f) ################################################################################ @@ -159,14 +159,14 @@ def _json2json(f_n, in_path, out_path, config): _file_conversion_message(config, in_file, out_file) i_d = _file_read_and_clean(in_file, config) try: - s = json.loads(i_d) + s = json.loads(i_d, Loader=yaml.FullLoader) except Exception as e: _file_conversion_error(e, in_file) return _par_replace(s, config) with open(out_file, 'w') as out_f: - yaml.dump(s, out_f, sort_keys=False) + yaml.dump(s, out_f) ################################################################################ diff --git a/bycon/schemas/framework-byconaut-service-additions/json/responses/byconautServiceResponse.json b/bycon/schemas/framework-byconaut-service-additions/json/responses/byconautServiceResponse.json index 06c5f0767..292fe3381 100644 --- a/bycon/schemas/framework-byconaut-service-additions/json/responses/byconautServiceResponse.json +++ b/bycon/schemas/framework-byconaut-service-additions/json/responses/byconautServiceResponse.json @@ -1,30 +1,30 @@ { - "$id": "https://progenetix.org/services/schemas/byconautServiceResponse/v2023-10-04", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "$id": "https://progenetix.org/services/schemas/byconautServiceResponse/v2023-10-04", "description": "Byconaut service responses provide lists of items and a summary.", + "type": "object", "properties": { - "info": { - "$ref": "../../../framework/json/common/beaconCommonComponents.json#/definitions/Info", - "description": "Additional details that could be of interest. Provided to clearly enclose any attribute that is not part of the Beacon specification." - }, "meta": { - "$ref": "../../../framework/json/responses/sections/beaconResponseMeta.json", - "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results." + "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results.", + "$ref": "../../../framework/json/responses/sections/beaconResponseMeta.json" + }, + "responseSummary": { + "description": "Response summary, including Boolean and optionally results count.", + "$ref": "../../../framework/json/responses/sections/beaconSummaryResponseSection.json" + }, + "info": { + "description": "Additional details that could be of interest. Provided to clearly enclose any attribute that is not part of the Beacon specification.", + "$ref": "../../../framework/json/common/beaconCommonComponents.json#/definitions/Info" }, "response": { - "$ref": "./byconautServiceResults.json", + "type": "object", "description": "Response for queries that recovers any result.", - "type": "object" - }, - "responseSummary": { - "$ref": "../../../framework/json/responses/sections/beaconSummaryResponseSection.json", - "description": "Response summary, including Boolean and optionally results count." + "$ref": "./byconautServiceResults.json" } }, "required": [ "meta", "responseSummary" ], - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework-byconaut-service-additions/json/responses/byconautServiceResults.json b/bycon/schemas/framework-byconaut-service-additions/json/responses/byconautServiceResults.json index caa1c5ae0..10d90bfda 100644 --- a/bycon/schemas/framework-byconaut-service-additions/json/responses/byconautServiceResults.json +++ b/bycon/schemas/framework-byconaut-service-additions/json/responses/byconautServiceResults.json @@ -1,30 +1,30 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "description": "Simple results object for byconaut services", + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ResultItem" + } + } + }, "definitions": { "ResultItem": { - "additionalProperties": true, + "type": "object", "properties": { "id": { "description": "A (potentially ephemeral) identifier of the element.", + "type": "string", "examples": [ "N704216", "NCIT:C3262" - ], - "type": "string" + ] } }, - "type": "object" - } - }, - "description": "Simple results object for byconaut services", - "properties": { - "results": { - "items": { - "$ref": "#/definitions/ResultItem" - }, - "type": "array" + "additionalProperties": true } }, - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/common/basicElement.json b/bycon/schemas/framework/json/common/basicElement.json index 6cd4c48d9..99accbe0b 100644 --- a/bycon/schemas/framework/json/common/basicElement.json +++ b/bycon/schemas/framework/json/common/basicElement.json @@ -1,21 +1,21 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Basic Element", "description": "Definition of the basic element, which is root for most other objects.", + "type": "object", "properties": { "id": { - "description": "A (unique) identifier of the element.", - "type": "string" + "type": "string", + "description": "A (unique) identifier of the element." }, "name": { - "description": "A distinctive name for the element.", - "type": "string" + "type": "string", + "description": "A distinctive name for the element." } }, "required": [ "id", "name" ], - "title": "Basic Element", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/common/beaconCommonComponents.json b/bycon/schemas/framework/json/common/beaconCommonComponents.json index 0a0e708cb..06285e9fd 100644 --- a/bycon/schemas/framework/json/common/beaconCommonComponents.json +++ b/bycon/schemas/framework/json/common/beaconCommonComponents.json @@ -1,232 +1,232 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Beacon Common Components", + "description": "Definition of relatively simple components used in different points of the Beacon specification, both in requests and responses, therefore not associated exclusively with one or the other. Separate schema documents are provided for complex components.", + "type": "object", "definitions": { "$schema": { + "type": "string", "$comment": "TO REVIEW: adding a `format` or `regex` attribute that validates correctly against a file path (relative).", - "description": "Refers to the JSON Schema which describes the set of valid attributes for this particular document type. This attribute is mostly used in schemas that should be tested in Beacon implementations.", - "type": "string" + "description": "Refers to the JSON Schema which describes the set of valid attributes for this particular document type. This attribute is mostly used in schemas that should be tested in Beacon implementations." }, "ApiVersion": { "description": "an API version.", - "example": "v2.0", - "type": "string" + "type": "string", + "example": "v2.0" + }, + "BeaconId": { + "description": "the Id of a Beacon. Usually a reversed domain string, but any URI is acceptable. The purpose of this attribute is, in the context of a Beacon network, to disambiguate responses coming from different Beacons.", + "type": "string", + "example": "org.example.beacon.v2" }, "BeaconError": { "description": "Beacon-specific error.", + "type": "object", + "required": [ + "errorCode" + ], "properties": { "errorCode": { + "type": "integer", + "format": "int32", "default": 200, - "description": "Entry not found", "examples": [ "404" ], - "format": "int32", - "type": "integer" + "description": "Entry not found" }, "errorMessage": { + "type": "string", "examples": [ "the provided parameters are incomplete. 'xyz' is missing." + ] + } + } + }, + "ListOfSchemas": { + "description": "Set of schemas to be used in the response to a request.", + "type": "array", + "items": { + "$ref": "#/definitions/SchemasPerEntity" + } + }, + "SchemasPerEntity": { + "description": "Schema to be used for the requested entry type in the response.", + "type": "object", + "properties": { + "entityType": { + "type": "string", + "example": "Individual", + "$comment": "TO REVIEW: Should that refer to a concept d? or would that include an undesired dependency to the configuration?" + }, + "schema": { + "type": "string", + "examples": [ + "./ga4gh-beacon-dataset-v2.0.0", + "https://www.example.org/schemas/ga4gh-beacon-dataset-v2.0.0.json" ], - "type": "string" + "$comment": "TO DO: Add the correct format as 'uri' or 'regex'" } - }, - "required": [ - "errorCode" - ], - "type": "object" + } }, - "BeaconId": { - "description": "the Id of a Beacon. Usually a reversed domain string, but any URI is acceptable. The purpose of this attribute is, in the context of a Beacon network, to disambiguate responses coming from different Beacons.", - "example": "org.example.beacon.v2", - "type": "string" + "Pagination": { + "description": "Pagination to apply or that has been applied on the results.", + "type": "object", + "properties": { + "skip": { + "$ref": "#/definitions/Skip" + }, + "limit": { + "$ref": "#/definitions/Limit" + }, + "currentPage": { + "description": "Token of the returned page. To be used only in the response to allow the client to check if the returned page is the one requested.", + "$ref": "#/definitions/PageToken" + }, + "nextPage": { + "description": "Token of the next page. Used to navigate forward. If empty, it is assumed that no more pages are available", + "$ref": "#/definitions/PageToken" + }, + "previousPage": { + "description": "Token of the previous page. Used to navigate backwards. If empty, it is assumed that the current page is the first one.", + "$ref": "#/definitions/PageToken" + } + } }, - "Exists": { - "default": false, - "description": "Indicator of whether any record was observed in any of the collections queried. This should be non-null.", - "examples": [ - true - ], - "type": "boolean" + "Skip": { + "description": "* In the request: number of pages to skip * In the response: number of pages that has been skipped", + "type": "integer", + "minimum": 0, + "default": 0, + "example": 0 }, - "Filters": { - "description": "Ontology based filters. A CURIE syntax is encouraged to be used.", - "example": [ - "BTO:0000199", - "PATO:0000383" - ], - "items": { - "type": "string" - }, - "type": "array" + "Limit": { + "description": "Size of the page. Use `0` to return all the results or the maximum allowed by the Beacon, if there is any.", + "type": "integer", + "minimum": 0, + "default": 10, + "example": 10 + }, + "PageToken": { + "description": "A hash or similar that allows the server to use it as a cursor over a query. It could be or not a readable value, like a word or a key. E.g. it could be an encrypted value of primary keys to navigate next and previous page.", + "type": "string", + "example": "ab0sc&fe1dd" }, "Granularity": { - "default": "boolean", "description": "Granularity or 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\n to return records with fewer than allattributes, different strategies have\n 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", + "type": "string", "enum": [ "boolean", "count", "aggregated", "record" ], - "type": "string" + "default": "boolean" }, - "Handover": { - "description": "A handover is a typed link for attaching actionable links to results, non purely informational, requests. The goal of the handovers is to list the different actions available, e.g.:\n* a link to a request access page * linking to a file for download, e.g. a VCF file\nAnother common scenario is to provide a fast summary response (e.g. BeconCountResponse) and to provide access to different endpoints for the entities matched by the query using temporary access tokens in the handover URLs.", - "properties": { - "handoverType": { - "$ref": "#/definitions/HandoverType" - }, - "note": { - "description": "An optional text including considerations on the handover link provided.", - "example": "This handover link provides access to a summarized VCF.", - "type": "string" - }, - "url": { - "description": "URL endpoint to where the handover process could progress, in RFC3986 format", - "example": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0/", - "format": "uri", - "type": "string" - } - }, - "required": [ - "handoverType", - "url" - ], - "type": "object" + "TestMode": { + "description": "Used for indicating that a request or response is done in a test context e.g. for compliance testing i.e. to evaluate the acceptance/understanding of a request and the structure of the returned response by the Beacon instance. A TRUE `testMode` parameter DOES NOT require that the Beacon instance is a test instance, but that this specific request-response cycle is a testing one. When `true` the Beacon instance MUST respond the request but it SHOULD use virtual or non-sensitive data. Here, what is being evaluated is the acceptance/understanding of a request and the structure of the returned response by the Beacon instance.", + "type": "boolean", + "default": false }, - "HandoverType": { - "$ref": "./ontologyTerm.json", - "description": "Handover type, as an Ontology_term object with CURIE syntax for the `id` value.", - "examples": [ - { - "id": "EFO:0004157", - "label": "BAM format" - }, - { - "id": "pgx:pgxseg", - "label": "download genomic variants in .pgxseg file format" - } - ] + "NonFilteredQueriesAllowed": { + "description": "Switch that declares if this Beacon instance, for a given entry type, admits queries that does not include any element that restrict returning all the results, like filters, parameters, ids, etc. The default value is 'true' for backward compatibility and for clarity in the request-response dialog.", + "type": "boolean", + "default": true }, "IncludeResultsetResponses": { - "default": "HIT", "description": "Indicator of whether responses from every Resultset should be included in the response to this request or just the ones with positive, negative results or no details at all. If null (not specified), the default value of 'HIT' is assumed. This parameter allows for returning boolean/counting results although the Beacon instance is capable to return record level details.", + "type": "string", "enum": [ "ALL", "HIT", "MISS", "NONE" ], + "default": "HIT", "examples": [ "ALL", "HIT", "MISS", "NONE" - ], - "type": "string" - }, - "Info": { - "description": "Placeholder to allow the Beacon to return any additional information that is necessary or could be of interest in relation to the query or the entry returned. It is recommended to encapsulate additional informations in this attribute instead of directly adding attributes at the same level than the others in order to avoid collision in the names of attributes in future versions of the specification.", - "type": "object" - }, - "Limit": { - "default": 10, - "description": "Size of the page. Use `0` to return all the results or the maximum allowed by the Beacon, if there is any.", - "example": 10, - "minimum": 0, - "type": "integer" - }, - "ListOfHandovers": { - "description": "Set of handovers to be added in one section the response.", - "items": { - "$ref": "#/definitions/Handover", - "description": "Requested schema to be used for individuals in the response." - }, - "type": "array" + ] }, - "ListOfSchemas": { - "description": "Set of schemas to be used in the response to a request.", + "Filters": { + "description": "Ontology based filters. A CURIE syntax is encouraged to be used.", + "type": "array", "items": { - "$ref": "#/definitions/SchemasPerEntity" + "type": "string" }, - "type": "array" + "example": [ + "BTO:0000199", + "PATO:0000383" + ] }, - "NonFilteredQueriesAllowed": { - "default": true, - "description": "Switch that declares if this Beacon instance, for a given entry type, admits queries that does not include any element that restrict returning all the results, like filters, parameters, ids, etc. The default value is 'true' for backward compatibility and for clarity in the request-response dialog.", - "type": "boolean" + "Exists": { + "description": "Indicator of whether any record was observed in any of the collections queried. This should be non-null.", + "type": "boolean", + "default": false, + "examples": [ + true + ] }, "NumTotalResults": { - "default": 0, "description": "Total number of results. NOT the number of results returned in this batch, but the total obtained by the query.", + "type": "integer", + "minimum": 0, + "default": 0, "examples": [ 123 - ], - "minimum": 0, - "type": "integer" + ] }, - "PageToken": { - "description": "A hash or similar that allows the server to use it as a cursor over a query. It could be or not a readable value, like a word or a key. E.g. it could be an encrypted value of primary keys to navigate next and previous page.", - "example": "ab0sc&fe1dd", - "type": "string" + "Info": { + "description": "Placeholder to allow the Beacon to return any additional information that is necessary or could be of interest in relation to the query or the entry returned. It is recommended to encapsulate additional informations in this attribute instead of directly adding attributes at the same level than the others in order to avoid collision in the names of attributes in future versions of the specification.", + "type": "object" }, - "Pagination": { - "description": "Pagination to apply or that has been applied on the results.", + "ListOfHandovers": { + "description": "Set of handovers to be added in one section the response.", + "type": "array", + "items": { + "description": "Requested schema to be used for individuals in the response.", + "$ref": "#/definitions/Handover" + } + }, + "Handover": { + "type": "object", + "description": "A handover is a typed link for attaching actionable links to results, non purely informational, requests. The goal of the handovers is to list the different actions available, e.g.:\n* a link to a request access page * linking to a file for download, e.g. a VCF file\nAnother common scenario is to provide a fast summary response (e.g. BeconCountResponse) and to provide access to different endpoints for the entities matched by the query using temporary access tokens in the handover URLs.", + "required": [ + "handoverType", + "url" + ], "properties": { - "currentPage": { - "$ref": "#/definitions/PageToken", - "description": "Token of the returned page. To be used only in the response to allow the client to check if the returned page is the one requested." - }, - "limit": { - "$ref": "#/definitions/Limit" - }, - "nextPage": { - "$ref": "#/definitions/PageToken", - "description": "Token of the next page. Used to navigate forward. If empty, it is assumed that no more pages are available" + "handoverType": { + "$ref": "#/definitions/HandoverType" }, - "previousPage": { - "$ref": "#/definitions/PageToken", - "description": "Token of the previous page. Used to navigate backwards. If empty, it is assumed that the current page is the first one." + "note": { + "type": "string", + "description": "An optional text including considerations on the handover link provided.", + "example": "This handover link provides access to a summarized VCF." }, - "skip": { - "$ref": "#/definitions/Skip" + "url": { + "type": "string", + "format": "uri", + "description": "URL endpoint to where the handover process could progress, in RFC3986 format", + "example": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0/" } - }, - "type": "object" + } }, - "SchemasPerEntity": { - "description": "Schema to be used for the requested entry type in the response.", - "properties": { - "entityType": { - "$comment": "TO REVIEW: Should that refer to a concept d? or would that include an undesired dependency to the configuration?", - "example": "Individual", - "type": "string" + "HandoverType": { + "description": "Handover type, as an Ontology_term object with CURIE syntax for the `id` value.", + "$ref": "./ontologyTerm.json", + "examples": [ + { + "id": "EFO:0004157", + "label": "BAM format" }, - "schema": { - "$comment": "TO DO: Add the correct format as 'uri' or 'regex'", - "examples": [ - "./ga4gh-beacon-dataset-v2.0.0", - "https://www.example.org/schemas/ga4gh-beacon-dataset-v2.0.0.json" - ], - "type": "string" + { + "id": "pgx:pgxseg", + "label": "download genomic variants in .pgxseg file format" } - }, - "type": "object" - }, - "Skip": { - "default": 0, - "description": "* In the request: number of pages to skip * In the response: number of pages that has been skipped", - "example": 0, - "minimum": 0, - "type": "integer" - }, - "TestMode": { - "default": false, - "description": "Used for indicating that a request or response is done in a test context e.g. for compliance testing i.e. to evaluate the acceptance/understanding of a request and the structure of the returned response by the Beacon instance. A TRUE `testMode` parameter DOES NOT require that the Beacon instance is a test instance, but that this specific request-response cycle is a testing one. When `true` the Beacon instance MUST respond the request but it SHOULD use virtual or non-sensitive data. Here, what is being evaluated is the acceptance/understanding of a request and the structure of the returned response by the Beacon instance.", - "type": "boolean" + ] } - }, - "description": "Definition of relatively simple components used in different points of the Beacon specification, both in requests and responses, therefore not associated exclusively with one or the other. Separate schema documents are provided for complex components.", - "title": "Beacon Common Components", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/common/elementWithDescription.json b/bycon/schemas/framework/json/common/elementWithDescription.json index 54e289a13..de170b4c5 100644 --- a/bycon/schemas/framework/json/common/elementWithDescription.json +++ b/bycon/schemas/framework/json/common/elementWithDescription.json @@ -1,20 +1,20 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Basic Element including a description", + "description": "Definition of the basic element extended with a description.", + "type": "object", "allOf": [ { "$ref": "./basicElement.json" }, { + "type": "object", "properties": { "description": { - "description": "A textual description for the element.", - "type": "string" + "type": "string", + "description": "A textual description for the element." } - }, - "type": "object" + } } - ], - "description": "Definition of the basic element extended with a description.", - "title": "Basic Element including a description", - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/common/examples/beaconCommonComponents-example.json b/bycon/schemas/framework/json/common/examples/beaconCommonComponents-example.json index 3c6d88d62..5970fa772 100644 --- a/bycon/schemas/framework/json/common/examples/beaconCommonComponents-example.json +++ b/bycon/schemas/framework/json/common/examples/beaconCommonComponents-example.json @@ -1,65 +1,65 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "beaconId": "org.example.beacon.v2", "apiVersion": "v2.0", "beaconError": { "errorCode": 404, "errorMessage": "the provided parameters are incomplete. 'xyz' is missing." }, - "beaconId": "org.example.beacon.v2", - "exists": true, + "listOfSchemas": [ + { + "entityType": "EntryTypeA", + "schema": "entry-typeA-schema-v0.1" + }, + { + "entityType": "EntryTypeB", + "schema": "entry-typeB-schema-v1.0" + } + ], + "schemasPerEntity": { + "entityType": "Individual", + "schema": "ga4gh-phenopacket-individual-v0.1" + }, + "pagination": { + "skip": 0, + "limit": 10 + }, + "includeResultsetResponses": "HIT", "filters": [ "BTO:0000199", "PATO:0000383" ], + "exists": true, + "numTotalResults": 123, + "info": {}, "handover": { "handoverType": { "id": "EFO:0004157", "label": "BAM format" }, - "note": "This handover link provides access to a summarized VCF.", - "url": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0" + "url": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0", + "note": "This handover link provides access to a summarized VCF." }, "handoverType": { "id": "EFO:0004157", "label": "BAM format" }, - "includeResultsetResponses": "HIT", - "info": {}, "listOfHandovers": [ { "handoverType": { "id": "EFO:0004157", "label": "BAM format" }, - "note": "This handover link provides access to a summarized VCF.", - "url": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0" + "url": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0", + "note": "This handover link provides access to a summarized VCF." }, { "handoverType": { "id": "EFO:0004157", "label": "BAM format" }, - "note": "This handover link provides access to a summarized VCF.", - "url": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0" + "url": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0", + "note": "This handover link provides access to a summarized VCF." } - ], - "listOfSchemas": [ - { - "entityType": "EntryTypeA", - "schema": "entry-typeA-schema-v0.1" - }, - { - "entityType": "EntryTypeB", - "schema": "entry-typeB-schema-v1.0" - } - ], - "numTotalResults": 123, - "pagination": { - "limit": 10, - "skip": 0 - }, - "schemasPerEntity": { - "entityType": "Individual", - "schema": "ga4gh-phenopacket-individual-v0.1" - } + ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/common/examples/elementWithDescription-example.json b/bycon/schemas/framework/json/common/examples/elementWithDescription-example.json index 0f481c4f4..ae117c321 100644 --- a/bycon/schemas/framework/json/common/examples/elementWithDescription-example.json +++ b/bycon/schemas/framework/json/common/examples/elementWithDescription-example.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "A longer textual description for the element.", "id": "EWDex1", - "name": "Element with description one" + "name": "Element with description one", + "description": "A longer textual description for the element." } \ No newline at end of file diff --git a/bycon/schemas/framework/json/common/examples/ontologizedElement-example.json b/bycon/schemas/framework/json/common/examples/ontologizedElement-example.json index 7d15b29fb..631d7dc56 100644 --- a/bycon/schemas/framework/json/common/examples/ontologizedElement-example.json +++ b/bycon/schemas/framework/json/common/examples/ontologizedElement-example.json @@ -1,8 +1,8 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "Non-mandatory, longer textual description for the element.", "id": "OEex1", "name": "Element with a description and associated ontology term.", + "description": "Non-mandatory, longer textual description for the element.", "ontologyTermForThisType": { "id": "DUO:0000004", "label": "General Research Use" diff --git a/bycon/schemas/framework/json/common/examples/referenceToAnSchema-MAX-example.json b/bycon/schemas/framework/json/common/examples/referenceToAnSchema-MAX-example.json index 0a9411e29..acbc4640c 100644 --- a/bycon/schemas/framework/json/common/examples/referenceToAnSchema-MAX-example.json +++ b/bycon/schemas/framework/json/common/examples/referenceToAnSchema-MAX-example.json @@ -1,8 +1,8 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "A longer textual description for the element.", "id": "RTAEex1", "name": "Reference to schema one with all its properties.", + "description": "A longer textual description for the element.", "referenceToSchemaDefinition": "https://example-schemas.org/an-schema-address.json", "schemaVersion": "v1.0" } \ No newline at end of file diff --git a/bycon/schemas/framework/json/common/ontologizedElement.json b/bycon/schemas/framework/json/common/ontologizedElement.json index c2bdd56e9..7c8bb623a 100644 --- a/bycon/schemas/framework/json/common/ontologizedElement.json +++ b/bycon/schemas/framework/json/common/ontologizedElement.json @@ -1,23 +1,23 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Element with description and a type defined by an ontology", + "description": "Definition of the basic element which includes a description and a type defined by an ontology.", + "type": "object", "allOf": [ { "$ref": "./elementWithDescription.json" }, { + "type": "object", + "required": [ + "ontologyTermForThisType" + ], "properties": { "ontologyTermForThisType": { "$ref": "./ontologyTerm.json" } - }, - "required": [ - "ontologyTermForThisType" - ], - "type": "object" + } } ], - "description": "Definition of the basic element which includes a description and a type defined by an ontology.", - "title": "Element with description and a type defined by an ontology", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/common/ontologyTerm.json b/bycon/schemas/framework/json/common/ontologyTerm.json index f72492599..575d359f8 100644 --- a/bycon/schemas/framework/json/common/ontologyTerm.json +++ b/bycon/schemas/framework/json/common/ontologyTerm.json @@ -1,27 +1,27 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Ontology Term", "description": "Definition of an ontology term.", + "type": "object", "properties": { "id": { "description": "A CURIE identifier, e.g. as `id` for an ontology term.", + "type": "string", + "pattern": "^\\w[^:]+:.+$", "examples": [ "ga4gh:GA.01234abcde", "DUO:0000004", "orcid:0000-0003-3463-0775", "PMID:15254584" - ], - "pattern": "^\\w[^:]+:.+$", - "type": "string" + ] }, "label": { - "description": "The text that describes the term. By default it could be the preferred text of the term, but is it acceptable to customize it for a clearer description and understanding of the term in an specific context.", - "type": "string" + "type": "string", + "description": "The text that describes the term. By default it could be the preferred text of the term, but is it acceptable to customize it for a clearer description and understanding of the term in an specific context." } }, "required": [ "id" ], - "title": "Ontology Term", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/common/referenceToAnSchema.json b/bycon/schemas/framework/json/common/referenceToAnSchema.json index 99f5c5f9b..ee99c13d7 100644 --- a/bycon/schemas/framework/json/common/referenceToAnSchema.json +++ b/bycon/schemas/framework/json/common/referenceToAnSchema.json @@ -1,28 +1,28 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "An annotated URL address or a file reference", + "description": "Definition of an annotated URL address or a file reference.", + "type": "object", "allOf": [ { "$ref": "./elementWithDescription.json" }, { + "type": "object", "properties": { "referenceToSchemaDefinition": { - "$comment": "this should map to a resolvable reference", - "type": "string" + "type": "string", + "$comment": "this should map to a resolvable reference" }, "schemaVersion": { - "description": "this version reference is only used for readability in the client. The 'referenceToSchemaDefinition' property is the only source for determining the actual schema used.", - "type": "string" + "type": "string", + "description": "this version reference is only used for readability in the client. The 'referenceToSchemaDefinition' property is the only source for determining the actual schema used." } }, "required": [ "referenceToSchemaDefinition" - ], - "type": "object" + ] } ], - "description": "Definition of an annotated URL address or a file reference.", - "title": "An annotated URL address or a file reference", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/common/validation/beaconCommonComponents.json b/bycon/schemas/framework/json/common/validation/beaconCommonComponents.json index 99bb55603..19e049cff 100644 --- a/bycon/schemas/framework/json/common/validation/beaconCommonComponents.json +++ b/bycon/schemas/framework/json/common/validation/beaconCommonComponents.json @@ -1,10 +1,14 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, + "title": "Schema for validating Beacon Common Components examples", + "type": "object", "properties": { "$schema": { - "description": "Added here to allow the example to comply with the 'additionalProperties:true' restriction.", - "type": "string" + "type": "string", + "description": "Added here to allow the example to comply with the 'additionalProperties:true' restriction." + }, + "beaconId": { + "$ref": "../beaconCommonComponents.json#/definitions/BeaconId" }, "apiVersion": { "$ref": "../beaconCommonComponents.json#/definitions/ApiVersion" @@ -12,43 +16,39 @@ "beaconError": { "$ref": "../beaconCommonComponents.json#/definitions/BeaconError" }, - "beaconId": { - "$ref": "../beaconCommonComponents.json#/definitions/BeaconId" + "listOfSchemas": { + "$ref": "../beaconCommonComponents.json#/definitions/ListOfSchemas" }, - "exists": { - "$ref": "../beaconCommonComponents.json#/definitions/Exists" + "schemasPerEntity": { + "$ref": "../beaconCommonComponents.json#/definitions/SchemasPerEntity" + }, + "pagination": { + "$ref": "../beaconCommonComponents.json#/definitions/Pagination" + }, + "includeResultsetResponses": { + "$ref": "../beaconCommonComponents.json#/definitions/IncludeResultsetResponses" }, "filters": { "$ref": "../beaconCommonComponents.json#/definitions/Filters" }, + "exists": { + "$ref": "../beaconCommonComponents.json#/definitions/Exists" + }, + "numTotalResults": { + "$ref": "../beaconCommonComponents.json#/definitions/NumTotalResults" + }, + "info": { + "$ref": "../beaconCommonComponents.json#/definitions/Info" + }, "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" + "additionalProperties": false } \ No newline at end of file diff --git a/bycon/schemas/framework/json/configuration/beaconConfigurationSchema.json b/bycon/schemas/framework/json/configuration/beaconConfigurationSchema.json index 02d54a3a0..7318b658c 100644 --- a/bycon/schemas/framework/json/configuration/beaconConfigurationSchema.json +++ b/bycon/schemas/framework/json/configuration/beaconConfigurationSchema.json @@ -1,63 +1,64 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, - "definitions": { - "EntryTypes": { - "additionalProperties": { - "$ref": "./entryTypeDefinition.json", - "type": "object" - }, - "description": "This is a dictionary of the entry types implemented in this Beacon instance.", - "minProperties": 1, - "type": "object" - } - }, + "title": "Beacon Configuration", "description": "Files complaint with this schema are the configuration ones. The details returned in `service-info` are mirroring the ones in this configuration file.", + "type": "object", "properties": { "$schema": { "$ref": "../common/beaconCommonComponents.json#/definitions/$schema" }, - "entryTypes": { - "$ref": "#/definitions/EntryTypes" - }, "maturityAttributes": { "description": "Declares the level of maturity of the Beacon instance.", + "type": "object", "properties": { "productionStatus": { "description": "`DEV`= 'Service potentially unstable, not real data', which availability and data should not be used in production setups. `TEST`= 'Service stable, not real data'. 'PROD'= 'Service stable, actual data'.", + "type": "string", "enum": [ "DEV", "TEST", "PROD" - ], - "type": "string" + ] } - }, - "type": "object" + } }, "securityAttributes": { "description": "Configuration of the security aspects of the Beacon. By default, a Beacon that does not declare the configuration settings would return `boolean` (true/false) responses, and only if the user is authenticated and explicitly authorized to access the Beacon resources. Although this is the safest set of settings, it is not recommended unless the Beacon shares very sensitive information. Non sensitive Beacons should preferably opt for a `record` and `PUBLIC` combination.", + "type": "object", "properties": { "defaultGranularity": { - "$ref": "../common/beaconCommonComponents.json#/definitions/Granularity", - "description": "Default granularity. Some responses could return higher detail, but this would be the granularity by default." + "description": "Default granularity. Some responses could return higher detail, but this would be the granularity by default.", + "$ref": "../common/beaconCommonComponents.json#/definitions/Granularity" }, "securityLevels": { "description": "All access levels supported by the Beacon. Any combination is valid, as every option would apply to different parts of the Beacon.", + "type": "array", "items": { - "default": [ - "CONTROLLED" - ], "enum": [ "PUBLIC", "REGISTERED", "CONTROLLED" + ], + "default": [ + "CONTROLLED" ] - }, - "type": "array" + } } + } + }, + "entryTypes": { + "$ref": "#/definitions/EntryTypes" + } + }, + "definitions": { + "EntryTypes": { + "description": "This is a dictionary of the entry types implemented in this Beacon instance.", + "type": "object", + "additionalProperties": { + "type": "object", + "$ref": "./entryTypeDefinition.json" }, - "type": "object" + "minProperties": 1 } }, "required": [ @@ -65,6 +66,5 @@ "maturityAttributes", "entryTypes" ], - "title": "Beacon Configuration", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/configuration/beaconMapSchema.json b/bycon/schemas/framework/json/configuration/beaconMapSchema.json index b5335e28b..260ef4c0b 100644 --- a/bycon/schemas/framework/json/configuration/beaconMapSchema.json +++ b/bycon/schemas/framework/json/configuration/beaconMapSchema.json @@ -1,84 +1,84 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Beacon Map", + "description": "Map of a Beacon, its entry types and endpoints. It isconceptually similar to a website sitemap.", + "type": "object", + "properties": { + "$schema": { + "$ref": "../common/beaconCommonComponents.json#/definitions/$schema" + }, + "endpointSets": { + "description": "List of enpoints included in this Beacon instance. This is list is meant to inform Beacon clients, e.g. a Beacon Network, about the available endpoints, it is not used to generate any automatic list, but could be used for Beacon validation purposes.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Endpoint" + }, + "minProperties": 1 + } + }, "definitions": { "Endpoint": { + "type": "object", "properties": { - "endpoints": { - "additionalProperties": { - "$ref": "#/definitions/RelatedEndpoint" - }, - "description": "Optional. A list describing additional endpoints implemented by this Beacon instance for that entry type. Additional details on the endpoint parameters, supported HTTP verbs, etc. could be obtained by parsing the OpenAPI definition referenced in the `openAPIEndpointsDefinition` attribute.", - "minProperties": 0, - "type": "object" - }, "entryType": { "description": "", "type": "string" }, - "filteringTermsUrl": { - "description": "Optional. Returns the list of filtering terms that could be applied to this entry type. It is added here for convenience of the Beacon clients, so they don't need to parse the OpenAPI endpoints definition to get that endpoint. Also, in very simple Beacons, that endpoint could be the one of the few implemented, together with \u00b4rootUrl` and \u00b4singleEntryUrl`, in which case the whole map of endpoints is found in the current Map.", - "format": "uri", - "type": "string" - }, "openAPIEndpointsDefinition": { "description": "Reference to the file that includes the OpenAPI definition of the endpoints implemented in this Beacon instance. The referenced file MUST BE a valid OpenAPI definition file, as it is expected that the Beacon clients (e.g. a Beacon Network) should be able to parse it to discover additional details on the supported verbs, parameters, etc.", "type": "string" }, "rootUrl": { "description": "The base url for this entry type. Returns a list of entries. It is added here for convenience of the Beacon clients, so they don't need to parse the OpenAPI endpoints definition to get that base endpoint. Also, in very simple Beacons, that endpoint could be the only one implemented, together with \u00b4singleEntryUrl`, in which case the whole map of endpoints is found in the current Map.", - "format": "uri", - "type": "string" + "type": "string", + "format": "uri" }, "singleEntryUrl": { "description": "Optional, but recommended. Returns only one instance of this entry, identified by an `id`. It is added here for convenience of the Beacon clients, so they don't need to parse the OpenAPI endpoints definition to get that base endpoint. Also, in very simple Beacons, that endpoint could be the only one implemented, together with \u00b4rootUrl`, in which case the whole map of endpoints is found in the current Map.", - "format": "uri", - "type": "string" + "type": "string", + "format": "uri" + }, + "filteringTermsUrl": { + "description": "Optional. Returns the list of filtering terms that could be applied to this entry type. It is added here for convenience of the Beacon clients, so they don't need to parse the OpenAPI endpoints definition to get that endpoint. Also, in very simple Beacons, that endpoint could be the one of the few implemented, together with \u00b4rootUrl` and \u00b4singleEntryUrl`, in which case the whole map of endpoints is found in the current Map.", + "type": "string", + "format": "uri" + }, + "endpoints": { + "description": "Optional. A list describing additional endpoints implemented by this Beacon instance for that entry type. Additional details on the endpoint parameters, supported HTTP verbs, etc. could be obtained by parsing the OpenAPI definition referenced in the `openAPIEndpointsDefinition` attribute.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/RelatedEndpoint" + }, + "minProperties": 0 } }, "required": [ "entryType", "rootUrl" - ], - "type": "object" + ] }, "RelatedEndpoint": { + "type": "object", "properties": { - "returnedEntryType": { - "description": "Which entry type is returned by querying this endpoint. It MUST match one of the entry types defined in the Beacon configuration file (`beaconConfiguration.json`).", - "type": "string" - }, "url": { "description": "Endpoint URL", - "format": "uri", + "type": "string", + "format": "uri" + }, + "returnedEntryType": { + "description": "Which entry type is returned by querying this endpoint. It MUST match one of the entry types defined in the Beacon configuration file (`beaconConfiguration.json`).", "type": "string" } }, "required": [ "url", "returnedEntryType" - ], - "type": "object" - } - }, - "description": "Map of a Beacon, its entry types and endpoints. It isconceptually similar to a website sitemap.", - "properties": { - "$schema": { - "$ref": "../common/beaconCommonComponents.json#/definitions/$schema" - }, - "endpointSets": { - "additionalProperties": { - "$ref": "#/definitions/Endpoint" - }, - "description": "List of enpoints included in this Beacon instance. This is list is meant to inform Beacon clients, e.g. a Beacon Network, about the available endpoints, it is not used to generate any automatic list, but could be used for Beacon validation purposes.", - "minProperties": 1, - "type": "object" + ] } }, "required": [ "$schema", "endpointSets" ], - "title": "Beacon Map", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/configuration/entryTypeDefinition.json b/bycon/schemas/framework/json/configuration/entryTypeDefinition.json index 434bebcf6..68c2a8bd6 100644 --- a/bycon/schemas/framework/json/configuration/entryTypeDefinition.json +++ b/bycon/schemas/framework/json/configuration/entryTypeDefinition.json @@ -1,59 +1,60 @@ { - "$comment": "TO DO: The tagged parts should reference to `common/ontologizedElement.json`. But that configuration fails to validate. Further investigation is required, but should not affect the resulting schema.", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "", "description": "Definition of an element or entry type including the Beacon v2 required and suggested attributes. This schema purpose is to describe each type of entities included in a Beacon, hence Beacon clients could have some metadata about such entities.\n\nThe `id` attribute is the key that should be used in other parts of the Beacon Model to allow Beacon clients to identify the different parts (e.g. endpoints, filteringTerms, request parameters, etc.) that fully describe an entry type.", + "type": "object", + "$comment": "TO DO: The tagged parts should reference to `common/ontologizedElement.json`. But that configuration fails to validate. Further investigation is required, but should not affect the resulting schema.", "properties": { "$schema": { "$ref": "../common/beaconCommonComponents.json#/definitions/$schema" }, - "aCollectionOf": { - "description": "If the entry type is a collection of other entry types, (e.g. a Dataset is a collection of Records), then this attribute must list the entry types that could be included. One collection type could be defined as included more than one entry type (e.g. a Dataset could include Individuals or Genomic Variants), in such cases the entries are alternative, meaning that a given instance of this entry type could be of only one of the types (e.g. a given Dataset contains Individuals, while another Dataset could contain Genomic Variants, but not both at once).", - "includedConcepts": { - "$ref": "../common/basicElement.json", - "type": "array" - } + "id": { + "$comments": "++++++ THIS IS THE START OF THE ontologized element ++++++", + "type": "string", + "description": "A (unique) identifier of the element." + }, + "name": { + "type": "string", + "description": "A distinctive name for the element." + }, + "description": { + "type": "string", + "description": "A textual description for the element." + }, + "ontologyTermForThisType": { + "$ref": "../common/ontologyTerm.json", + "$comments": "++++++ THIS IS THE END OF THE ontologized element ++++++" + }, + "partOfSpecification": { + "description": "This is label to group together entry types that are part of the same specification.", + "type": "string", + "example": "Beacon v2.0" + }, + "defaultSchema": { + "description": "Description of the default schema used for this concept.", + "$ref": "../common/referenceToAnSchema.json" }, "additionallySupportedSchemas": { "description": "List of additional schemas that could be used for this concept in this instance of Beacon.", + "type": "array", "items": { "$ref": "../common/referenceToAnSchema.json" - }, - "type": "array" - }, - "defaultSchema": { - "$ref": "../common/referenceToAnSchema.json", - "description": "Description of the default schema used for this concept." + } }, - "description": { - "description": "A textual description for the element.", - "type": "string" + "aCollectionOf": { + "description": "If the entry type is a collection of other entry types, (e.g. a Dataset is a collection of Records), then this attribute must list the entry types that could be included. One collection type could be defined as included more than one entry type (e.g. a Dataset could include Individuals or Genomic Variants), in such cases the entries are alternative, meaning that a given instance of this entry type could be of only one of the types (e.g. a given Dataset contains Individuals, while another Dataset could contain Genomic Variants, but not both at once).", + "includedConcepts": { + "type": "array", + "$ref": "../common/basicElement.json" + } }, "filteringTerms": { - "$comment": "TO DO: Double-check the proper way of referencing a path or relative path. 'format: uri' is throwing validation errors for relative file paths", "description": "Reference to the file with the list of filtering terms that could be used to filter this concept in this instance of Beacon. The referenced file could be used to populate the `filteringTerms`endpoint. Having it independently should allow for updating the list of accepted filtering terms when it is necessary.", - "type": "string" - }, - "id": { - "$comments": "++++++ THIS IS THE START OF THE ontologized element ++++++", - "description": "A (unique) identifier of the element.", - "type": "string" - }, - "name": { - "description": "A distinctive name for the element.", - "type": "string" + "type": "string", + "$comment": "TO DO: Double-check the proper way of referencing a path or relative path. 'format: uri' is throwing validation errors for relative file paths" }, "nonFilteredQueriesAllowed": { "$ref": "../common/beaconCommonComponents.json#/definitions/NonFilteredQueriesAllowed" - }, - "ontologyTermForThisType": { - "$comments": "++++++ THIS IS THE END OF THE ontologized element ++++++", - "$ref": "../common/ontologyTerm.json" - }, - "partOfSpecification": { - "description": "This is label to group together entry types that are part of the same specification.", - "example": "Beacon v2.0", - "type": "string" } }, "required": [ @@ -63,6 +64,5 @@ "partOfSpecification", "defaultSchema" ], - "title": "", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/configuration/entryTypesSchema.json b/bycon/schemas/framework/json/configuration/entryTypesSchema.json index 7e6c47285..cf429ebe0 100644 --- a/bycon/schemas/framework/json/configuration/entryTypesSchema.json +++ b/bycon/schemas/framework/json/configuration/entryTypesSchema.json @@ -1,26 +1,26 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "List of Entry Types schema", + "description": "Schema for the Enrty Types list.", + "type": "object", + "properties": { + "entryTypes": { + "description": "List of entry types.", + "$ref": "#/definitions/EntryTypes" + } + }, "definitions": { "EntryTypes": { + "description": "This is a dictionary of the entry types implemented in this Beacon instance.", "additionalProperties": { - "$ref": "./entryTypeDefinition.json", - "type": "object" + "type": "object", + "$ref": "./entryTypeDefinition.json" }, - "description": "This is a dictionary of the entry types implemented in this Beacon instance.", "minProperties": 1 } }, - "description": "Schema for the Enrty Types list.", - "properties": { - "entryTypes": { - "$ref": "#/definitions/EntryTypes", - "description": "List of entry types." - } - }, "required": [ "entryTypes" ], - "title": "List of Entry Types schema", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/configuration/examples/beaconConfiguration-example.json b/bycon/schemas/framework/json/configuration/examples/beaconConfiguration-example.json index bd8826557..c30fbff51 100644 --- a/bycon/schemas/framework/json/configuration/examples/beaconConfiguration-example.json +++ b/bycon/schemas/framework/json/configuration/examples/beaconConfiguration-example.json @@ -1,62 +1,62 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "maturityAttributes": { + "productionStatus": "DEV" + }, + "securityAttributes": { + "defaultGranularity": "boolean", + "securityLevels": [ + "PUBLIC", + "REGISTERED", + "CONTROLLED" + ] + }, "entryTypes": { "dataset": { - "aCollectionOf": [ - { - "id": "exampleEntry", - "name": "Example entries" - } - ], - "additionallySupportedSchemas": [], + "id": "dataset", + "name": "Dataset", + "ontologyTermForThisType": { + "id": "NCIT:C47824", + "label": "Data set" + }, + "partOfSpecification": "Beacon v2.0", + "description": "A Dataset is a collection of records, like rows in a database or cards in a cardholder.", "defaultSchema": { "id": "datasetDefaultSchema", "name": "Default schema for datasets", "referenceToSchemaDefinition": "./datasets/defaultSchema.json", "schemaVersion": "v.2" }, - "description": "A Dataset is a collection of records, like rows in a database or cards in a cardholder.", + "aCollectionOf": [ + { + "id": "exampleEntry", + "name": "Example entries" + } + ], "endpoint": "/datasets", "filteringTermsReference": "./datasets/filteringTerms.json", - "id": "dataset", - "name": "Dataset", - "nonFilteredQueriesAllowed": true, - "ontologyTermForThisType": { - "id": "NCIT:C47824", - "label": "Data set" - }, - "partOfSpecification": "Beacon v2.0" + "additionallySupportedSchemas": [], + "nonFilteredQueriesAllowed": true }, "exampleEntry": { - "additionallySupportedSchemas": [], + "id": "exampleEntry", + "name": "Example Entry", + "ontologyTermForThisType": { + "id": "NCIT:C20181", + "label": "Conceptual Entity" + }, + "partOfSpecification": "Beacon v2.0", + "description": "A generic entry type to allow testing and playing with the specification.", "defaultSchema": { "id": "ExampleEntryTypeDefaultschema", "name": "Default schema for an example entries", "referenceToSchemaDefinition": "./exampleEntry/defaultSchema.json", "schemaVersion": "v.2" }, - "description": "A generic entry type to allow testing and playing with the specification.", "endpoint": "./exampleEntries", "filteringTermsReference": "./exampleEntry/filteringTerms.json", - "id": "exampleEntry", - "name": "Example Entry", - "nonFilteredQueriesAllowed": false, - "ontologyTermForThisType": { - "id": "NCIT:C20181", - "label": "Conceptual Entity" - }, - "partOfSpecification": "Beacon v2.0" + "additionallySupportedSchemas": [], + "nonFilteredQueriesAllowed": false } - }, - "maturityAttributes": { - "productionStatus": "DEV" - }, - "securityAttributes": { - "defaultGranularity": "boolean", - "securityLevels": [ - "PUBLIC", - "REGISTERED", - "CONTROLLED" - ] } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/configuration/examples/beaconMap-example.json b/bycon/schemas/framework/json/configuration/examples/beaconMap-example.json index 6d3137515..546d61626 100644 --- a/bycon/schemas/framework/json/configuration/examples/beaconMap-example.json +++ b/bycon/schemas/framework/json/configuration/examples/beaconMap-example.json @@ -2,24 +2,24 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "endpointSets": { "dataset": { + "entryType": "dataset", + "openAPIEndpointsDefinition": "./datasets/endpoints.json", + "rootUrl": "https://exampleBeacons.org/datasets", + "singleEntryUrl": "https://exampleBeacons.org/datasets/{id}", + "filteringTermsUrl": "https://exampleBeacons.org/datasets/{id}/filteringTerms", "endpoints": { "exampleEntries": { "returnedEntryType": "exampleEntry", "url": "https://exampleBeacons.org/datasets/{id}/exampleEntries" } - }, - "entryType": "dataset", - "filteringTermsUrl": "https://exampleBeacons.org/datasets/{id}/filteringTerms", - "openAPIEndpointsDefinition": "./datasets/endpoints.json", - "rootUrl": "https://exampleBeacons.org/datasets", - "singleEntryUrl": "https://exampleBeacons.org/datasets/{id}" + } }, "exampleEntry": { "entryType": "exampleEntry", - "filteringTermsUrl": "https://exampleBeacons.org/exampleEntries/{id}/filteringTerms", "openAPIEndpointsDefinition": "./exampleEntries/endpoints.json", "rootUrl": "https://exampleBeacons.org/exampleEntries", - "singleEntryUrl": "https://exampleBeacons.org/exampleEntries/{id}" + "singleEntryUrl": "https://exampleBeacons.org/exampleEntries/{id}", + "filteringTermsUrl": "https://exampleBeacons.org/exampleEntries/{id}/filteringTerms" } } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/configuration/examples/entriesCollectionDefinition_MIN_example.json b/bycon/schemas/framework/json/configuration/examples/entriesCollectionDefinition_MIN_example.json index f92434d1f..c8d0a2ad3 100644 --- a/bycon/schemas/framework/json/configuration/examples/entriesCollectionDefinition_MIN_example.json +++ b/bycon/schemas/framework/json/configuration/examples/entriesCollectionDefinition_MIN_example.json @@ -1,22 +1,22 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "aCollectionOf": [ - { - "id": "exampleEntry", - "name": "Example entries" - } - ], - "defaultSchema": { - "id": "datasetDefaultSchema", - "name": "Default schema for datasets", - "referenceToSchemaDefinition": "./datasets/defaultSchema.json", - "schemaVersion": "v.2" - }, "id": "dataset", "name": "Dataset", "ontologyTermForThisType": { "id": "NCIT:C47824", "label": "Data set" }, - "partOfSpecification": "Beacon v2.0" + "partOfSpecification": "Beacon v2.0", + "defaultSchema": { + "id": "datasetDefaultSchema", + "name": "Default schema for datasets", + "referenceToSchemaDefinition": "./datasets/defaultSchema.json", + "schemaVersion": "v.2" + }, + "aCollectionOf": [ + { + "id": "exampleEntry", + "name": "Example entries" + } + ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/configuration/examples/entriesCollectionDefinition_example.json b/bycon/schemas/framework/json/configuration/examples/entriesCollectionDefinition_example.json index 6d7de6547..335790cdb 100644 --- a/bycon/schemas/framework/json/configuration/examples/entriesCollectionDefinition_example.json +++ b/bycon/schemas/framework/json/configuration/examples/entriesCollectionDefinition_example.json @@ -1,34 +1,34 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "id": "dataset", + "name": "Dataset", + "ontologyTermForThisType": { + "id": "NCIT:C47824", + "label": "Data set" + }, + "partOfSpecification": "Beacon v2.0", + "description": "A Dataset is a collection of records, like rows in a database or cards in a cardholder.", + "defaultSchema": { + "id": "datasetDefaultSchema", + "name": "Default schema for datasets", + "referenceToSchemaDefinition": "./datasets/defaultSchema.json", + "schemaVersion": "v.2" + }, "aCollectionOf": [ { "id": "exampleEntry", "name": "Example entries" } ], + "endpoint": "/datasets", + "filteringTermsReference": "./datasets/filteringTerms.json", "additionallySupportedSchemas": [ { - "description": "ATLAS is an open source software tool for researchers to conduct scientific analyses on standardized observational data converted to the OMOP Common Data Model V5.", "id": "ohdsi-atlas-cohort", "name": "OHDSI ATLAS Cohort", + "description": "ATLAS is an open source software tool for researchers to conduct scientific analyses on standardized observational data converted to the OMOP Common Data Model V5.", "referenceToSchemaDefinition": "https://raw.githubusercontent.com/OHDSIBr/ATLAS-JSON-Schema/2.7.4/single/atlas_cohort_definition.json", "schemaVersion": "2.7.4" } - ], - "defaultSchema": { - "id": "datasetDefaultSchema", - "name": "Default schema for datasets", - "referenceToSchemaDefinition": "./datasets/defaultSchema.json", - "schemaVersion": "v.2" - }, - "description": "A Dataset is a collection of records, like rows in a database or cards in a cardholder.", - "endpoint": "/datasets", - "filteringTermsReference": "./datasets/filteringTerms.json", - "id": "dataset", - "name": "Dataset", - "ontologyTermForThisType": { - "id": "NCIT:C47824", - "label": "Data set" - }, - "partOfSpecification": "Beacon v2.0" + ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/configuration/examples/entryTypeDefinition-MIN-example.json b/bycon/schemas/framework/json/configuration/examples/entryTypeDefinition-MIN-example.json index c6134fb2a..e58098c1b 100644 --- a/bycon/schemas/framework/json/configuration/examples/entryTypeDefinition-MIN-example.json +++ b/bycon/schemas/framework/json/configuration/examples/entryTypeDefinition-MIN-example.json @@ -1,15 +1,15 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "defaultSchema": { - "id": "bdfGenericEntryType-v2", - "name": "Beacon v2 default schema for a basic element.", - "referenceToSchemaDefinition": "https://raw.githubusercontent.com/ga4gh-beacon/specification-v2-default-schemas/master/default_dataset_schema.json" - }, "id": "individual", "name": "Individual entry", "ontologyTermForThisType": { "id": "DUO:0000004", "label": "General Research Use" }, - "partOfSpecification": "Beacon v2" + "partOfSpecification": "Beacon v2", + "defaultSchema": { + "id": "bdfGenericEntryType-v2", + "name": "Beacon v2 default schema for a basic element.", + "referenceToSchemaDefinition": "https://raw.githubusercontent.com/ga4gh-beacon/specification-v2-default-schemas/master/default_dataset_schema.json" + } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/configuration/filteringTermsSchema.json b/bycon/schemas/framework/json/configuration/filteringTermsSchema.json index 462e04b2f..18d112294 100644 --- a/bycon/schemas/framework/json/configuration/filteringTermsSchema.json +++ b/bycon/schemas/framework/json/configuration/filteringTermsSchema.json @@ -1,66 +1,66 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Filtering Terms schema", + "description": "Schema for the Filtering Terms list related to the hosting entry type. It is kept separated to allow updating it independently.", + "type": "object", + "properties": { + "filteringTerms": { + "description": "List of filtering terms that could be used to filter this concept in this instance of Beacon.", + "type": "array", + "items": { + "$ref": "#/definitions/FilterTerm" + }, + "minItems": 0 + } + }, "definitions": { "FilterTerm": { + "type": "object", "properties": { "ftType": { "description": "Type of filter term, according to the 'request/filteringTerms.json' schema. * 'ontologyTerm' is a term that belongs to a tree of concepts, hence suitable to operations like 'query by similarity' or 'include all descendants'. Many ontology terms are a value in itself (like 'female'), hence no further information is required to solve the query. * 'alphanumeric' is a field or an ontology term (like 'age') that requires a value to complete the intended query. Only attributes of known schemas SHOULD be used here. For attributes that are not part of the known schemas, the 'custom' type MUST be used. * 'custom' is anything that doesn't fit the previous categories and mainly for custom dictionaries that have no ontology nor a corresponding attribute in the known schemas. Usually only makes sense for close partners that are familiar with the custom dictionary.", + "type": "string", "enum": [ "ontologyTerm", "alphanumeric", "custom" - ], - "type": "string" + ] }, "id": { + "type": "string", "description": "Term ID, Field ID or custom term string. For term ID use CURIE syntax where possible.", "examples": [ "HP:0002664", "age", "demographic.ethnicity:subsaharan" - ], - "type": "string" + ] }, "label": { + "type": "string", "description": "Label for the ontology term. For other `ftTypes` add a readable description", "examples": [ "Neoplasm", "age in days", "Ethnic origin from South of the Sahara Desert." - ], - "type": "string" + ] }, "scope": { + "type": "string", "description": "The entry type to which the filter applies", "examples": [ "biosample", "individual" - ], - "type": "string" + ] } }, "required": [ "ftType", "id" - ], - "type": "object" - } - }, - "description": "Schema for the Filtering Terms list related to the hosting entry type. It is kept separated to allow updating it independently.", - "properties": { - "filteringTerms": { - "description": "List of filtering terms that could be used to filter this concept in this instance of Beacon.", - "items": { - "$ref": "#/definitions/FilterTerm" - }, - "minItems": 0, - "type": "array" + ] } }, "required": [ "filteringTerms" ], - "title": "Filtering Terms schema", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/endpoints.json b/bycon/schemas/framework/json/endpoints.json index 420171ada..822a0fc55 100644 --- a/bycon/schemas/framework/json/endpoints.json +++ b/bycon/schemas/framework/json/endpoints.json @@ -1,232 +1,232 @@ { - "components": { - "parameters": { - "limit": { - "in": "query", - "name": "limit", - "schema": { - "$ref": "./common/beaconCommonComponents.json#/definitions/Limit" - } - }, - "requestedSchema": { - "description": "Schema to be used to format the `result` field in the resposne. The response will use Beacon format.", - "example": "ga4gh-service-info-v1.0", - "in": "query", - "name": "requestedSchema", - "required": false, - "schema": { - "type": "string" - } - }, - "skip": { - "in": "query", - "name": "skip", - "schema": { - "$ref": "./common/beaconCommonComponents.json#/definitions/Skip" - } - } - }, - "responses": { - "infoOKResponse": { - "content": { - "application/json": { - "schema": { - "$ref": "./responses/beaconInfoResponse.json", - "description": "Response of a request for information about a Beacon." - } - } - }, - "description": "Successful operation." - } - } - }, + "openapi": "3.0.2", + "servers": [], "info": { + "version": "2.0.0", + "title": "GA4GH Beacon API Specification", + "description": "A Beacon is a web service for genetic data sharing that can be queried for information about variants, individuals, biosamples, and other entities.", "contact": { "email": "beacon@ga4gh.org" }, - "description": "A Beacon is a web service for genetic data sharing that can be queried for information about variants, individuals, biosamples, and other entities.", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "title": "GA4GH Beacon API Specification", - "version": "2.0.0" + } }, - "openapi": "3.0.2", "paths": { "/": { + "parameters": [ + { + "$ref": "#/components/parameters/requestedSchema" + } + ], "get": { "description": "Get information about the beacon", "operationId": "getBeaconRoot", + "tags": [ + "Informational endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/infoOKResponse" }, "default": { - "$ref": "./responses/beaconErrorResponse.json", - "description": "An unsuccessful operation." + "description": "An unsuccessful operation.", + "$ref": "./responses/beaconErrorResponse.json" } - }, - "tags": [ - "Informational endpoints" - ] - }, + } + } + }, + "/info": { "parameters": [ { "$ref": "#/components/parameters/requestedSchema" } - ] - }, - "/configuration": { + ], "get": { - "description": "TBD", - "operationId": "getBeaconConfiguration", + "description": "Get information about the beacon", + "operationId": "getBeaconInfoRoot", + "tags": [ + "Informational endpoints" + ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "./responses/beaconConfigurationResponse.json", - "description": "Response of a request for information about a Beacon" - } - } - }, - "description": "Successful operation." + "$ref": "#/components/responses/infoOKResponse" }, "default": { - "$ref": "./responses/beaconErrorResponse.json", - "description": "An unsuccessful operation." + "description": "An unsuccessful operation.", + "$ref": "./responses/beaconErrorResponse.json" } - }, - "tags": [ - "Configuration" - ] + } } }, - "/entry_types": { + "/service-info": { "get": { - "description": "TBD", - "operationId": "getEntryTypes", - "parameters": [], + "description": "Get information about the beacon using GA4GH ServiceInfo format", + "operationId": "getBeaconServiceInfo", + "tags": [ + "Informational endpoints" + ], "responses": { "200": { + "description": "Successful operation", "content": { "application/json": { "schema": { - "$ref": "./responses/beaconEntryTypesResponse.json", - "description": "Response of a request for information about a Beacon" + "$ref": "./responses/ga4gh-service-info-1-0-0-schema.json" } } - }, - "description": "Successful operation." - }, - "default": { - "$ref": "./responses/beaconErrorResponse.json", - "description": "An unsuccessful operation." + } } - }, - "tags": [ - "Configuration" - ] + } } }, - "/filtering_terms": { + "/configuration": { "get": { - "description": "Get the list of filtering terms handled by this beacon", - "operationId": "getFilteringTerms", - "responses": { - "200": { - "$ref": "./responses/beaconFilteringTermsResponse.json" - }, - "default": { - "$ref": "./responses/beaconErrorResponse.json", - "description": "An unsuccessful operation." - } - }, + "description": "TBD", + "operationId": "getBeaconConfiguration", "tags": [ - "Informational endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/limit" - } - ] - }, - "/info": { - "get": { - "description": "Get information about the beacon", - "operationId": "getBeaconInfoRoot", + "Configuration" + ], "responses": { "200": { - "$ref": "#/components/responses/infoOKResponse" + "description": "Successful operation.", + "content": { + "application/json": { + "schema": { + "description": "Response of a request for information about a Beacon", + "$ref": "./responses/beaconConfigurationResponse.json" + } + } + } }, "default": { - "$ref": "./responses/beaconErrorResponse.json", - "description": "An unsuccessful operation." + "description": "An unsuccessful operation.", + "$ref": "./responses/beaconErrorResponse.json" } - }, - "tags": [ - "Informational endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/requestedSchema" } - ] + } }, "/map": { "get": { "description": "TBD", "operationId": "getBeaconMap", + "tags": [ + "Configuration" + ], "parameters": [], "responses": { "200": { + "description": "Successful operation.", "content": { "application/json": { "schema": { - "$ref": "./responses/beaconMapResponse.json", - "description": "Response of a request for information about a Beacon" + "description": "Response of a request for information about a Beacon", + "$ref": "./responses/beaconMapResponse.json" } } - }, - "description": "Successful operation." + } }, "default": { - "$ref": "./responses/beaconErrorResponse.json", - "description": "An unsuccessful operation." + "description": "An unsuccessful operation.", + "$ref": "./responses/beaconErrorResponse.json" } - }, - "tags": [ - "Configuration" - ] + } } }, - "/service-info": { + "/entry_types": { "get": { - "description": "Get information about the beacon using GA4GH ServiceInfo format", - "operationId": "getBeaconServiceInfo", + "description": "TBD", + "operationId": "getEntryTypes", + "tags": [ + "Configuration" + ], + "parameters": [], "responses": { "200": { + "description": "Successful operation.", "content": { "application/json": { "schema": { - "$ref": "./responses/ga4gh-service-info-1-0-0-schema.json" + "description": "Response of a request for information about a Beacon", + "$ref": "./responses/beaconEntryTypesResponse.json" } } - }, - "description": "Successful operation" + } + }, + "default": { + "description": "An unsuccessful operation.", + "$ref": "./responses/beaconErrorResponse.json" } + } + } + }, + "/filtering_terms": { + "parameters": [ + { + "$ref": "#/components/parameters/skip" }, + { + "$ref": "#/components/parameters/limit" + } + ], + "get": { + "description": "Get the list of filtering terms handled by this beacon", + "operationId": "getFilteringTerms", "tags": [ "Informational endpoints" - ] + ], + "responses": { + "200": { + "$ref": "./responses/beaconFilteringTermsResponse.json" + }, + "default": { + "description": "An unsuccessful operation.", + "$ref": "./responses/beaconErrorResponse.json" + } + } } } }, - "servers": [] + "components": { + "responses": { + "infoOKResponse": { + "description": "Successful operation.", + "content": { + "application/json": { + "schema": { + "description": "Response of a request for information about a Beacon.", + "$ref": "./responses/beaconInfoResponse.json" + } + } + } + } + }, + "parameters": { + "requestedSchema": { + "name": "requestedSchema", + "description": "Schema to be used to format the `result` field in the resposne. The response will use Beacon format.", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "example": "ga4gh-service-info-v1.0" + }, + "skip": { + "name": "skip", + "in": "query", + "schema": { + "$ref": "./common/beaconCommonComponents.json#/definitions/Skip" + } + }, + "limit": { + "name": "limit", + "in": "query", + "schema": { + "$ref": "./common/beaconCommonComponents.json#/definitions/Limit" + } + } + } + } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/requests/beaconRequestBody.json b/bycon/schemas/framework/json/requests/beaconRequestBody.json index ee9a60070..4e9702f7f 100644 --- a/bycon/schemas/framework/json/requests/beaconRequestBody.json +++ b/bycon/schemas/framework/json/requests/beaconRequestBody.json @@ -1,46 +1,46 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Schema for the Beacon request. It is named `RequestBody` to keep the same nomenclature used by OpenAPI v3, but it actually contains the definition of the whole HTTP POST request payload.", + "type": "object", "properties": { "$schema": { "$ref": "../common/beaconCommonComponents.json#/definitions/$schema" }, "meta": { - "$ref": "./beaconRequestMeta.json", - "description": "Information that is relevant to build the response." + "description": "Information that is relevant to build the response.", + "$ref": "./beaconRequestMeta.json" }, "query": { "description": "Parameters to limit the list of returned results.", + "type": "object", "properties": { + "requestParameters": { + "description": "TBD", + "$ref": "./requestParameters.json" + }, "filters": { - "$ref": "./filteringTerms.json", - "description": "Ontology based filters. Using CURIE syntax is encouraged." + "description": "Ontology based filters. Using CURIE syntax is encouraged.", + "$ref": "./filteringTerms.json" }, "includeResultsetResponses": { "$ref": "../common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" }, "pagination": { - "$ref": "../common/beaconCommonComponents.json#/definitions/Pagination", - "description": "Pagination to apply on the results." - }, - "requestParameters": { - "$ref": "./requestParameters.json", - "description": "TBD" + "description": "Pagination to apply on the results.", + "$ref": "../common/beaconCommonComponents.json#/definitions/Pagination" }, "requestedGranularity": { - "$ref": "../common/beaconCommonComponents.json#/definitions/Granularity", - "description": "Requested granularity. Targeted Beacon could respond or not with the requested granularity. E.g. record level granularity could be requested, but the Beacon could respond only with boolean or count results." + "description": "Requested granularity. Targeted Beacon could respond or not with the requested granularity. E.g. record level granularity could be requested, but the Beacon could respond only with boolean or count results.", + "$ref": "../common/beaconCommonComponents.json#/definitions/Granularity" }, "testMode": { - "$ref": "../common/beaconCommonComponents.json#/definitions/TestMode", - "description": "Used for indicating that a request or response is done in a test context. Purposed for compliance testing." + "description": "Used for indicating that a request or response is done in a test context. Purposed for compliance testing.", + "$ref": "../common/beaconCommonComponents.json#/definitions/TestMode" } - }, - "type": "object" + } } }, "required": [ "meta" - ], - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/requests/beaconRequestMeta.json b/bycon/schemas/framework/json/requests/beaconRequestMeta.json index 79b6a6e87..877d8d72d 100644 --- a/bycon/schemas/framework/json/requests/beaconRequestMeta.json +++ b/bycon/schemas/framework/json/requests/beaconRequestMeta.json @@ -1,21 +1,21 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Meta section of the Beacon request. It includes request context details relevant for the Beacon server when processing the request.", + "type": "object", "properties": { "$schema": { "$ref": "../common/beaconCommonComponents.json#/definitions/$schema" }, "apiVersion": { - "$ref": "../common/beaconCommonComponents.json#/definitions/ApiVersion", - "description": "API version expected by the client to be supported by the server and used in the response format." + "description": "API version expected by the client to be supported by the server and used in the response format.", + "$ref": "../common/beaconCommonComponents.json#/definitions/ApiVersion" }, "requestedSchemas": { - "$ref": "../common/beaconCommonComponents.json#/definitions/ListOfSchemas", - "description": "Set of schemas to be used in the response." + "description": "Set of schemas to be used in the response.", + "$ref": "../common/beaconCommonComponents.json#/definitions/ListOfSchemas" } }, "required": [ "apiVersion" - ], - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/requests/examples-fullDocuments/beaconRequestBody-MAX-example.json b/bycon/schemas/framework/json/requests/examples-fullDocuments/beaconRequestBody-MAX-example.json index 71a926c6d..a41b87fd5 100644 --- a/bycon/schemas/framework/json/requests/examples-fullDocuments/beaconRequestBody-MAX-example.json +++ b/bycon/schemas/framework/json/requests/examples-fullDocuments/beaconRequestBody-MAX-example.json @@ -10,6 +10,14 @@ ] }, "query": { + "requestParameters": { + "datasets": { + "datasetIds": [ + "DatasetXYZ", + "Dataset123" + ] + } + }, "filters": [ { "id": "EFO:0001212", @@ -18,18 +26,10 @@ ], "includeResultsetResponses": "HIT", "pagination": { - "limit": 10, - "skip": 0 - }, - "requestParameters": { - "datasets": { - "datasetIds": [ - "DatasetXYZ", - "Dataset123" - ] - } + "skip": 0, + "limit": 10 }, - "requestedGranularity": "boolean", - "testMode": false + "testMode": false, + "requestedGranularity": "boolean" } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/requests/examples-sections/filteringTerms-example.json b/bycon/schemas/framework/json/requests/examples-sections/filteringTerms-example.json index 2abfa2e21..2c49300d0 100644 --- a/bycon/schemas/framework/json/requests/examples-sections/filteringTerms-example.json +++ b/bycon/schemas/framework/json/requests/examples-sections/filteringTerms-example.json @@ -4,14 +4,14 @@ { "id": "HP:0002664", "includeDescendantTerms": true, - "scope": "biosamples", - "similarity": "exact" + "similarity": "exact", + "scope": "biosamples" }, { "id": "age", "operator": ">=", - "scope": "individuals", - "value": "P70Y" + "value": "P70Y", + "scope": "individuals" }, { "id": "demographic.ethnicity:asian", diff --git a/bycon/schemas/framework/json/requests/examples-sections/requestParameters-example.json b/bycon/schemas/framework/json/requests/examples-sections/requestParameters-example.json index f29e68ee6..c7f65cb91 100644 --- a/bycon/schemas/framework/json/requests/examples-sections/requestParameters-example.json +++ b/bycon/schemas/framework/json/requests/examples-sections/requestParameters-example.json @@ -2,12 +2,12 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "exampleEntry": { "description": "All the required fields to query any kind of variant (e.g. SNP, DUP,\netc.).", + "type": "object", "properties": { "id": { "description": "Id of the entry to display.", "type": "string" } - }, - "type": "object" + } } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/requests/filteringTerms.json b/bycon/schemas/framework/json/requests/filteringTerms.json index d0de392e5..3cf318638 100644 --- a/bycon/schemas/framework/json/requests/filteringTerms.json +++ b/bycon/schemas/framework/json/requests/filteringTerms.json @@ -1,66 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Filtering Term Element", + "description": "Filtering terms are the main means to select subsets of records from a Beacon response. While the name implies the application to a generated response, in practice implementations may apply them at the query stage. Note: In the processing of Beacon v2.0 requests multiple filters are assumed to be chained by the logical AND operator.", + "type": "array", + "items": { + "$ref": "#/definitions/FilteringTerm" + }, "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" - }, - "scope": { - "description": "The entry type to which the filter applies", - "example": "biosamples", - "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" - }, - "scope": { - "description": "The entry type to which the filter applies", - "example": "biosamples", - "type": "string" - } - }, - "required": [ - "id" - ], - "type": "object" - }, "FilteringTerm": { "anyOf": [ { @@ -75,50 +21,104 @@ ] }, "OntologyFilter": { + "type": "object", "description": "Filter results to include records that contain a specific ontology term.", + "required": [ + "id" + ], "properties": { - "excluded": { - "default": false, - "description": "Flag to indicate whether the phenotype was observed or not. The default is `false`. Provenance: Phenopackets, e.g. in PhenotypivcFeature Status: BeaconPlus", - "type": "boolean" - }, "id": { + "type": "string", "description": "Term ID to be queried, using CURIE syntax where possible.", - "example": "HP:0002664", - "type": "string" + "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`.", - "type": "boolean" - }, - "scope": { - "description": "The entry type to which the filter applies", - "example": "biosamples", - "type": "string" + "description": "Define if the Beacon should implement the ontology hierarchy, thus query the descendant terms of `id`." }, "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.", + "type": "string", "enum": [ "exact", "high", "medium", "low" ], - "type": "string" + "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." + }, + "scope": { + "type": "string", + "description": "The entry type to which the filter applies", + "example": "biosamples" + }, + "excluded": { + "description": "Flag to indicate whether the phenotype was observed or not. The default is `false`. Provenance: Phenopackets, e.g. in PhenotypivcFeature Status: BeaconPlus", + "type": "boolean", + "default": false } - }, + } + }, + "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" + }, + "scope": { + "type": "string", + "description": "The entry type to which the filter applies", + "example": "biosamples" + } + } + }, + "CustomFilter": { + "type": "object", + "description": "Filter results to include records that contain a custom term defined by this Beacon.", "required": [ "id" ], - "type": "object" + "properties": { + "id": { + "type": "string", + "description": "Custom filter terms should contain a unique identifier.", + "example": "demographic.ethnicity:asian" + }, + "scope": { + "type": "string", + "description": "The entry type to which the filter applies", + "example": "biosamples" + } + } } }, - "description": "Filtering terms are the main means to select subsets of records from a Beacon response. While the name implies the application to a generated response, in practice implementations may apply them at the query stage. Note: In the processing of Beacon v2.0 requests multiple filters are assumed to be chained by the logical AND operator.", - "items": { - "$ref": "#/definitions/FilteringTerm" - }, - "title": "Filtering Term Element", - "type": "array" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/requests/requestParameters.json b/bycon/schemas/framework/json/requests/requestParameters.json index f08bcff36..7a47e37f3 100644 --- a/bycon/schemas/framework/json/requests/requestParameters.json +++ b/bycon/schemas/framework/json/requests/requestParameters.json @@ -1,14 +1,14 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": { - "type": "object" - }, "description": "The schema below is suited for a dictionary 'key':'object', which is the case of the parameter definitions.", + "type": "object", "properties": { "$schema": { - "description": "Added here to allow proper validation of the documents.", - "type": "string" + "type": "string", + "description": "Added here to allow proper validation of the documents." } }, - "type": "object" + "additionalProperties": { + "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/requests/validation/filteringTerms.json b/bycon/schemas/framework/json/requests/validation/filteringTerms.json index e4d51516e..3900c44db 100644 --- a/bycon/schemas/framework/json/requests/validation/filteringTerms.json +++ b/bycon/schemas/framework/json/requests/validation/filteringTerms.json @@ -1,18 +1,76 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, + "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", - "type": "string" + "example": "age" }, "operator": { - "default": "=", - "description": "Defines how the value relates to the field `id`.", + "type": "string", "enum": [ "=", "<", @@ -21,89 +79,31 @@ ">=", "<=" ], - "example": ">", - "type": "string" + "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", - "type": "string" + "example": "P70Y" } - }, - "required": [ - "id", - "operator", - "value" - ], - "type": "object" + } }, "CustomFilter": { + "type": "object", "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" + "type": "string", + "description": "Custom filter terms should contain a unique identifier.", + "example": "demographic.ethnicity:asian" } - }, - "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" + "additionalProperties": false } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/beaconBooleanResponse.json b/bycon/schemas/framework/json/responses/beaconBooleanResponse.json index 626f3bfcb..0335d9857 100644 --- a/bycon/schemas/framework/json/responses/beaconBooleanResponse.json +++ b/bycon/schemas/framework/json/responses/beaconBooleanResponse.json @@ -1,27 +1,27 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Complete definition for a minimal response that does *only* a `boolean` exists true|false answer.", + "type": "object", + "required": [ + "meta", + "responseSummary" + ], "properties": { - "beaconHandovers": { - "$ref": "../common/beaconCommonComponents.json#/definitions/ListOfHandovers", - "description": "List of handovers that apply to the whole response, not to any resultset or result in particular." - }, - "info": { - "$ref": "../common/beaconCommonComponents.json#/definitions/Info", - "description": "Additional details that could be of interest. Provided to clearly enclose any attribute that is not part of the Beacon specification." - }, "meta": { - "$ref": "./sections/beaconResponseMeta.json", - "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results." + "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results.", + "$ref": "./sections/beaconResponseMeta.json" }, "responseSummary": { - "$ref": "./sections/beaconBooleanResponseSection.json", - "description": "Boolean (true/false) response section." + "description": "Boolean (true/false) response section.", + "$ref": "./sections/beaconBooleanResponseSection.json" + }, + "info": { + "description": "Additional details that could be of interest. Provided to clearly enclose any attribute that is not part of the Beacon specification.", + "$ref": "../common/beaconCommonComponents.json#/definitions/Info" + }, + "beaconHandovers": { + "description": "List of handovers that apply to the whole response, not to any resultset or result in particular.", + "$ref": "../common/beaconCommonComponents.json#/definitions/ListOfHandovers" } - }, - "required": [ - "meta", - "responseSummary" - ], - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/beaconCollectionsResponse.json b/bycon/schemas/framework/json/responses/beaconCollectionsResponse.json index 61f294744..120ccfd86 100644 --- a/bycon/schemas/framework/json/responses/beaconCollectionsResponse.json +++ b/bycon/schemas/framework/json/responses/beaconCollectionsResponse.json @@ -1,40 +1,32 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, "description": "Beacon response that includes details about the collections in this Beacon.", + "type": "object", "properties": { - "beaconHandovers": { - "$ref": "../common/beaconCommonComponents.json#/definitions/ListOfHandovers", - "description": "List of handovers that apply to the whole response, not to any resultset or result in particular." - }, - "info": { - "$ref": "../common/beaconCommonComponents.json#/definitions/Info", - "description": "Additional details that could be of interest. Provided to clearly enclose any attribute that is not part of the Beacon specification." - }, "meta": { - "$ref": "./sections/beaconResponseMeta.json", - "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results." + "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results.", + "$ref": "./sections/beaconResponseMeta.json" + }, + "responseSummary": { + "description": "Response summary, including Boolean and optionally results count.", + "$ref": "./sections/beaconSummaryResponseSection.json" }, "response": { - "additionalProperties": true, "description": "Returning the Beacon Collections list, filtered or unfiltered.", + "type": "object", "properties": { "collections": { + "type": "array", "items": { "type": "object" }, - "minItems": 0, - "type": "array" + "minItems": 0 } }, "required": [ "collections" ], - "type": "object" - }, - "responseSummary": { - "$ref": "./sections/beaconSummaryResponseSection.json", - "description": "Response summary, including Boolean and optionally results count." + "additionalProperties": true } }, "required": [ @@ -42,5 +34,5 @@ "responseSummary", "response" ], - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/beaconConfigurationResponse.json b/bycon/schemas/framework/json/responses/beaconConfigurationResponse.json index ccd15687e..813fa0793 100644 --- a/bycon/schemas/framework/json/responses/beaconConfigurationResponse.json +++ b/bycon/schemas/framework/json/responses/beaconConfigurationResponse.json @@ -1,20 +1,20 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "type": "object", "description": "Information about the Beacon. Aimed to Beacon clients like web pages or Beacon networks.", "properties": { "meta": { - "$ref": "./sections/beaconInformationalResponseMeta.json", - "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results." + "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results.", + "$ref": "./sections/beaconInformationalResponseMeta.json" }, "response": { - "$ref": "../configuration/beaconConfigurationSchema.json", - "description": "Returning the Beacon configuration." + "description": "Returning the Beacon configuration.", + "$ref": "../configuration/beaconConfigurationSchema.json" } }, "required": [ "meta", "response" ], - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/beaconCountResponse.json b/bycon/schemas/framework/json/responses/beaconCountResponse.json index 9b45e704c..6bc0209cd 100644 --- a/bycon/schemas/framework/json/responses/beaconCountResponse.json +++ b/bycon/schemas/framework/json/responses/beaconCountResponse.json @@ -1,27 +1,27 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Complete definition for a Response that does not include record level details and just `boolean` or `count` responses.", + "type": "object", + "required": [ + "meta", + "responseSummary" + ], "properties": { - "beaconHandovers": { - "$ref": "../common/beaconCommonComponents.json#/definitions/ListOfHandovers", - "description": "List of handovers that apply to the whole response, not to any resultset or result in particular." - }, - "info": { - "$ref": "../common/beaconCommonComponents.json#/definitions/Info", - "description": "Additional details that could be of interest. Provided to clearly enclose any attribute that is not part of the Beacon specification." - }, "meta": { - "$ref": "./sections/beaconResponseMeta.json", - "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results." + "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results.", + "$ref": "./sections/beaconResponseMeta.json" }, "responseSummary": { - "$ref": "./sections/beaconCountResponseSection.json", - "description": "Response summary, including Boolean and optionally results count." + "description": "Response summary, including Boolean and optionally results count.", + "$ref": "./sections/beaconCountResponseSection.json" + }, + "info": { + "description": "Additional details that could be of interest. Provided to clearly enclose any attribute that is not part of the Beacon specification.", + "$ref": "../common/beaconCommonComponents.json#/definitions/Info" + }, + "beaconHandovers": { + "description": "List of handovers that apply to the whole response, not to any resultset or result in particular.", + "$ref": "../common/beaconCommonComponents.json#/definitions/ListOfHandovers" } - }, - "required": [ - "meta", - "responseSummary" - ], - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/beaconEntryTypesResponse.json b/bycon/schemas/framework/json/responses/beaconEntryTypesResponse.json index 2c2cc5514..12160349b 100644 --- a/bycon/schemas/framework/json/responses/beaconEntryTypesResponse.json +++ b/bycon/schemas/framework/json/responses/beaconEntryTypesResponse.json @@ -1,20 +1,20 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "type": "object", "description": "Response including a list of Entry types definitions.", "properties": { "meta": { - "$ref": "./sections/beaconInformationalResponseMeta.json", - "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results." + "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results.", + "$ref": "./sections/beaconInformationalResponseMeta.json" }, "response": { - "$ref": "../configuration/entryTypesSchema.json", - "description": "Returning the Beacon Entry Types." + "description": "Returning the Beacon Entry Types.", + "$ref": "../configuration/entryTypesSchema.json" } }, "required": [ "meta", "response" ], - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/beaconErrorResponse.json b/bycon/schemas/framework/json/responses/beaconErrorResponse.json index ec4168323..ed91d6618 100644 --- a/bycon/schemas/framework/json/responses/beaconErrorResponse.json +++ b/bycon/schemas/framework/json/responses/beaconErrorResponse.json @@ -1,20 +1,20 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "type": "object", "description": "An unsuccessful operation.", "properties": { - "error": { - "$ref": "../common/beaconCommonComponents.json#/definitions/BeaconError", - "description": "Returning an error." - }, "meta": { - "$ref": "./sections/beaconResponseMeta.json", - "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results." + "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results.", + "$ref": "./sections/beaconResponseMeta.json" + }, + "error": { + "description": "Returning an error.", + "$ref": "../common/beaconCommonComponents.json#/definitions/BeaconError" } }, "required": [ "meta", "error" ], - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/beaconFilteringTermsResponse.json b/bycon/schemas/framework/json/responses/beaconFilteringTermsResponse.json index 1ed620126..6ce72ce24 100644 --- a/bycon/schemas/framework/json/responses/beaconFilteringTermsResponse.json +++ b/bycon/schemas/framework/json/responses/beaconFilteringTermsResponse.json @@ -1,20 +1,20 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "type": "object", "description": "List of filtering terms response.", "properties": { "meta": { - "$ref": "./sections/beaconInformationalResponseMeta.json", - "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results." + "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results.", + "$ref": "./sections/beaconInformationalResponseMeta.json" }, "response": { - "$ref": "./sections/beaconFilteringTermsResults.json", - "description": "Actual list of filtering terms." + "description": "Actual list of filtering terms.", + "$ref": "./sections/beaconFilteringTermsResults.json" } }, "required": [ "meta", "response" ], - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/beaconInfoResponse.json b/bycon/schemas/framework/json/responses/beaconInfoResponse.json index a221e746c..4d626a2f8 100644 --- a/bycon/schemas/framework/json/responses/beaconInfoResponse.json +++ b/bycon/schemas/framework/json/responses/beaconInfoResponse.json @@ -1,20 +1,20 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "type": "object", "description": "Information about the Beacon. Aimed at Beacon clients like web pages or Beacon networks.", "properties": { "meta": { - "$ref": "./sections/beaconInformationalResponseMeta.json", - "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results." + "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results.", + "$ref": "./sections/beaconInformationalResponseMeta.json" }, "response": { - "$ref": "./sections/beaconInfoResults.json", - "description": "Metadata describing a Beacon instance." + "description": "Metadata describing a Beacon instance.", + "$ref": "./sections/beaconInfoResults.json" } }, "required": [ "meta", "response" ], - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/beaconMapResponse.json b/bycon/schemas/framework/json/responses/beaconMapResponse.json index d915b4a29..7bf2b8aaa 100644 --- a/bycon/schemas/framework/json/responses/beaconMapResponse.json +++ b/bycon/schemas/framework/json/responses/beaconMapResponse.json @@ -1,20 +1,20 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "type": "object", "description": "Information about the Beacon. Aimed to Beacon clients like web pages or Beacon networks.", "properties": { "meta": { - "$ref": "./sections/beaconInformationalResponseMeta.json", - "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results." + "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results.", + "$ref": "./sections/beaconInformationalResponseMeta.json" }, "response": { - "$ref": "../configuration/beaconMapSchema.json", - "description": "Returning the Beacon Map." + "description": "Returning the Beacon Map.", + "$ref": "../configuration/beaconMapSchema.json" } }, "required": [ "meta", "response" ], - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/beaconResultsetsResponse.json b/bycon/schemas/framework/json/responses/beaconResultsetsResponse.json index 159fadaab..7cebe1fd6 100644 --- a/bycon/schemas/framework/json/responses/beaconResultsetsResponse.json +++ b/bycon/schemas/framework/json/responses/beaconResultsetsResponse.json @@ -1,27 +1,27 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, "description": "Beacon response that includes record level details, grouped in Resultsets.", + "type": "object", "properties": { - "beaconHandovers": { - "$ref": "../common/beaconCommonComponents.json#/definitions/ListOfHandovers", - "description": "List of handovers that apply to the whole response, not to any resultset or result in particular." + "meta": { + "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results.", + "$ref": "./sections/beaconResponseMeta.json" + }, + "responseSummary": { + "description": "Response summary, including Boolean and optionally results count.", + "$ref": "./sections/beaconSummaryResponseSection.json" }, "info": { - "$ref": "../common/beaconCommonComponents.json#/definitions/Info", - "description": "Additional details that could be of interest. Provided to clearly enclose any attribute that is not part of the Beacon specification." + "description": "Additional details that could be of interest. Provided to clearly enclose any attribute that is not part of the Beacon specification.", + "$ref": "../common/beaconCommonComponents.json#/definitions/Info" }, - "meta": { - "$ref": "./sections/beaconResponseMeta.json", - "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results." + "beaconHandovers": { + "description": "List of handovers that apply to the whole response, not to any resultset or result in particular.", + "$ref": "../common/beaconCommonComponents.json#/definitions/ListOfHandovers" }, "response": { - "$ref": "./sections/beaconResultsets.json", - "description": "Response for queries that recovers any result." - }, - "responseSummary": { - "$ref": "./sections/beaconSummaryResponseSection.json", - "description": "Response summary, including Boolean and optionally results count." + "description": "Response for queries that recovers any result.", + "$ref": "./sections/beaconResultsets.json" } }, "required": [ @@ -29,5 +29,5 @@ "responseSummary", "response" ], - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconBooleanResponse-example.json b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconBooleanResponse-example.json index ac6fc7df4..3f4b5844d 100644 --- a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconBooleanResponse-example.json +++ b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconBooleanResponse-example.json @@ -1,27 +1,27 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "meta": { - "apiVersion": "v2.0", "beaconId": "org.example.beacon.v2", + "apiVersion": "v2.0", + "returnedSchemas": [ + { + "entityType": "EntryTypeB", + "schema": "entry-typeB-schema-v1.0" + } + ], "receivedRequestSummary": { "apiVersion": "2.0", - "pagination": { - "limit": 10, - "skip": 0 - }, "requestedSchemas": [ { "entityType": "EntryTypeB", "schema": "entry-typeB-schema-v1.0" } - ] - }, - "returnedSchemas": [ - { - "entityType": "EntryTypeB", - "schema": "entry-typeB-schema-v1.0" + ], + "pagination": { + "skip": 0, + "limit": 10 } - ] + } }, "responseSummary": { "exists": true diff --git a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconCollectionsResponse-MID-example.json b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconCollectionsResponse-MID-example.json index 7efa61542..08e38485e 100644 --- a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconCollectionsResponse-MID-example.json +++ b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconCollectionsResponse-MID-example.json @@ -1,33 +1,41 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "meta": { - "apiVersion": "v2.0", "beaconId": "org.example.beacon.v2", + "apiVersion": "v2.0", + "returnedSchemas": [ + { + "entityType": "dataset", + "schema": "dataset-schema-v1.0" + } + ], "receivedRequestSummary": { "apiVersion": "2.0", - "pagination": { - "limit": 10, - "skip": 0 - }, "requestedSchemas": [ { "entityType": "dataset", "schema": "dataset-schema-v1.0" } - ] - }, - "returnedSchemas": [ - { - "entityType": "dataset", - "schema": "dataset-schema-v1.0" + ], + "pagination": { + "skip": 0, + "limit": 10 } - ] + } + }, + "responseSummary": { + "exists": true }, "response": { "collections": [ { "$schema": "https://schemas-fake-depot.org/beaconv2/datasetSchema.json", + "id": "Dataset1", + "name": "Dataset One", + "description": "This is the first dataset", "createDateTime": "2011-01-11T11:11:11Z", + "updateDateTime": "2011-01-11T11:11:11Z", + "version": "v1", "dataUseConditions": { "duoDataUse": [ { @@ -41,16 +49,16 @@ "version": "2021-02-23" } ] - }, - "description": "This is the first dataset", - "id": "Dataset1", - "name": "Dataset One", - "updateDateTime": "2011-01-11T11:11:11Z", - "version": "v1" + } }, { "$schema": "https://schemas-fake-depot.org/beaconv2/datasetSchema.json", + "id": "Dataset2", + "name": "Dataset Two", + "description": "This is the second dataset", "createDateTime": "2012-02-22T22:22:22Z", + "updateDateTime": "2012-02-22T22:22:22Z", + "version": "v2", "dataUseConditions": { "duoDataUse": [ { @@ -59,16 +67,8 @@ "version": "2021-02-23" } ] - }, - "description": "This is the second dataset", - "id": "Dataset2", - "name": "Dataset Two", - "updateDateTime": "2012-02-22T22:22:22Z", - "version": "v2" + } } ] - }, - "responseSummary": { - "exists": true } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconCollectionsResponse-MIN-example.json b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconCollectionsResponse-MIN-example.json index 30add7b42..24b737ddd 100644 --- a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconCollectionsResponse-MIN-example.json +++ b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconCollectionsResponse-MIN-example.json @@ -1,32 +1,32 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "meta": { - "apiVersion": "v2.0", "beaconId": "org.example.beacon.v2", + "apiVersion": "v2.0", + "returnedSchemas": [ + { + "entityType": "dataset", + "schema": "dataset-schema-v1.0" + } + ], "receivedRequestSummary": { "apiVersion": "2.0", - "pagination": { - "limit": 10, - "skip": 0 - }, "requestedSchemas": [ { "entityType": "dataset", "schema": "dataset-schema-v1.0" } - ] - }, - "returnedSchemas": [ - { - "entityType": "dataset", - "schema": "dataset-schema-v1.0" + ], + "pagination": { + "skip": 0, + "limit": 10 } - ] - }, - "response": { - "collections": [] + } }, "responseSummary": { "exists": true + }, + "response": { + "collections": [] } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconConfigurationResponse-example.json b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconConfigurationResponse-example.json index fee73128e..8b30842ed 100644 --- a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconConfigurationResponse-example.json +++ b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconConfigurationResponse-example.json @@ -1,9 +1,8 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "info": {}, "meta": { - "apiVersion": "string", "beaconId": "string", + "apiVersion": "string", "returnedSchemas": [ { "entityType": "info", @@ -13,62 +12,63 @@ }, "response": { "$schema": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/configuration/beaconConfigurationSchema.json", + "maturityAttributes": { + "productionStatus": "DEV" + }, + "securityAttributes": { + "defaultGranularity": "boolean", + "securityLevels": [ + "PUBLIC", + "REGISTERED", + "CONTROLLED" + ] + }, "entryTypes": { "dataset": { - "aCollectionOf": [ - { - "id": "exampleEntry", - "name": "Example entries" - } - ], - "additionallySupportedSchemas": [], + "id": "dataset", + "name": "Dataset", + "ontologyTermForThisType": { + "id": "NCIT:C47824", + "label": "Data set" + }, + "partOfSpecification": "Beacon v2.0", + "description": "A Dataset is a collection of records, like rows in a database or cards in a cardholder.", "defaultSchema": { "id": "datasetDefaultSchema", "name": "Default schema for datasets", "referenceToSchemaDefinition": "./datasets/defaultSchema.json", "schemaVersion": "v.2" }, - "description": "A Dataset is a collection of records, like rows in a database or cards in a cardholder.", + "aCollectionOf": [ + { + "id": "exampleEntry", + "name": "Example entries" + } + ], "endpoint": "/datasets", "filteringTermsReference": "./datasets/filteringTerms.json", - "id": "dataset", - "name": "Dataset", - "ontologyTermForThisType": { - "id": "NCIT:C47824", - "label": "Data set" - }, - "partOfSpecification": "Beacon v2.0" + "additionallySupportedSchemas": [] }, "exampleEntry": { - "additionallySupportedSchemas": [], + "id": "exampleEntry", + "name": "Example Entry", + "ontologyTermForThisType": { + "id": "NCIT:C20181", + "label": "Conceptual Entity" + }, + "partOfSpecification": "Beacon v2.0", + "description": "A generic entry type to allow testing and playing with the specification.", "defaultSchema": { "id": "ExampleEntryTypeDefaultschema", "name": "Default schema for an example entries", "referenceToSchemaDefinition": "./exampleEntry/defaultSchema.json", "schemaVersion": "v.2" }, - "description": "A generic entry type to allow testing and playing with the specification.", "endpoint": "./exampleEntries", "filteringTermsReference": "./exampleEntry/filteringTerms.json", - "id": "exampleEntry", - "name": "Example Entry", - "ontologyTermForThisType": { - "id": "NCIT:C20181", - "label": "Conceptual Entity" - }, - "partOfSpecification": "Beacon v2.0" + "additionallySupportedSchemas": [] } - }, - "maturityAttributes": { - "productionStatus": "DEV" - }, - "securityAttributes": { - "defaultGranularity": "boolean", - "securityLevels": [ - "PUBLIC", - "REGISTERED", - "CONTROLLED" - ] } - } + }, + "info": {} } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconCountResponse-example.json b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconCountResponse-example.json index 940bc8b81..08a2f0d9c 100644 --- a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconCountResponse-example.json +++ b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconCountResponse-example.json @@ -1,51 +1,51 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "beaconHandovers": [ - { - "handoverType": { - "id": "EFO:0004157", - "label": "BAM format" - }, - "note": "This handover link provides access to a summarized VCF.", - "url": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0" - }, - { - "handoverType": { - "id": "EFO:0004157", - "label": "BAM format" - }, - "note": "This handover link provides access to a summarized VCF.", - "url": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0" - } - ], - "info": { - "someInterestingStuff": "this is the interesting stuff" - }, "meta": { - "apiVersion": "v2.0", "beaconId": "org.example.beacon.v2", + "apiVersion": "v2.0", + "returnedSchemas": [ + { + "entityType": "EntryTypeB", + "schema": "entry-typeB-schema-v1.0" + } + ], "receivedRequestSummary": { "apiVersion": "2.0", - "pagination": { - "limit": 10, - "skip": 0 - }, "requestedSchemas": [ { "entityType": "EntryTypeB", "schema": "entry-typeB-schema-v1.0" } - ] - }, - "returnedSchemas": [ - { - "entityType": "EntryTypeB", - "schema": "entry-typeB-schema-v1.0" + ], + "pagination": { + "skip": 0, + "limit": 10 } - ] + } }, "responseSummary": { "exists": true, "numTotalResults": 25355 - } + }, + "info": { + "someInterestingStuff": "this is the interesting stuff" + }, + "beaconHandovers": [ + { + "handoverType": { + "id": "EFO:0004157", + "label": "BAM format" + }, + "url": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0", + "note": "This handover link provides access to a summarized VCF." + }, + { + "handoverType": { + "id": "EFO:0004157", + "label": "BAM format" + }, + "url": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0", + "note": "This handover link provides access to a summarized VCF." + } + ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconEntryTypesResponse-example.json b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconEntryTypesResponse-example.json index 3bb5ac782..c59f54eba 100644 --- a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconEntryTypesResponse-example.json +++ b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconEntryTypesResponse-example.json @@ -1,9 +1,8 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "info": {}, "meta": { - "apiVersion": "string", "beaconId": "string", + "apiVersion": "string", "returnedSchemas": [ { "entityType": "info", @@ -15,49 +14,50 @@ "$schema": "../../configuration/entryTypesSchema.json", "entryTypes": { "dataset": { - "aCollectionOf": [ - { - "id": "exampleEntry", - "name": "Example entries" - } - ], - "additionallySupportedSchemas": [], + "id": "dataset", + "name": "Dataset", + "ontologyTermForThisType": { + "id": "NCIT:C47824", + "label": "Data set" + }, + "partOfSpecification": "Beacon v2.0", + "description": "A Dataset is a collection of records, like rows in a database or cards in a cardholder.", "defaultSchema": { "id": "datasetDefaultSchema", "name": "Default schema for datasets", "referenceToSchemaDefinition": "./datasets/defaultSchema.json", "schemaVersion": "v.2" }, - "description": "A Dataset is a collection of records, like rows in a database or cards in a cardholder.", + "aCollectionOf": [ + { + "id": "exampleEntry", + "name": "Example entries" + } + ], "endpoint": "/datasets", "filteringTermsReference": "./datasets/filteringTerms.json", - "id": "dataset", - "name": "Dataset", - "ontologyTermForThisType": { - "id": "NCIT:C47824", - "label": "Data set" - }, - "partOfSpecification": "Beacon v2.0" + "additionallySupportedSchemas": [] }, "exampleEntry": { - "additionallySupportedSchemas": [], + "id": "exampleEntry", + "name": "Example Entry", + "ontologyTermForThisType": { + "id": "NCIT:C20181", + "label": "Conceptual Entity" + }, + "partOfSpecification": "Beacon v2.0", + "description": "A generic entry type to allow testing and playing with the specification.", "defaultSchema": { "id": "ExampleEntryTypeDefaultschema", "name": "Default schema for an example entries", "referenceToSchemaDefinition": "./exampleEntry/defaultSchema.json", "schemaVersion": "v.2" }, - "description": "A generic entry type to allow testing and playing with the specification.", "endpoint": "./exampleEntries", "filteringTermsReference": "./exampleEntry/filteringTerms.json", - "id": "exampleEntry", - "name": "Example Entry", - "ontologyTermForThisType": { - "id": "NCIT:C20181", - "label": "Conceptual Entity" - }, - "partOfSpecification": "Beacon v2.0" + "additionallySupportedSchemas": [] } } - } + }, + "info": {} } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconErrorResponse_example.json b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconErrorResponse_example.json index 71b7f2958..392fed166 100644 --- a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconErrorResponse_example.json +++ b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconErrorResponse_example.json @@ -1,22 +1,16 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "error": { - "errorCode": 400, - "errorMessage": "Bad request. Missing parameter 'id'." - }, "meta": { - "apiVersion": "v2.0", "beaconId": "org.example.beacon.v2", + "apiVersion": "v2.0", "receivedRequestSummary": { "apiVersion": "v2.0", - "filters": [ - "BTO:0000199", - "PATO:0000383" + "requestedSchemas": [ + { + "entityType": "Individual", + "schema": "ga4gh-phenopacket-individual-v0.1" + } ], - "pagination": { - "limit": 10, - "skip": 1 - }, "requestParameters": [ { "entity": "individual", @@ -30,13 +24,19 @@ ] } ], - "requestedSchemas": [ - { - "entityType": "Individual", - "schema": "ga4gh-phenopacket-individual-v0.1" - } - ] + "filters": [ + "BTO:0000199", + "PATO:0000383" + ], + "pagination": { + "skip": 1, + "limit": 10 + } }, "returnedSchemas": [] + }, + "error": { + "errorCode": 400, + "errorMessage": "Bad request. Missing parameter 'id'." } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconFilteringTermsResponse-example.json b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconFilteringTermsResponse-example.json index b7a2b368b..541b8d762 100644 --- a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconFilteringTermsResponse-example.json +++ b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconFilteringTermsResponse-example.json @@ -1,9 +1,8 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "info": {}, "meta": { - "apiVersion": "string", "beaconId": "string", + "apiVersion": "string", "returnedSchemas": [ { "map": "beacon-map-v2.0.0" @@ -11,32 +10,33 @@ ] }, "response": { + "resources": [ + { + "id": "hp", + "name": "Human Phenotype Ontology", + "url": "http://purl.obolibrary.org/obo/hp.owl", + "version": "27-03-2020", + "namespacePrefix": "HP", + "iriPrefix": "http://purl.obolibrary.org/obo/HP_" + } + ], "filteringTerms": [ { + "type": "numeric", "id": "PATO:0000011", - "label": "age", - "type": "numeric" + "label": "age" }, { + "type": "Human Phenotype Ontology", "id": "HP:0008773", - "label": "Aplasia/Hypoplasia of the middle ear", - "type": "Human Phenotype Ontology" + "label": "Aplasia/Hypoplasia of the middle ear" }, { + "type": "custom", "id": "ownsIPhone", - "label": "Individuals associated with this term owns an IPhone", - "type": "custom" - } - ], - "resources": [ - { - "id": "hp", - "iriPrefix": "http://purl.obolibrary.org/obo/HP_", - "name": "Human Phenotype Ontology", - "namespacePrefix": "HP", - "url": "http://purl.obolibrary.org/obo/hp.owl", - "version": "27-03-2020" + "label": "Individuals associated with this term owns an IPhone" } ] - } + }, + "info": {} } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconInfo-MAX-example.json b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconInfo-MAX-example.json index e542da6bb..a5a60f007 100644 --- a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconInfo-MAX-example.json +++ b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconInfo-MAX-example.json @@ -1,9 +1,8 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "info": {}, "meta": { - "apiVersion": "string", "beaconId": "string", + "apiVersion": "string", "returnedSchemas": [ { "entityType": "info", @@ -12,32 +11,33 @@ ] }, "response": { - "alternativeUrl": "http://example.org/wiki/Main_Page", - "apiVersion": "v0.3", - "createDateTime": "2012-07-19 or 2017-01-17T20:33:40Z", - "description": "string", - "environment": "dev", "id": "org.ga4gh.beacon", - "info": { - "additionalInfoKey1": "additionalInfoValue1", - "additionalInfoKey2": [ - "additionalInfoValue2", - "additionalInfoValue3" - ] - }, "name": "string", + "apiVersion": "v0.3", + "environment": "dev", "organization": { + "id": "string", + "name": "string", + "description": "string", "address": "string", + "welcomeUrl": "string", "contactUrl": "string", - "description": "string", - "id": "string", - "info": {}, "logoUrl": "string", - "name": "string", - "welcomeUrl": "string" + "info": {} }, - "updateDateTime": "2012-07-19 or 2017-01-17T20:33:40Z", + "description": "string", "version": "v0.1", - "welcomeUrl": "http://example.org/wiki/Main_Page" - } + "welcomeUrl": "http://example.org/wiki/Main_Page", + "alternativeUrl": "http://example.org/wiki/Main_Page", + "createDateTime": "2012-07-19 or 2017-01-17T20:33:40Z", + "updateDateTime": "2012-07-19 or 2017-01-17T20:33:40Z", + "info": { + "additionalInfoKey1": "additionalInfoValue1", + "additionalInfoKey2": [ + "additionalInfoValue2", + "additionalInfoValue3" + ] + } + }, + "info": {} } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconInfo-MIN-example.json b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconInfo-MIN-example.json index 51173c811..9a6166258 100644 --- a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconInfo-MIN-example.json +++ b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconInfo-MIN-example.json @@ -1,8 +1,8 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "meta": { - "apiVersion": "string", "beaconId": "string", + "apiVersion": "string", "returnedSchemas": [ { "entityType": "info", @@ -11,10 +11,10 @@ ] }, "response": { - "apiVersion": "v0.3", - "environment": "dev", "id": "org.ga4gh.beacon", "name": "string", + "apiVersion": "v0.3", + "environment": "dev", "organization": { "id": "string", "name": "string" diff --git a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconMapResponse-example.json b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconMapResponse-example.json index 39df9d4ef..be3a5f570 100644 --- a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconMapResponse-example.json +++ b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconMapResponse-example.json @@ -1,9 +1,8 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "info": {}, "meta": { - "apiVersion": "string", "beaconId": "string", + "apiVersion": "string", "returnedSchemas": [ { "entityType": "info", @@ -15,25 +14,26 @@ "$schema": "../../configuration/beaconMapSchema.json", "endpointSets": { "dataset": { + "entryType": "dataset", + "openAPIEndpointsDefinition": "./datasets/endpoints.json", + "rootUrl": "https://exampleBeacons.org/datasets", + "singleEntryUrl": "https://exampleBeacons.org/datasets/{id}", + "filteringTermsUrl": "https://exampleBeacons.org/datasets/{id}/filteringTerms", "endpoints": { "exampleEntries": { "returnedEntryType": "exampleEntry", "url": "https://exampleBeacons.org/datasets/{id}/exampleEntries" } - }, - "entryType": "dataset", - "filteringTermsUrl": "https://exampleBeacons.org/datasets/{id}/filteringTerms", - "openAPIEndpointsDefinition": "./datasets/endpoints.json", - "rootUrl": "https://exampleBeacons.org/datasets", - "singleEntryUrl": "https://exampleBeacons.org/datasets/{id}" + } }, "exampleEntry": { "entryType": "exampleEntry", - "filteringTermsUrl": "https://exampleBeacons.org/exampleEntries/{id}/filteringTerms", "openAPIEndpointsDefinition": "./exampleEntries/endpoints.json", "rootUrl": "https://exampleBeacons.org/exampleEntries", - "singleEntryUrl": "https://exampleBeacons.org/exampleEntries/{id}" + "singleEntryUrl": "https://exampleBeacons.org/exampleEntries/{id}", + "filteringTermsUrl": "https://exampleBeacons.org/exampleEntries/{id}/filteringTerms" } } - } + }, + "info": {} } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconResultsetResponse-MIN-example.json b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconResultsetResponse-MIN-example.json index 0b271c8ff..6b5546ac1 100644 --- a/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconResultsetResponse-MIN-example.json +++ b/bycon/schemas/framework/json/responses/examples-fullDocuments/beaconResultsetResponse-MIN-example.json @@ -1,27 +1,27 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "meta": { - "apiVersion": "v2.0", "beaconId": "org.example.beacon.v2", + "apiVersion": "v2.0", + "returnedSchemas": [ + { + "entityType": "EntryTypeB", + "schema": "entry-typeB-schema-v1.0" + } + ], "receivedRequestSummary": { "apiVersion": "2.0", - "pagination": { - "limit": 10, - "skip": 0 - }, "requestedSchemas": [ { "entityType": "EntryTypeB", "schema": "entry-typeB-schema-v1.0" } - ] - }, - "returnedSchemas": [ - { - "entityType": "EntryTypeB", - "schema": "entry-typeB-schema-v1.0" + ], + "pagination": { + "skip": 0, + "limit": 10 } - ] + } }, "responseSummary": { "exists": true diff --git a/bycon/schemas/framework/json/responses/examples-sections/beaconInformationalResponseMeta-example.json b/bycon/schemas/framework/json/responses/examples-sections/beaconInformationalResponseMeta-example.json index ec417ee3b..6cf1511ac 100644 --- a/bycon/schemas/framework/json/responses/examples-sections/beaconInformationalResponseMeta-example.json +++ b/bycon/schemas/framework/json/responses/examples-sections/beaconInformationalResponseMeta-example.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "apiVersion": "v2.0", "beaconId": "org.examplebeacons.beacon-v2", + "apiVersion": "v2.0", "returnedSchemas": [] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-sections/beaconReceivedRequestSummary-MAX-example.json b/bycon/schemas/framework/json/responses/examples-sections/beaconReceivedRequestSummary-MAX-example.json index 1c7e6a356..48576c07e 100644 --- a/bycon/schemas/framework/json/responses/examples-sections/beaconReceivedRequestSummary-MAX-example.json +++ b/bycon/schemas/framework/json/responses/examples-sections/beaconReceivedRequestSummary-MAX-example.json @@ -1,15 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "IncludeResultsetResponses": "HIT", "apiVersion": "v2.0", - "filters": [ - "BTO:0000199", - "PATO:0000383" + "requestedSchemas": [ + { + "entityType": "Individual", + "schema": "ga4gh-phenopacket-individual-v0.1" + } ], - "pagination": { - "limit": 10, - "skip": 1 - }, "requestParameters": { "individual": { "parameters": [ @@ -19,12 +16,15 @@ ] } }, - "requestedGranularity": "count", - "requestedSchemas": [ - { - "entityType": "Individual", - "schema": "ga4gh-phenopacket-individual-v0.1" - } + "IncludeResultsetResponses": "HIT", + "filters": [ + "BTO:0000199", + "PATO:0000383" ], - "testMode": false + "pagination": { + "skip": 1, + "limit": 10 + }, + "testMode": false, + "requestedGranularity": "count" } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-sections/beaconReceivedRequestSummary-MIN-example.json b/bycon/schemas/framework/json/responses/examples-sections/beaconReceivedRequestSummary-MIN-example.json index 30a9e6f2f..f88151035 100644 --- a/bycon/schemas/framework/json/responses/examples-sections/beaconReceivedRequestSummary-MIN-example.json +++ b/bycon/schemas/framework/json/responses/examples-sections/beaconReceivedRequestSummary-MIN-example.json @@ -1,7 +1,7 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "apiVersion": "v2.0", + "requestedSchemas": [], "pagination": {}, - "requestedGranularity": "boolean", - "requestedSchemas": [] + "requestedGranularity": "boolean" } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-sections/beaconResponseMeta-example.json b/bycon/schemas/framework/json/responses/examples-sections/beaconResponseMeta-example.json index 33332a0f3..702dfca82 100644 --- a/bycon/schemas/framework/json/responses/examples-sections/beaconResponseMeta-example.json +++ b/bycon/schemas/framework/json/responses/examples-sections/beaconResponseMeta-example.json @@ -1,27 +1,27 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "apiVersion": "v2.0", "beaconId": "org.example.beacon.v2", + "apiVersion": "v2.0", + "returnedSchemas": [ + { + "entityType": "EntryTypeB", + "schema": "entry-typeB-schema-v1.0" + } + ], + "returnedGranularity": "count", "receivedRequestSummary": { "apiVersion": "2.0", - "pagination": { - "limit": 10, - "skip": 0 - }, - "requestedGranularity": "count", "requestedSchemas": [ { "entityType": "EntryTypeB", "schema": "entry-typeB-schema-v1.0" } ], - "testMode": true - }, - "returnedGranularity": "count", - "returnedSchemas": [ - { - "entityType": "EntryTypeB", - "schema": "entry-typeB-schema-v1.0" - } - ] + "pagination": { + "skip": 0, + "limit": 10 + }, + "testMode": true, + "requestedGranularity": "count" + } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-sections/beaconResultsetEmpty-example.json b/bycon/schemas/framework/json/responses/examples-sections/beaconResultsetEmpty-example.json index 9cd9298d4..65decb75e 100644 --- a/bycon/schemas/framework/json/responses/examples-sections/beaconResultsetEmpty-example.json +++ b/bycon/schemas/framework/json/responses/examples-sections/beaconResultsetEmpty-example.json @@ -2,9 +2,9 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "resultSets": [ { - "exists": false, "id": "correctEmptyResultSet", - "type": "dataset" + "type": "dataset", + "exists": false } ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-sections/beaconResultsets-MAX-example.json b/bycon/schemas/framework/json/responses/examples-sections/beaconResultsets-MAX-example.json index 1406dc8f6..3f84bedc9 100644 --- a/bycon/schemas/framework/json/responses/examples-sections/beaconResultsets-MAX-example.json +++ b/bycon/schemas/framework/json/responses/examples-sections/beaconResultsets-MAX-example.json @@ -2,23 +2,14 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "resultSets": [ { - "exists": false, "id": "datasetA", - "type": "dataset" + "type": "dataset", + "exists": false }, { - "exists": true, "id": "datasetB", - "results": [ - { - "id": "BEex3", - "name": "Basic Element example three" - }, - { - "id": "BEex4", - "name": "Basic Element example four" - } - ], + "type": "dataset", + "exists": true, "resultsCount": 2, "resultsHandovers": [ { @@ -26,11 +17,20 @@ "id": "EFO:0004157", "label": "BAM format" }, - "note": "This handover link provides access to a summarized VCF.", - "url": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0" + "url": "https://api.mygenomeservice.org/Handover/9dcc48d7-fc88-11e8-9110-b0c592dbf8c0", + "note": "This handover link provides access to a summarized VCF." } ], - "type": "dataset" + "results": [ + { + "id": "BEex3", + "name": "Basic Element example three" + }, + { + "id": "BEex4", + "name": "Basic Element example four" + } + ] } ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/examples-sections/beaconResultsets-MID-example.json b/bycon/schemas/framework/json/responses/examples-sections/beaconResultsets-MID-example.json index 7f19a0bca..4d131b7d5 100644 --- a/bycon/schemas/framework/json/responses/examples-sections/beaconResultsets-MID-example.json +++ b/bycon/schemas/framework/json/responses/examples-sections/beaconResultsets-MID-example.json @@ -2,21 +2,21 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "resultSets": [ { - "exists": true, "id": "correctWithResults", + "type": "dataset", + "exists": true, + "resultsCount": 1, "results": [ { "id": "BEex1", "name": "Basic Element example one" } - ], - "resultsCount": 1, - "type": "dataset" + ] }, { - "exists": false, "id": "correctWOresults", - "type": "dataset" + "type": "dataset", + "exists": false } ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/ga4gh-service-info-1-0-0-schema.json b/bycon/schemas/framework/json/responses/ga4gh-service-info-1-0-0-schema.json index 326fd13ea..e76b54d2d 100644 --- a/bycon/schemas/framework/json/responses/ga4gh-service-info-1-0-0-schema.json +++ b/bycon/schemas/framework/json/responses/ga4gh-service-info-1-0-0-schema.json @@ -1,117 +1,117 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "definitions": { - "ServiceType": { - "description": "Type of a GA4GH service", - "properties": { - "artifact": { - "description": "Name of the API or GA4GH specification implemented. Official GA4GH types should be assigned as part of standards approval process. Custom artifacts are supported.", - "example": "beacon", - "type": "string" - }, - "group": { - "description": "Namespace in reverse domain name format. Use `org.ga4gh` for implementations compliant with official GA4GH specifications. For services with custom APIs not standardized by GA4GH, or implementations diverging from official GA4GH specifications, use a different namespace (e.g. your organization's reverse domain name).", - "example": "org.ga4gh", - "type": "string" - }, - "version": { - "description": "Version of the API or specification. GA4GH specifications use semantic versioning.", - "example": "1.0.0", - "type": "string" - } - }, - "required": [ - "group", - "artifact", - "version" - ], - "type": "object" - } - }, + "title": "GA4GH service-info API specification", "description": "A way for a service to describe basic metadata concerning a service alongside a set of capabilities and/or limitations of the service. More information on [GitHub](https://github.com/ga4gh-discovery/ga4gh-service-info/).", + "version": "1.0.0", + "type": "object", + "required": [ + "id", + "name", + "type", + "organization", + "version" + ], "properties": { - "contactUrl": { - "description": "URL of the contact for the provider of this service, e.g. a link to a contact form (RFC 3986 format), or an email (RFC 2368 format).", - "example": "mailto:support@example.com", - "format": "uri", - "type": "string" - }, - "createdAt": { - "description": "Timestamp describing when the service was first deployed and available (RFC 3339 format)", - "example": "2019-06-04T12:58:19Z", - "format": "date-time", - "type": "string" - }, - "description": { - "description": "Description of the service. Should be human readable and provide information about the service.", - "example": "This service provides...", - "type": "string" - }, - "documentationUrl": { - "description": "URL of the documentation of this service (RFC 3986 format). This should help someone learn how to use your service, including any specifics required to access data, e.g. authentication.", - "example": "https://docs.myservice.example.com", - "format": "uri", - "type": "string" - }, - "environment": { - "description": "Environment the service is running in. Use this to distinguish between production, development and testing/staging deployments. Suggested values are prod, test, dev, staging. However this is advised and not enforced.", - "example": "test", - "type": "string" - }, "id": { + "type": "string", "description": "Unique ID of this service. Reverse domain name notation is recommended, though not required. The identifier should attempt to be globally unique so it can be used in downstream aggregator services e.g. Service Registry.", - "example": "org.ga4gh.myservice", - "type": "string" + "example": "org.ga4gh.myservice" }, "name": { + "type": "string", "description": "Name of this service. Should be human readable.", - "example": "My project", - "type": "string" + "example": "My project" + }, + "type": { + "$ref": "#/definitions/ServiceType" + }, + "description": { + "type": "string", + "description": "Description of the service. Should be human readable and provide information about the service.", + "example": "This service provides..." }, "organization": { + "type": "object", "description": "Organization providing the service", + "required": [ + "name", + "url" + ], "properties": { "name": { + "type": "string", "description": "Name of the organization responsible for the service", - "example": "My organization", - "type": "string" + "example": "My organization" }, "url": { - "description": "URL of the website of the organization (RFC 3986 format)", - "example": "https://example.com", + "type": "string", "format": "uri", - "type": "string" + "description": "URL of the website of the organization (RFC 3986 format)", + "example": "https://example.com" } - }, - "required": [ - "name", - "url" - ], - "type": "object" + } }, - "type": { - "$ref": "#/definitions/ServiceType" + "contactUrl": { + "type": "string", + "format": "uri", + "description": "URL of the contact for the provider of this service, e.g. a link to a contact form (RFC 3986 format), or an email (RFC 2368 format).", + "example": "mailto:support@example.com" + }, + "documentationUrl": { + "type": "string", + "format": "uri", + "description": "URL of the documentation of this service (RFC 3986 format). This should help someone learn how to use your service, including any specifics required to access data, e.g. authentication.", + "example": "https://docs.myservice.example.com" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "Timestamp describing when the service was first deployed and available (RFC 3339 format)", + "example": "2019-06-04T12:58:19Z" }, "updatedAt": { - "description": "Timestamp describing when the service was last updated (RFC 3339 format)", - "example": "2019-06-04T12:58:19Z", + "type": "string", "format": "date-time", - "type": "string" + "description": "Timestamp describing when the service was last updated (RFC 3339 format)", + "example": "2019-06-04T12:58:19Z" + }, + "environment": { + "type": "string", + "description": "Environment the service is running in. Use this to distinguish between production, development and testing/staging deployments. Suggested values are prod, test, dev, staging. However this is advised and not enforced.", + "example": "test" }, "version": { + "type": "string", "description": "Version of the service being described. Semantic versioning is recommended, but other identifiers, such as dates or commit hashes, are also allowed. The version should be changed whenever the service is updated.", - "example": "1.0.0", - "type": "string" + "example": "1.0.0" } }, - "required": [ - "id", - "name", - "type", - "organization", - "version" - ], - "title": "GA4GH service-info API specification", - "type": "object", - "version": "1.0.0" + "definitions": { + "ServiceType": { + "description": "Type of a GA4GH service", + "type": "object", + "required": [ + "group", + "artifact", + "version" + ], + "properties": { + "group": { + "type": "string", + "description": "Namespace in reverse domain name format. Use `org.ga4gh` for implementations compliant with official GA4GH specifications. For services with custom APIs not standardized by GA4GH, or implementations diverging from official GA4GH specifications, use a different namespace (e.g. your organization's reverse domain name).", + "example": "org.ga4gh" + }, + "artifact": { + "type": "string", + "description": "Name of the API or GA4GH specification implemented. Official GA4GH types should be assigned as part of standards approval process. Custom artifacts are supported.", + "example": "beacon" + }, + "version": { + "type": "string", + "description": "Version of the API or specification. GA4GH specifications use semantic versioning.", + "example": "1.0.0" + } + } + } + } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/sections/beaconBooleanResponseSection.json b/bycon/schemas/framework/json/responses/sections/beaconBooleanResponseSection.json index 8630be12c..1f87a40cc 100644 --- a/bycon/schemas/framework/json/responses/sections/beaconBooleanResponseSection.json +++ b/bycon/schemas/framework/json/responses/sections/beaconBooleanResponseSection.json @@ -1,14 +1,14 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Boolean (true/false) response section.", - "properties": { - "exists": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/Exists", - "description": "Indicator of whether any entry was observed. This should be non-null, unless there was an error, in which case an error response is expected instead of this one." - } - }, + "type": "object", "required": [ "exists" ], - "type": "object" + "properties": { + "exists": { + "description": "Indicator of whether any entry was observed. This should be non-null, unless there was an error, in which case an error response is expected instead of this one.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/Exists" + } + } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/sections/beaconCountResponseSection.json b/bycon/schemas/framework/json/responses/sections/beaconCountResponseSection.json index cad8e7d26..049756c6a 100644 --- a/bycon/schemas/framework/json/responses/sections/beaconCountResponseSection.json +++ b/bycon/schemas/framework/json/responses/sections/beaconCountResponseSection.json @@ -1,19 +1,19 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Total number of results section.", + "type": "object", "properties": { "exists": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/Exists", - "description": "Indicator of whether any entry was observed. This should be non-null, unless there was an error, in which case an error response is expected instead of this one." + "description": "Indicator of whether any entry was observed. This should be non-null, unless there was an error, in which case an error response is expected instead of this one.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/Exists" }, "numTotalResults": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/NumTotalResults", - "description": "Total number of results." + "description": "Total number of results.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/NumTotalResults" } }, "required": [ "exists", "numTotalResults" - ], - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/sections/beaconFilteringTermsResults.json b/bycon/schemas/framework/json/responses/sections/beaconFilteringTermsResults.json index a25f2900c..20357df3d 100644 --- a/bycon/schemas/framework/json/responses/sections/beaconFilteringTermsResults.json +++ b/bycon/schemas/framework/json/responses/sections/beaconFilteringTermsResults.json @@ -1,87 +1,87 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "description": "Filtering terms and ontology resources utilised in this Beacon.", + "type": "object", + "properties": { + "resources": { + "type": "array", + "description": "Ontology resources defined externally to this beacon implementation", + "items": { + "$ref": "#/definitions/Resource" + } + }, + "filteringTerms": { + "type": "array", + "items": { + "$ref": "#/definitions/FilteringTerm" + } + } + }, "definitions": { "FilteringTerm": { + "type": "object", "description": "Entities can be filtered using this term.", + "required": [ + "type", + "id" + ], "properties": { + "type": { + "type": "string", + "description": "Either \"custom\", \"alphanumeric\" or ontology/terminology full name.", + "example": "Human Phenotype Ontology" + }, "id": { "description": "The field id in the case of numeric or alphanumeric fields, or the term id in the case of ontology or custom terms. CURIE syntax in the case of an ontology term.", - "example": "HP:0008773", - "type": "string" + "type": "string", + "example": "HP:0008773" }, "label": { "description": "This would be the \"preferred Label\" in the case of an ontology term.", - "example": "Aplasia/Hypoplasia of the middle ear", - "type": "string" - }, - "type": { - "description": "Either \"custom\", \"alphanumeric\" or ontology/terminology full name.", - "example": "Human Phenotype Ontology", - "type": "string" + "type": "string", + "example": "Aplasia/Hypoplasia of the middle ear" } - }, - "required": [ - "type", - "id" - ], - "type": "object" + } }, "Resource": { + "type": "object", "description": "Description of an ontology resource defined externally to this beacon implementation, such as MeSH or EFO, based on the phenopackets resource object (https://phenopacket-schema.readthedocs.io/en/latest/resource.html)", + "required": [ + "id" + ], "properties": { "id": { + "type": "string", "description": "OBO ID representing the resource", - "example": "hp", - "type": "string" - }, - "iriPrefix": { - "description": "The full Internationalized Resource Identifier (IRI) prefix", - "example": "http://purl.obolibrary.org/obo/HP_", - "type": "string" + "example": "hp" }, "name": { + "type": "string", "description": "The name of the ontology referred to by the id element", - "example": "Human Phenotype Ontology", - "type": "string" - }, - "nameSpacePrefix": { - "description": "The prefix used in the CURIE of an OntologyClass", - "example": "HP", - "type": "string" + "example": "Human Phenotype Ontology" }, "url": { + "type": "string", "description": "Uniform Resource Locator of the resource", - "example": "http://purl.obolibrary.org/obo/hp.owl", - "type": "string" + "example": "http://purl.obolibrary.org/obo/hp.owl" }, "version": { + "type": "string", "description": "The version of the resource or ontology used to make the annotation", - "example": "17-06-2019", - "type": "string" + "example": "17-06-2019" + }, + "nameSpacePrefix": { + "type": "string", + "description": "The prefix used in the CURIE of an OntologyClass", + "example": "HP" + }, + "iriPrefix": { + "type": "string", + "description": "The full Internationalized Resource Identifier (IRI) prefix", + "example": "http://purl.obolibrary.org/obo/HP_" } - }, - "required": [ - "id" - ], - "type": "object" - } - }, - "description": "Filtering terms and ontology resources utilised in this Beacon.", - "properties": { - "filteringTerms": { - "items": { - "$ref": "#/definitions/FilteringTerm" - }, - "type": "array" - }, - "resources": { - "description": "Ontology resources defined externally to this beacon implementation", - "items": { - "$ref": "#/definitions/Resource" - }, - "type": "array" + } } }, - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/sections/beaconInfoResults.json b/bycon/schemas/framework/json/responses/sections/beaconInfoResults.json index 81d4a9df6..508f9cb89 100644 --- a/bycon/schemas/framework/json/responses/sections/beaconInfoResults.json +++ b/bycon/schemas/framework/json/responses/sections/beaconInfoResults.json @@ -1,75 +1,31 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, - "definitions": { - "BeaconOrganization": { - "description": "Organization owning the Beacon.", - "properties": { - "address": { - "description": "Address of the organization.", - "type": "string" - }, - "contactUrl": { - "description": "URL with the contact for the Beacon operator/maintainer, e.g. link to a contact form (RFC 3986 format) or an email (RFC 2368 format).", - "type": "string" - }, - "description": { - "description": "Description of the organization.", - "type": "string" - }, - "id": { - "description": "Unique identifier of the organization.", - "type": "string" - }, - "info": { - "description": "Additional unspecified metadata about the host Organization.", - "example": { - "additionalInfoKey": "additionalInfoValue" - }, - "type": "object" - }, - "logoUrl": { - "description": "URL to the logo (PNG/JPG/SVG format) of the organization (RFC 3986 format).", - "type": "string" - }, - "name": { - "description": "Name of the organization.", - "type": "string" - }, - "welcomeUrl": { - "description": "URL of the website of the organization (RFC 3986 format).", - "type": "string" - } - }, - "required": [ - "id", - "name" - ], - "type": "object" - } - }, "description": "Metadata describing a Beacon instance.", + "type": "object", + "required": [ + "id", + "name", + "apiVersion", + "environment", + "organization" + ], "properties": { - "alternativeUrl": { - "description": "Alternative URL to the API, e.g. a restricted version of this Beacon (RFC 3986 format).", - "example": "http://example.org/wiki/Main_Page", - "type": "string" + "id": { + "type": "string", + "description": "Unique identifier of the Beacon. Use reverse domain name notation.", + "example": "org.ga4gh.Beacon" + }, + "name": { + "type": "string", + "description": "Name of the Beacon." }, "apiVersion": { + "type": "string", "description": "Version of the API provided by the Beacon.", - "example": "v2.0", - "type": "string" - }, - "createDateTime": { - "description": "The time the Beacon was created (ISO 8601 format).", - "example": "2012-07-19 or 2017-01-17T20:33:40Z", - "type": "string" - }, - "description": { - "description": "Description of the Beacon.", - "type": "string" + "example": "v2.0" }, "environment": { + "type": "string", "description": "Environment the service is running in. Use this to distinguish\nbetween production, development and testing/staging deployments.", "enum": [ "prod", @@ -77,54 +33,98 @@ "dev", "staging" ], - "example": "dev", - "type": "string" - }, - "id": { - "description": "Unique identifier of the Beacon. Use reverse domain name notation.", - "example": "org.ga4gh.Beacon", - "type": "string" - }, - "info": { - "description": "Additional unspecified metadata about the Beacon service.", - "example": { - "additionalInfoKey1": "additionalInfoValue1", - "additionalInfoKey2": [ - "additionalInfoValue2", - "additionalInfoValue3" - ] - }, - "type": "object" - }, - "name": { - "description": "Name of the Beacon.", - "type": "string" + "example": "dev" }, "organization": { "$ref": "#/definitions/BeaconOrganization" }, - "updateDateTime": { - "description": "The time the Beacon was updated in (ISO 8601 format).", - "example": "2012-07-19 or 2017-01-17T20:33:40Z", - "type": "string" + "description": { + "type": "string", + "description": "Description of the Beacon." }, "version": { + "type": "string", "description": "Version of the Beacon.", - "example": "v0.1", - "type": "string" + "example": "v0.1" }, "welcomeUrl": { + "type": "string", "description": "URL to the welcome page for this Beacon (RFC 3986 format).", - "example": "http://example.org/wiki/Main_Page", - "type": "string" + "example": "http://example.org/wiki/Main_Page" + }, + "alternativeUrl": { + "type": "string", + "description": "Alternative URL to the API, e.g. a restricted version of this Beacon (RFC 3986 format).", + "example": "http://example.org/wiki/Main_Page" + }, + "createDateTime": { + "type": "string", + "description": "The time the Beacon was created (ISO 8601 format).", + "example": "2012-07-19 or 2017-01-17T20:33:40Z" + }, + "updateDateTime": { + "type": "string", + "description": "The time the Beacon was updated in (ISO 8601 format).", + "example": "2012-07-19 or 2017-01-17T20:33:40Z" + }, + "info": { + "description": "Additional unspecified metadata about the Beacon service.", + "type": "object", + "example": { + "additionalInfoKey1": "additionalInfoValue1", + "additionalInfoKey2": [ + "additionalInfoValue2", + "additionalInfoValue3" + ] + } } }, - "required": [ - "id", - "name", - "apiVersion", - "environment", - "organization" - ], - "type": "object" + "definitions": { + "BeaconOrganization": { + "description": "Organization owning the Beacon.", + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of the organization." + }, + "name": { + "type": "string", + "description": "Name of the organization." + }, + "description": { + "type": "string", + "description": "Description of the organization." + }, + "address": { + "type": "string", + "description": "Address of the organization." + }, + "welcomeUrl": { + "type": "string", + "description": "URL of the website of the organization (RFC 3986 format)." + }, + "contactUrl": { + "type": "string", + "description": "URL with the contact for the Beacon operator/maintainer, e.g. link to a contact form (RFC 3986 format) or an email (RFC 2368 format)." + }, + "logoUrl": { + "type": "string", + "description": "URL to the logo (PNG/JPG/SVG format) of the organization (RFC 3986 format)." + }, + "info": { + "description": "Additional unspecified metadata about the host Organization.", + "type": "object", + "example": { + "additionalInfoKey": "additionalInfoValue" + } + } + } + } + }, + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/sections/beaconInformationalResponseMeta.json b/bycon/schemas/framework/json/responses/sections/beaconInformationalResponseMeta.json index 8e558c1f3..16950e539 100644 --- a/bycon/schemas/framework/json/responses/sections/beaconInformationalResponseMeta.json +++ b/bycon/schemas/framework/json/responses/sections/beaconInformationalResponseMeta.json @@ -1,25 +1,25 @@ { - "$comment": "TO REVIEW: the required properties below results in a warning in the example.", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, "description": "Meta information about the response.", + "type": "object", "properties": { - "apiVersion": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/ApiVersion", - "description": "Version of the API." - }, "beaconId": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/BeaconId", - "description": "Identifier of the beacon, as defined in `Beacon`." + "description": "Identifier of the beacon, as defined in `Beacon`.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/BeaconId" + }, + "apiVersion": { + "description": "Version of the API.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/ApiVersion" }, "returnedSchemas": { "$ref": "../../common/beaconCommonComponents.json#/definitions/ListOfSchemas" } }, + "$comment": "TO REVIEW: the required properties below results in a warning in the example.", "required": [ "beaconId", "apiVersion", "returnedSchemas" ], - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/sections/beaconReceivedRequestSummary.json b/bycon/schemas/framework/json/responses/sections/beaconReceivedRequestSummary.json index 691c85d56..a5c1cc39a 100644 --- a/bycon/schemas/framework/json/responses/sections/beaconReceivedRequestSummary.json +++ b/bycon/schemas/framework/json/responses/sections/beaconReceivedRequestSummary.json @@ -1,39 +1,40 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Section of the response that summarize the request received as it has been interpreted by teh Beacon server. Although it is not expected to differ from the request received, in case of unexpected results or formats, this summary could help to determine the source of confusion or errors. The required properties include those that every request should have implicitly or explicitly. The request summary is making them explicit.", + "type": "object", "properties": { "apiVersion": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/ApiVersion", - "description": "API version expected by the client to be supported by the server and used in the response format." + "description": "API version expected by the client to be supported by the server and used in the response format.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/ApiVersion" + }, + "requestedSchemas": { + "description": "Set of schemas to be used in the response to a request.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/ListOfSchemas", + "minItems": 0, + "$comment": "TO DO: Add the format attribute as a uri.\n2. minItems:0 is used to confirm that an empty array is acceptable here." }, "filters": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/Filters", - "description": "Ontology based filters. CURIE syntax is encouraged to be used." + "description": "Ontology based filters. CURIE syntax is encouraged to be used.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/Filters" + }, + "requestParameters": { + "description": "Dictionary of request parameters received in the RequestBody", + "$ref": "../../requests/requestParameters.json" }, "includeResultsetResponses": { "$ref": "../../common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" }, "pagination": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/Pagination", - "description": "Pagination to apply on the results." - }, - "requestParameters": { - "$ref": "../../requests/requestParameters.json", - "description": "Dictionary of request parameters received in the RequestBody" + "description": "Pagination to apply on the results.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/Pagination" }, "requestedGranularity": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/Granularity", - "description": "Requested granularity. Targeted Beacon could respond or not with the requested granularity. E.g. record level granularity could be requested, but the Beacon could respond only with boolean or count results." - }, - "requestedSchemas": { - "$comment": "TO DO: Add the format attribute as a uri.\n2. minItems:0 is used to confirm that an empty array is acceptable here.", - "$ref": "../../common/beaconCommonComponents.json#/definitions/ListOfSchemas", - "description": "Set of schemas to be used in the response to a request.", - "minItems": 0 + "description": "Requested granularity. Targeted Beacon could respond or not with the requested granularity. E.g. record level granularity could be requested, but the Beacon could respond only with boolean or count results.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/Granularity" }, "testMode": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/TestMode", - "description": "Used for indicating that a request was received in a test context. Purposed for compliance testing." + "description": "Used for indicating that a request was received in a test context. Purposed for compliance testing.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/TestMode" } }, "required": [ @@ -41,6 +42,5 @@ "requestedSchemas", "pagination", "requestedGranularity" - ], - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/sections/beaconResponseMeta.json b/bycon/schemas/framework/json/responses/sections/beaconResponseMeta.json index 878664f61..fe457637c 100644 --- a/bycon/schemas/framework/json/responses/sections/beaconResponseMeta.json +++ b/bycon/schemas/framework/json/responses/sections/beaconResponseMeta.json @@ -1,29 +1,30 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Information about the response that could be relevant for the Beacon client in order to interpret the results.", + "type": "object", "properties": { - "apiVersion": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/ApiVersion", - "description": "Version of the API." - }, "beaconId": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/BeaconId", - "description": "Identifier of the beacon, as defined in `Beacon`." + "description": "Identifier of the beacon, as defined in `Beacon`.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/BeaconId" }, - "receivedRequestSummary": { - "$ref": "./beaconReceivedRequestSummary.json", - "description": "Section of the response that summarize the request received as it has been interpreted by teh Beacon server." - }, - "returnedGranularity": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/Granularity", - "description": "Requested granularity. Targeted Beacon could respond or not with the requested granularity. E.g. record level granularity could be requested, but the Beacon could respond only with boolean or count results." + "apiVersion": { + "description": "Version of the API.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/ApiVersion" }, "returnedSchemas": { "$ref": "../../common/beaconCommonComponents.json#/definitions/ListOfSchemas" }, + "returnedGranularity": { + "description": "Requested granularity. Targeted Beacon could respond or not with the requested granularity. E.g. record level granularity could be requested, but the Beacon could respond only with boolean or count results.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/Granularity" + }, "testMode": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/TestMode", - "description": "Used for indicating that a response is returned in a test context. Purposed for compliance testing. Information returned could be fake." + "description": "Used for indicating that a response is returned in a test context. Purposed for compliance testing. Information returned could be fake.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/TestMode" + }, + "receivedRequestSummary": { + "description": "Section of the response that summarize the request received as it has been interpreted by teh Beacon server.", + "$ref": "./beaconReceivedRequestSummary.json" } }, "required": [ @@ -32,6 +33,5 @@ "returnedSchemas", "returnedGranularity", "receivedRequestSummary" - ], - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/sections/beaconResultsets.json b/bycon/schemas/framework/json/responses/sections/beaconResultsets.json index 6a60774b0..1dcda9343 100644 --- a/bycon/schemas/framework/json/responses/sections/beaconResultsets.json +++ b/bycon/schemas/framework/json/responses/sections/beaconResultsets.json @@ -1,41 +1,59 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Beacon ResultSet", + "description": "Sets of results to be returned as query response.", + "type": "object", + "properties": { + "$schema": { + "$ref": "../../common/beaconCommonComponents.json#/definitions/$schema" + }, + "resultSets": { + "type": "array", + "items": { + "$ref": "#/definitions/ResultsetInstance" + }, + "minItems": 0 + } + }, + "required": [ + "resultSets" + ], "additionalProperties": true, "definitions": { "ResultsetInstance": { - "additionalProperties": true, + "type": "object", "properties": { + "id": { + "description": "id of the resultset", + "type": "string", + "example": "datasetA" + }, + "setType": { + "description": "Entry type of resultSet. It SHOULD MATCH an entry type declared as collection in the Beacon configuration.", + "type": "string", + "default": "dataset" + }, "exists": { "type": "boolean" }, - "id": { - "description": "id of the resultset", - "example": "datasetA", - "type": "string" + "resultsCount": { + "description": "Number of results in this Resulset.", + "type": "integer" + }, + "resultsHandovers": { + "description": "List of handovers that apply to this resultset, not to the whole Beacon or to a result in particular.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/ListOfHandovers" }, "info": { "description": "Additional details that could be of interest about the Resultset. Provided to clearly enclose any attribute that is not part of the Beacon specification.", "type": "object" }, "results": { + "type": "array", "items": { "type": "object" }, - "minItems": 0, - "type": "array" - }, - "resultsCount": { - "description": "Number of results in this Resulset.", - "type": "integer" - }, - "resultsHandovers": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/ListOfHandovers", - "description": "List of handovers that apply to this resultset, not to the whole Beacon or to a result in particular." - }, - "setType": { - "default": "dataset", - "description": "Entry type of resultSet. It SHOULD MATCH an entry type declared as collection in the Beacon configuration.", - "type": "string" + "minItems": 0 } }, "required": [ @@ -45,25 +63,7 @@ "resultsCount", "results" ], - "type": "object" - } - }, - "description": "Sets of results to be returned as query response.", - "properties": { - "$schema": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/$schema" - }, - "resultSets": { - "items": { - "$ref": "#/definitions/ResultsetInstance" - }, - "minItems": 0, - "type": "array" + "additionalProperties": true } - }, - "required": [ - "resultSets" - ], - "title": "Beacon ResultSet", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/framework/json/responses/sections/beaconSummaryResponseSection.json b/bycon/schemas/framework/json/responses/sections/beaconSummaryResponseSection.json index 20b8d33d6..d1f298c2d 100644 --- a/bycon/schemas/framework/json/responses/sections/beaconSummaryResponseSection.json +++ b/bycon/schemas/framework/json/responses/sections/beaconSummaryResponseSection.json @@ -1,18 +1,18 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "description": "Beacon results summary section.", + "type": "object", "properties": { "exists": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/Exists", - "description": "Indicator of whether any entry was observed. This should be non-null, unless there was an error, in which case an error response is expected instead of this one." + "description": "Indicator of whether any entry was observed. This should be non-null, unless there was an error, in which case an error response is expected instead of this one.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/Exists" }, "numTotalResults": { - "$ref": "../../common/beaconCommonComponents.json#/definitions/NumTotalResults", - "description": "Total number of results." + "description": "Total number of results.", + "$ref": "../../common/beaconCommonComponents.json#/definitions/NumTotalResults" } }, "required": [ "exists" - ], - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/framework/src/responses/beaconCollectionsResponse.yaml b/bycon/schemas/framework/src/responses/beaconCollectionsResponse.yaml index 5488720b4..e7d5734d4 100644 --- a/bycon/schemas/framework/src/responses/beaconCollectionsResponse.yaml +++ b/bycon/schemas/framework/src/responses/beaconCollectionsResponse.yaml @@ -21,14 +21,14 @@ properties: required: - collections additionalProperties: true - info: - description: Additional details that could be of interest. Provided to clearly - enclose any attribute that is not part of the Beacon specification. - $ref: ../common/beaconCommonComponents.yaml#/definitions/Info - beaconHandovers: - description: List of handovers that apply to the whole response, not to any resultset - or result in particular. - $ref: ../common/beaconCommonComponents.yaml#/definitions/ListOfHandovers + # info: + # description: Additional details that could be of interest. Provided to clearly + # enclose any attribute that is not part of the Beacon specification. + # $ref: ../common/beaconCommonComponents.yaml#/definitions/Info + # beaconHandovers: + # description: List of handovers that apply to the whole response, not to any resultset + # or result in particular. + # $ref: ../common/beaconCommonComponents.yaml#/definitions/ListOfHandovers required: - meta - responseSummary diff --git a/bycon/schemas/models/json/progenetix-database-schemas/pgxBiosample.json b/bycon/schemas/models/json/progenetix-database-schemas/pgxBiosample.json index 432194f32..1ef1d4fd0 100644 --- a/bycon/schemas/models/json/progenetix-database-schemas/pgxBiosample.json +++ b/bycon/schemas/models/json/progenetix-database-schemas/pgxBiosample.json @@ -1,86 +1,72 @@ { - "$id": "https://progenetix.org/services/schemas/pgxBiosample/v2022-03-01", "$schema": "https://json-schema.org/draft/2020-12/schema", - "definitions": { - "AnalysisInfo": { - "properties": { - "experiment_id": { - "type": "string" - }, - "platform_id": { - "type": "string" - }, - "series_id": { - "type": "string" - } - } - } - }, + "$id": "https://progenetix.org/services/schemas/pgxBiosample/v2022-03-01", + "title": "Progenetix Biosample", + "type": "object", "description": "A Biosample refers to a unit of biological material from which the substrate molecules (e.g. genomic DNA, RNA, proteins) for molecular analyses (e.g. sequencing, array hybridisation, mass-spectrometry) are extracted. Examples would be a tissue biopsy, a single cell from a culture for single cell genome sequencing or a protein fraction from a gradient centrifugation. Several instances (e.g. technical replicates) or types of experiments (e.g. genomic array as well as RNA-seq experiments) may refer to the same Biosample.", + "required": [ + "id" + ], "properties": { - "analysisInfo": { - "$ref": "#/definitions/AnalysisInfo" - }, - "biosampleStatus": { - "$ref": "../progenetix-model/common/ontologyTerm.json", - "description": "Ontology value from Experimental Factor Ontology (EFO) Material Entity term (BFO:0000040)." - }, - "celllineInfo": { - "$ref": "../progenetix-model/common/celllineInfo.json" - }, - "cohorts": { - "description": "Cohorts describe collections of samples or individuals which are part of a common epistemic group, e.g. have been used for a study or share a set of features.\n", + "id": { + "type": "string", "examples": [ - { - "id": "pgxcohort-arraymap", - "label": "arrayMap collection" - } - ], - "items": { - "$ref": "../progenetix-model/common/ontologyTerm.json" - }, - "type": "array" + "pgxbs-kftvjtgm" + ] }, - "collectionMoment": { - "description": "Individual's or cell cullture age at the time of sample collection in the ISO8601 duration format `P[n]Y[n]M[n]DT[n]H[n]M[n]S`.", + "individualId": { + "type": "string", "examples": [ - "P32Y6M1D", - "P7D" - ], - "type": "string" + "pgxind-kftx5ruq" + ] }, "description": { + "type": "string", "examples": [ "breast carcinoma", "adenocarcinoma [cell line HeLa]" - ], - "type": "string" + ] }, "externalReferences": { + "type": "array", + "items": { + "$ref": "../progenetix-model/common/externalReference.json" + }, "examples": [ { "id": "PMID:9892199" } - ], + ] + }, + "celllineInfo": { + "$ref": "../progenetix-model/common/celllineInfo.json" + }, + "cohorts": { + "description": "Cohorts describe collections of samples or individuals which are part of a common epistemic group, e.g. have been used for a study or share a set of features.\n", + "type": "array", "items": { - "$ref": "../progenetix-model/common/externalReference.json" + "$ref": "../progenetix-model/common/ontologyTerm.json" }, - "type": "array" - }, - "followupState": { - "$ref": "../progenetix-model/common/ontologyTerm.json", "examples": [ { - "id": "pgx:FU0005", - "label": "death from disease" + "id": "pgxcohort-arraymap", + "label": "arrayMap collection" } ] }, - "followupTime": { + "collectionMoment": { + "description": "Individual's or cell cullture age at the time of sample collection in the ISO8601 duration format `P[n]Y[n]M[n]DT[n]H[n]M[n]S`.", + "type": "string", "examples": [ - "P23M" - ], - "type": "string" + "P32Y6M1D", + "P7D" + ] + }, + "provenance": { + "$ref": "../progenetix-model/common/provenance.json" + }, + "sampleOriginDetail": { + "$ref": "../progenetix-model/common/ontologyTerm.json" }, "histologicalDiagnosis": { "$ref": "../progenetix-model/common/ontologyTerm.json", @@ -92,8 +78,8 @@ ] }, "icdoMorphology": { - "$ref": "../progenetix-model/common/ontologyTerm.json", "description": "The ICD-O 3 morphology code of this biosample, in a \"pseudo-prefixed\" transformation (since no direct ICD-O 3 registry can be referenced).", + "$ref": "../progenetix-model/common/ontologyTerm.json", "examples": [ { "id": "icdom-94703", @@ -102,8 +88,8 @@ ] }, "icdoTopography": { - "$ref": "../progenetix-model/common/ontologyTerm.json", "description": "The ICD-O 3 topography code of this biosample, in a \"pseudo-prefixed\" transformation (since no direct ICD-O 3 registry can be referenced).", + "$ref": "../progenetix-model/common/ontologyTerm.json", "examples": [ { "id": "icdot-C71.6", @@ -111,25 +97,56 @@ } ] }, - "id": { - "examples": [ - "pgxbs-kftvjtgm" - ], - "type": "string" + "biosampleStatus": { + "description": "Ontology value from Experimental Factor Ontology (EFO) Material Entity term (BFO:0000040).", + "$ref": "../progenetix-model/common/ontologyTerm.json" }, - "individualId": { + "tumorProgression": { + "$ref": "../progenetix-model/common/ontologyTerm.json", "examples": [ - "pgxind-kftx5ruq" - ], - "type": "string" + { + "id": "NCIT:C3677", + "label": "Benign Neoplasm" + }, + { + "id": "NCIT:C8450", + "label": "Primary Malignant Neoplasm" + }, + { + "id": "NCIT:C95606", + "label": "Second Primary Malignant Neoplasm" + }, + { + "id": "NCIT:C3261", + "label": "Metastatic Neoplasm" + }, + { + "id": "NCIT:C4813", + "label": "Recurrent Malignant Neoplasm" + } + ] }, - "info": { - "description": "Additional structured data which may not be common across different Beacon instances.", - "type": "object" + "tumorGrade": { + "description": "Tumor grade as child term of NCIT:C28076 (Disease Grade Qualifier) or equivalent.\n", + "$ref": "../progenetix-model/common/ontologyTerm.json", + "examples": [ + { + "id": "NCIT:C28076", + "label": "grade 3" + }, + { + "id": "NCIT:C28080", + "label": "Grade 3a" + }, + { + "id": "NCIT:C62397", + "label": "WHO Central Nervous System Grade IV" + } + ] }, "pathologicalStage": { - "$ref": "../progenetix-model/common/ontologyTerm.json", "description": "Pathological stage, as subclass of NCIT:C28108 - Disease Stage Qualifier.\n", + "$ref": "../progenetix-model/common/ontologyTerm.json", "examples": [ { "id": "NCIT:C27977", @@ -143,6 +160,10 @@ }, "pathologicalTnmFinding": { "description": "A child class of NCIT:C48698 Cancer TNM Finding Category\n", + "type": "array", + "items": { + "$ref": "../progenetix-model/common/ontologyTerm.json" + }, "examples": [ [ { @@ -154,72 +175,51 @@ "label": "T1 Stage Finding" } ] - ], - "items": { - "$ref": "../progenetix-model/common/ontologyTerm.json" - }, - "type": "array" - }, - "provenance": { - "$ref": "../progenetix-model/common/provenance.json" - }, - "sampleOriginDetail": { - "$ref": "../progenetix-model/common/ontologyTerm.json" + ] }, - "tumorGrade": { + "followupState": { "$ref": "../progenetix-model/common/ontologyTerm.json", - "description": "Tumor grade as child term of NCIT:C28076 (Disease Grade Qualifier) or equivalent.\n", "examples": [ { - "id": "NCIT:C28076", - "label": "grade 3" - }, - { - "id": "NCIT:C28080", - "label": "Grade 3a" - }, - { - "id": "NCIT:C62397", - "label": "WHO Central Nervous System Grade IV" + "id": "pgx:FU0005", + "label": "death from disease" } ] }, - "tumorProgression": { - "$ref": "../progenetix-model/common/ontologyTerm.json", + "followupTime": { + "type": "string", "examples": [ - { - "id": "NCIT:C3677", - "label": "Benign Neoplasm" - }, - { - "id": "NCIT:C8450", - "label": "Primary Malignant Neoplasm" - }, - { - "id": "NCIT:C95606", - "label": "Second Primary Malignant Neoplasm" - }, - { - "id": "NCIT:C3261", - "label": "Metastatic Neoplasm" - }, - { - "id": "NCIT:C4813", - "label": "Recurrent Malignant Neoplasm" - } + "P23M" ] }, + "analysisInfo": { + "$ref": "#/definitions/AnalysisInfo" + }, "updated": { + "type": "string", + "format": "date-time", "examples": [ "2020-09-10T17:44:10.170Z" - ], - "format": "date-time", - "type": "string" + ] + }, + "info": { + "description": "Additional structured data which may not be common across different Beacon instances.", + "type": "object" } }, - "required": [ - "id" - ], - "title": "Progenetix Biosample", - "type": "object" + "definitions": { + "AnalysisInfo": { + "properties": { + "experiment_id": { + "type": "string" + }, + "platform_id": { + "type": "string" + }, + "series_id": { + "type": "string" + } + } + } + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-database-schemas/pgxCallset.json b/bycon/schemas/models/json/progenetix-database-schemas/pgxCallset.json index 48ba6d28f..3a6078783 100644 --- a/bycon/schemas/models/json/progenetix-database-schemas/pgxCallset.json +++ b/bycon/schemas/models/json/progenetix-database-schemas/pgxCallset.json @@ -1,196 +1,196 @@ { - "$id": "https://progenetix.org/services/schemas/pgxCallset/v2022-03-07", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, - "definitions": { - "Chrofractions": { - "properties": { - "1": { - "$ref": "#/definitions/Cnvstatistics" - }, - "1p": { - "$ref": "#/definitions/Cnvstatistics" - }, - "1q": { - "$ref": "#/definitions/Cnvstatistics" - }, - "additionalProperties": true - } - }, - "Cnvstatistics": { - "properties": { - "cnvcoverage": { - "description": "sum of genome bases called as CNV", - "type": "integer" - }, - "cnvfraction": { - "description": "genome fraction called as CNV", - "max": 1, - "min": 0, - "type": "number" - }, - "delcoverage": { - "description": "sum of genome bases called as loss CNV", - "type": "integer" - }, - "delfraction": { - "description": "genome fraction called as CNV", - "max": 1, - "min": 0, - "type": "number" - }, - "dupcoverage": { - "description": "sum of genome bases called as gain CNV", - "type": "integer" - }, - "dupfraction": { - "description": "genome fraction called as CNV", - "max": 1, - "min": 0, - "type": "number" - } - } - }, - "Statusmaps": { - "properties": { - "binning": { - "description": "type of genomic bins", - "examples": [ - "1Mb" - ], - "type": "string" - }, - "del": { - "description": "Array of fractional values for the loss coverage...", - "items": "number", - "type": "array" - }, - "dup": { - "description": "Array of fractional values for the gain coverage of the respective genomic bins. The length of the array corresponds to the `interval_count` value.", - "items": "number", - "type": "array" - }, - "interval_count": { - "description": "number of genomic bins", - "type": "integer" - }, - "max": { - "description": "Array of the maximum values (usually log2) observed in the called bins", - "items": "number", - "type": "array" - }, - "min": { - "description": "Array of the minimum values (usually log2) observed in the called bins", - "items": "number", - "type": "array" - } - } - } - }, + "$id": "https://progenetix.org/services/schemas/pgxCallset/v2022-03-07", + "title": "pgxCallset", + "type": "object", "properties": { + "id": { + "type": "string", + "examples": [ + "pgxcs-kftvldsu" + ] + }, "biosampleId": { + "type": "string", "examples": [ "pgxbs-kftva59y" - ], - "type": "string" - }, - "cnvChroStats": { - "$ref": "#/definitions/Cnvstatistics" - }, - "cnvStats": { - "$ref": "#/definitions/Cnvstatistics" + ] }, - "cnvStatusmaps": { - "$ref": "#/definitions/Statusmaps" + "individualId": { + "type": "string", + "examples": [ + "pgxbs-kftva59y" + ] }, "description": { + "type": "string", "examples": [ "SNP6 array" - ], - "type": "string" + ] }, - "experimentAccession": { + "platformModel": { + "description": "Ontology value for experimental platform or methodology used. For sequencing platforms the use of \"OBI:0400103 - DNA sequencer\" is suggested.", "$ref": "../common/ontologyTerm.json", - "description": "Identifier for primary experimental data.", "examples": [ { - "id": "geo:GSM93480" + "id": "geo:GPL3381", + "label": "Stanford Microarray Facility cDNA array [SHDV]" + }, + { + "id": "OBI:0002750", + "label": "Oxford Nanopore MinION" + }, + { + "id": "EFO:0010938", + "label": "large-insert clone DNA microarray" } ] }, - "id": { - "examples": [ - "pgxcs-kftvldsu" - ], - "type": "string" - }, - "individualId": { - "examples": [ - "pgxbs-kftva59y" - ], - "type": "string" - }, - "info": { - "type": "object" - }, "pipelineInfo": { - "$ref": "../common/externalReference.json", "description": "Public or local pipeline identifier with version, as well as link and notes.", + "$ref": "../common/externalReference.json", "examples": [ { "id": "Pipeline-panel-0001-v1", - "note": "Higly customized workflow. Please contact us at dev/null.", - "reference\"": "https://doi.org/10.48511/workflowhub.workflow.111.1" + "reference\"": "https://doi.org/10.48511/workflowhub.workflow.111.1", + "note": "Higly customized workflow. Please contact us at dev/null." }, { "id": "aroma.affymetrix", - "notes\"": "The aroma.affymetrix package is an R package for analyzing small to extremely large Affymetrix data sets.", - "reference": "http://www.aroma-project.org" + "reference": "http://www.aroma-project.org", + "notes\"": "The aroma.affymetrix package is an R package for analyzing small to extremely large Affymetrix data sets." } ] }, - "platformModel": { + "experimentAccession": { + "description": "Identifier for primary experimental data.", "$ref": "../common/ontologyTerm.json", - "description": "Ontology value for experimental platform or methodology used. For sequencing platforms the use of \"OBI:0400103 - DNA sequencer\" is suggested.", "examples": [ { - "id": "geo:GPL3381", - "label": "Stanford Microarray Facility cDNA array [SHDV]" - }, - { - "id": "OBI:0002750", - "label": "Oxford Nanopore MinION" - }, - { - "id": "EFO:0010938", - "label": "large-insert clone DNA microarray" + "id": "geo:GSM93480" } ] }, - "provenance": { - "$ref": "../common/provenance.json" - }, "seriesAccession": { - "$ref": "../common/ontologyTerm.json", "description": "Identifier for primary experimental series.", + "$ref": "../common/ontologyTerm.json", "examples": [ { "id": "geo:GSE4079" } ] }, + "provenance": { + "$ref": "../common/provenance.json" + }, + "cnvStatusmaps": { + "$ref": "#/definitions/Statusmaps" + }, + "cnvStats": { + "$ref": "#/definitions/Cnvstatistics" + }, + "cnvChroStats": { + "$ref": "#/definitions/Cnvstatistics" + }, + "info": { + "type": "object" + }, "updated": { + "type": "string", + "format": "date-time", "examples": [ "2020-09-10T17:44:10.170Z" - ], - "format": "date-time", - "type": "string" + ] + } + }, + "definitions": { + "Statusmaps": { + "properties": { + "interval_count": { + "description": "number of genomic bins", + "type": "integer" + }, + "binning": { + "description": "type of genomic bins", + "type": "string", + "examples": [ + "1Mb" + ] + }, + "dup": { + "description": "Array of fractional values for the gain coverage of the respective genomic bins. The length of the array corresponds to the `interval_count` value.", + "type": "array", + "items": "number" + }, + "del": { + "description": "Array of fractional values for the loss coverage...", + "type": "array", + "items": "number" + }, + "max": { + "description": "Array of the maximum values (usually log2) observed in the called bins", + "type": "array", + "items": "number" + }, + "min": { + "description": "Array of the minimum values (usually log2) observed in the called bins", + "type": "array", + "items": "number" + } + } + }, + "Chrofractions": { + "properties": { + "1": { + "$ref": "#/definitions/Cnvstatistics" + }, + "1p": { + "$ref": "#/definitions/Cnvstatistics" + }, + "1q": { + "$ref": "#/definitions/Cnvstatistics" + }, + "additionalProperties": true + } + }, + "Cnvstatistics": { + "properties": { + "cnvcoverage": { + "description": "sum of genome bases called as CNV", + "type": "integer" + }, + "dupcoverage": { + "description": "sum of genome bases called as gain CNV", + "type": "integer" + }, + "delcoverage": { + "description": "sum of genome bases called as loss CNV", + "type": "integer" + }, + "cnvfraction": { + "description": "genome fraction called as CNV", + "type": "number", + "min": 0, + "max": 1 + }, + "dupfraction": { + "description": "genome fraction called as CNV", + "type": "number", + "min": 0, + "max": 1 + }, + "delfraction": { + "description": "genome fraction called as CNV", + "type": "number", + "min": 0, + "max": 1 + } + } } }, "required": [ "id", "biosampleId" ], - "title": "pgxCallset", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-database-schemas/pgxCollation.json b/bycon/schemas/models/json/progenetix-database-schemas/pgxCollation.json index 8889b6b79..d2a23ce83 100644 --- a/bycon/schemas/models/json/progenetix-database-schemas/pgxCollation.json +++ b/bycon/schemas/models/json/progenetix-database-schemas/pgxCollation.json @@ -1,36 +1,7 @@ { - "$id": "https://progenetix.org/services/schemas/pgxCollation/v2022-03-08", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, - "definitions": { - "HierarchyPath": { - "description": "A path from the root of a hierarchy to - and including - a given term id.", - "properties": { - "depth": { - "description": "The number of codes on the path upstream of the term.", - "type": "integer" - }, - "order": { - "description": "The position in a rooted hierarchy, where each branch ends on a separate line.", - "type": "integer" - }, - "path": { - "description": "All ordered terms of this path, starting from the root term and ending with, and including, the current term.", - "examples": [ - [ - "NCIT:C3262", - "NCIT:C7062", - "NCIT:C9305", - "NCIT:C7055", - "NCIT:C3167" - ] - ], - "type": "array" - } - } - } - }, - "description": "A Collation summarizes information of all biosamples matching a given term (e.g. PMID or NCIT code), as well as the connected items if the code is part of a hierarchy (paths leading to the code, child terms).", + "$id": "https://progenetix.org/services/schemas/pgxCollation/v2022-03-08", + "title": "pgxCollation", "meta": { "contributors": [ { @@ -46,92 +17,95 @@ ], "sb_status": "community" }, + "description": "A Collation summarizes information of all biosamples matching a given term (e.g. PMID or NCIT code), as well as the connected items if the code is part of a hierarchy (paths leading to the code, child terms).", "properties": { - "childTerms": { - "description": "All downstream terms, from all paths of this term in a hierarchical system including itself.", + "id": { + "type": "string", "examples": [ - [ - "NCIT:C3168", - "NCIT:C9142", - "NCIT:C8644", - "NCIT:C9143", - "NCIT:C4967", - "NCIT:C9140", - "NCIT:C7953" - ], - [ - "PMID:22824167" - ] - ], - "type": "array" + "NCIT:C9272", + "NCIT:C3167", + "PMID:22824167" + ] }, - "codeMatches": { - "description": "The number of biosamples in the collection with this code. This can be 0 if the entity is only represented through its child terms.\n", - "type": "integer" + "label": { + "type": "string", + "examples": [ + "Salivary Gland Carcinoma", + "Acute Lymphoblastic Leukemia", + "Beleut M, Zimmermann P et al. (2012): Integrative genome-wide expression profiling identifies three..." + ] }, "collationType": { "description": "Key for the type of filter definition used to map the corresponding collation items (e.g. biosamples, analyses...). These only sometimes correspond directly to prefixes, when unanimous (PMID ...).", + "type": "string", "examples": [ "PMID", "NCITstage", "NCITtnm", "icdom" - ], - "type": "string" + ] }, - "count": { - "description": "The number of biosamples in the collection with this code or one of its child terms.\n", - "type": "integer" + "namespacePrefix": { + "type": "string", + "examples": [ + "pgx", + "PMID", + "NCIT", + "UBERON" + ] }, "datasetId": { "description": "The dataset the collation was generated from.", + "type": "string", "examples": [ "progenetix" - ], - "type": "string" + ] + }, + "reference": { + "description": "A url to the code, in a local or remote location.", + "type": "string", + "examples": [ + "https://nciterms.nci.nih.gov/ncitbrowser/ConceptReport.jsp?dictionary=NCI_Thesaurus&ns=ncit&code=C2910" + ] + }, + "scope": { + "description": "The scope (i.e. the data collection) the collation items are retrieved from.", + "type": "string", + "oneOf": [ + "biosamples", + "analyses", + "individuals" + ] }, "dbKey": { "description": "The key in the corresponding collection (scope), in dot annotation.", + "type": "string", "examples": [ "histological_diagnosis.id", "sample_origin_detail.id", "sex.id" - ], - "type": "string" - }, - "hierarchyPaths": { - "description": "All term paths leading to any instance of this code from the hierarchy root term.\n", - "items": { - "$ref": "#/definitions/HierarchyPath/properties" - }, - "type": "array" - }, - "id": { - "examples": [ - "NCIT:C9272", - "NCIT:C3167", - "PMID:22824167" - ], - "type": "string" + ] }, - "label": { - "examples": [ - "Salivary Gland Carcinoma", - "Acute Lymphoblastic Leukemia", - "Beleut M, Zimmermann P et al. (2012): Integrative genome-wide expression profiling identifies three..." - ], - "type": "string" - }, - "namespacePrefix": { + "childTerms": { + "type": "array", + "description": "All downstream terms, from all paths of this term in a hierarchical system including itself.", "examples": [ - "pgx", - "PMID", - "NCIT", - "UBERON" - ], - "type": "string" + [ + "NCIT:C3168", + "NCIT:C9142", + "NCIT:C8644", + "NCIT:C9143", + "NCIT:C4967", + "NCIT:C9140", + "NCIT:C7953" + ], + [ + "PMID:22824167" + ] + ] }, "parentTerms": { + "type": "array", "description": "All upstream terms, from all paths, of this term in a hierarchical system including itself.", "examples": [ [ @@ -142,32 +116,58 @@ [ "PMID:22824167" ] - ], - "type": "array" + ] }, - "reference": { - "description": "A url to the code, in a local or remote location.", - "examples": [ - "https://nciterms.nci.nih.gov/ncitbrowser/ConceptReport.jsp?dictionary=NCI_Thesaurus&ns=ncit&code=C2910" - ], - "type": "string" + "hierarchyPaths": { + "type": "array", + "items": { + "$ref": "#/definitions/HierarchyPath/properties" + }, + "description": "All term paths leading to any instance of this code from the hierarchy root term.\n" }, - "scope": { - "description": "The scope (i.e. the data collection) the collation items are retrieved from.", - "oneOf": [ - "biosamples", - "analyses", - "individuals" - ], - "type": "string" + "count": { + "type": "integer", + "description": "The number of biosamples in the collection with this code or one of its child terms.\n" + }, + "codeMatches": { + "type": "integer", + "description": "The number of biosamples in the collection with this code. This can be 0 if the entity is only represented through its child terms.\n" }, "updated": { + "type": "string", + "format": "date-time", "examples": [ "2022-03-08T10:44:10.170Z" - ], - "format": "date-time", - "type": "string" + ] + } + }, + "definitions": { + "HierarchyPath": { + "description": "A path from the root of a hierarchy to - and including - a given term id.", + "properties": { + "depth": { + "type": "integer", + "description": "The number of codes on the path upstream of the term." + }, + "order": { + "type": "integer", + "description": "The position in a rooted hierarchy, where each branch ends on a separate line." + }, + "path": { + "type": "array", + "description": "All ordered terms of this path, starting from the root term and ending with, and including, the current term.", + "examples": [ + [ + "NCIT:C3262", + "NCIT:C7062", + "NCIT:C9305", + "NCIT:C7055", + "NCIT:C3167" + ] + ] + } + } } }, - "title": "pgxCollation" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-database-schemas/pgxIndividual.json b/bycon/schemas/models/json/progenetix-database-schemas/pgxIndividual.json index 2d259321a..beb2bedf9 100644 --- a/bycon/schemas/models/json/progenetix-database-schemas/pgxIndividual.json +++ b/bycon/schemas/models/json/progenetix-database-schemas/pgxIndividual.json @@ -1,80 +1,80 @@ { - "$id": "https://progenetix.org/services/schemas/pgxIndividual/v2022-03-07", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "$id": "https://progenetix.org/services/schemas/pgxIndividual/v2022-03-07", + "title": "pgxIndividual", + "type": "object", "description": "An pgxIndividual entry stores information about the individual (subject) from which biosamples were extracted (e.g. cancer samples, reference tissue), but where this information is shared to all the derived mobjects (e.g. genotypic sex ...).", + "required": [ + "id" + ], "properties": { - "ancestries": { - "items": { - "$ref": "../common/ancestry.json" - }, - "type": "array" - }, - "description": { + "id": { + "type": "string", + "description": "The resource-local identifier for this individual.", "examples": [ - "HapMap project contributor" - ], - "type": "string" + "pgxind-kftx25eh" + ] + }, + "sex": { + "$ref": "../common/commonDefinitions.json#/definitions/Sex" + }, + "ethnicity": { + "$ref": "../common/commonDefinitions.json#/definitions/Ethnicity" }, "diseases": { + "type": "array", "items": { "$ref": "../common/disease.json" - }, - "type": "array" + } }, - "ethnicity": { - "$ref": "../common/commonDefinitions.json#/definitions/Ethnicity" + "info": { + "description": "Additional structured data which may not be common across different resources.", + "type": "object" + }, + "description": { + "type": "string", + "examples": [ + "HapMap project contributor" + ] }, "externalReferences": { + "type": "array", + "items": { + "$ref": "../common/externalReference.json" + }, "examples": [ { - "description": "HapMap individual", - "id": "biosample:SAME122868" + "id": "biosample:SAME122868", + "description": "HapMap individual" }, { "id": "PMID:9950502" }, { - "description": "Prognostic analysis of mantle cell lymphoma genomes", - "id": "geo:GSE13331" + "id": "geo:GSE13331", + "description": "Prognostic analysis of mantle cell lymphoma genomes" } - ], - "items": { - "$ref": "../common/externalReference.json" - }, - "type": "array" - }, - "id": { - "description": "The resource-local identifier for this individual.", - "examples": [ - "pgxind-kftx25eh" - ], - "type": "string" + ] }, - "info": { - "description": "Additional structured data which may not be common across different resources.", - "type": "object" + "vitalStatus": { + "$ref": "../common/vitalStatus.json" }, "provenance": { "$ref": "../common/provenance.json" }, - "sex": { - "$ref": "../common/commonDefinitions.json#/definitions/Sex" + "ancestries": { + "type": "array", + "items": { + "$ref": "../common/ancestry.json" + } }, "updated": { + "type": "string", + "format": "date-time", "examples": [ "2020-09-10T17:44:10.170Z" - ], - "format": "date-time", - "type": "string" - }, - "vitalStatus": { - "$ref": "../common/vitalStatus.json" + ] } }, - "required": [ - "id" - ], - "title": "pgxIndividual", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-database-schemas/pgxVariant.json b/bycon/schemas/models/json/progenetix-database-schemas/pgxVariant.json index 7aeb18309..878822a5b 100644 --- a/bycon/schemas/models/json/progenetix-database-schemas/pgxVariant.json +++ b/bycon/schemas/models/json/progenetix-database-schemas/pgxVariant.json @@ -1,68 +1,37 @@ { - "$id": "https://progenetix.org/services/schemas/pgx23Variant/v2023-05-25", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, - "definitions": { - "Location": { - "properties": { - "chromosome": { - "description": "the chromosome in its bare form `7`, `X`", - "type": "string" - }, - "end": { - "type": "integer" - }, - "sequenceId": { - "type": "string" - }, - "start": { - "type": "integer" - } - }, - "type": "object" - } - }, + "$id": "https://progenetix.org/services/schemas/pgx23Variant/v2023-05-25", + "title": "Progenetix Database Variant", + "type": "object", "description": "Schema for a genomic variant in Progenetix collections.", + "required": [ + "biosampleId", + "variantInternalId", + "variantState", + "location" + ], "properties": { - "biosampleId": { + "id": { + "type": "string" + }, + "variantInternalId": { "type": "string" }, "callsetId": { "type": "string" }, - "id": { + "biosampleId": { "type": "string" }, "individualId": { "type": "string" }, - "info": { - "type": "object" - }, "location": { "$ref": "#/definitions/Location" }, - "referenceSequence": { - "pattern": "^([ACGTUNRYSWKMBDHV\\-\\.]*)$", - "type": "string" - }, - "sequence": { - "pattern": "^([ACGTUNRYSWKMBDHV\\-\\.]*)$", - "type": "string" - }, - "updated": { - "examples": [ - "2020-09-10T17:44:10.170Z" - ], - "format": "date-time", - "type": "string" - }, - "variantInternalId": { - "type": "string" - }, "variantState": { - "$ref": "../progenetix-model/common/ontologyTerm.json", "description": "The parameter is used to define the type of variant, with current use cases either being delineated as `SO:0001059: sequence_alteration` or as one of the children of `EFO:0030063 genomic copy number assessment`", + "$ref": "../progenetix-model/common/ontologyTerm.json", "examples": [ { "id": "SO:0001059", @@ -73,14 +42,45 @@ "label": "copy number loss" } ] + }, + "sequence": { + "type": "string", + "pattern": "^([ACGTUNRYSWKMBDHV\\-\\.]*)$" + }, + "referenceSequence": { + "type": "string", + "pattern": "^([ACGTUNRYSWKMBDHV\\-\\.]*)$" + }, + "info": { + "type": "object" + }, + "updated": { + "type": "string", + "format": "date-time", + "examples": [ + "2020-09-10T17:44:10.170Z" + ] } }, - "required": [ - "biosampleId", - "variantInternalId", - "variantState", - "location" - ], - "title": "Progenetix Database Variant", - "type": "object" + "definitions": { + "Location": { + "type": "object", + "properties": { + "sequenceId": { + "type": "string" + }, + "chromosome": { + "description": "the chromosome in its bare form `7`, `X`", + "type": "string" + }, + "start": { + "type": "integer" + }, + "end": { + "type": "integer" + } + } + } + }, + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/analyses/defaultSchema.json b/bycon/schemas/models/json/progenetix-model/analyses/defaultSchema.json index 1475e67f2..9724c7fad 100644 --- a/bycon/schemas/models/json/progenetix-model/analyses/defaultSchema.json +++ b/bycon/schemas/models/json/progenetix-model/analyses/defaultSchema.json @@ -1,47 +1,36 @@ { - "$id": "https://progenetix.org/services/schemas/analysis/v2021-11-01", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "$id": "https://progenetix.org/services/schemas/analysis/v2021-11-01", + "title": "analysis", + "type": "object", "properties": { - "biosampleId": { - "examples": [ - "pgxbs-kftva59y" - ], - "type": "string" - }, - "description": { - "examples": [ - "SNP6 array" - ], - "type": "string" - }, - "experimentAccession": { - "$ref": "../common/ontologyTerm.json", - "description": "Identifier for primary experimental data. Provenance: progenetix.org", + "id": { + "type": "string", "examples": [ - { - "id": "geo:GSM93480" - } + "pgxcs-kftvldsu" ] }, - "id": { + "biosampleId": { + "type": "string", "examples": [ - "pgxcs-kftvldsu" - ], - "type": "string" + "pgxbs-kftva59y" + ] }, "individualId": { + "type": "string", "examples": [ "pgxbs-kftva59y" - ], - "type": "string" + ] }, - "info": { - "type": "object" + "description": { + "type": "string", + "examples": [ + "SNP6 array" + ] }, "platformModel": { - "$ref": "../common/ontologyTerm.json", "description": "Ontology value for experimental platform or methodology used. For sequencing platforms the use of \"OBI:0400103 - DNA sequencer\" is suggested.", + "$ref": "../common/ontologyTerm.json", "examples": [ { "id": "geo:GPL3381", @@ -57,30 +46,41 @@ } ] }, - "provenance": { - "$ref": "../common/provenance.json" + "experimentAccession": { + "description": "Identifier for primary experimental data. Provenance: progenetix.org", + "$ref": "../common/ontologyTerm.json", + "examples": [ + { + "id": "geo:GSM93480" + } + ] }, "seriesAccession": { - "$ref": "../common/ontologyTerm.json", "description": "Identifier for primary experimental series. Provenance: progenetix.org", + "$ref": "../common/ontologyTerm.json", "examples": [ { "id": "geo:GSE4079" } ] }, + "provenance": { + "$ref": "../common/provenance.json" + }, + "info": { + "type": "object" + }, "updated": { + "type": "string", + "format": "date-time", "examples": [ "2020-09-10T17:44:10.170Z" - ], - "format": "date-time", - "type": "string" + ] } }, "required": [ "id", "biosampleId" ], - "title": "analysis", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/analyses/endpoints.json b/bycon/schemas/models/json/progenetix-model/analyses/endpoints.json index e6d44453f..74ac36096 100644 --- a/bycon/schemas/models/json/progenetix-model/analyses/endpoints.json +++ b/bycon/schemas/models/json/progenetix-model/analyses/endpoints.json @@ -1,98 +1,21 @@ { - "components": { - "parameters": { - "entryId": { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - "filters": { - "in": "query", - "name": "filters", - "schema": { - "examples": [ - [ - "variantcaller:GATK4.0" - ] - ], - "items": { - "type": "string" - }, - "type": "array" - } - }, - "includeResultsetResponses": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" - }, - "limit": { - "in": "query", - "name": "limit", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" - } - }, - "requestedSchema": { - "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", - "example": "ga4gh-service-info-v1.0", - "in": "query", - "name": "requestedSchema", - "required": false, - "schema": { - "type": "string" - } - }, - "skip": { - "in": "query", - "name": "skip", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" - } - } - }, - "responses": { - "ResultsOKResponse": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" - } - ] - } - } - }, - "description": "Successful operation." - } - } - }, + "openapi": "3.0.2", + "servers": [], "info": { + "version": "2.0.0", + "title": "GA4GH Beacon API Specification - Analysis endpoints", + "description": "TBD", "contact": { "email": "beacon@ga4gh.org" }, - "description": "TBD", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "title": "GA4GH Beacon API Specification - Analysis endpoints", - "version": "2.0.0" + } }, - "openapi": "3.0.2", "paths": { "/analyses": { "get": { - "description": "Get a list of bioinformatics analysis", - "operationId": "getAnalyses", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -110,6 +33,11 @@ "$ref": "#/components/parameters/filters" } ], + "description": "Get a list of bioinformatics analysis", + "operationId": "getAnalyses", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" @@ -117,14 +45,14 @@ "default": { "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] + } }, "post": { "description": "Get a list of bioinformatics analysis", "operationId": "postAnalysesRequest", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -137,50 +65,50 @@ }, "responses": { "200": { + "description": "Successful operation", "content": { "application/json": { "schema": { "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" } } - }, - "description": "Successful operation" + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, "/analyses/{id}": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { "description": "Get details about one bioinformatics analysis, identified by its (unique) 'id'", "operationId": "getOneAnalysis", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { "description": "Get details about one bioinformatics analysis, identified by its (unique) 'id'", "operationId": "postOneAnalysisRequest", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -196,19 +124,19 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, "/analyses/{id}/g_variants": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the list of variants instances for one bioinformatics analysis, identified by its (unique) 'id'", - "operationId": "getOneAnalysisVariants", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -220,27 +148,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the list of variants instances for one bioinformatics analysis, identified by its (unique) 'id'", + "operationId": "getOneAnalysisVariants", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { "description": "Get the list of variants instances for one bioinformatics analysis, identified by its (unique) 'id'", "operationId": "postOneAnalysisVariantsRequest", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -256,15 +184,87 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } } }, - "servers": [] + "components": { + "responses": { + "ResultsOKResponse": { + "description": "Successful operation.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" + } + ] + } + } + } + } + }, + "parameters": { + "requestedSchema": { + "name": "requestedSchema", + "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "example": "ga4gh-service-info-v1.0" + }, + "skip": { + "name": "skip", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" + } + }, + "limit": { + "name": "limit", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" + } + }, + "includeResultsetResponses": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" + }, + "entryId": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "filters": { + "name": "filters", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "variantcaller:GATK4.0" + ] + ] + } + } + } + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/analyses/examples/analyses-MAX-example.json b/bycon/schemas/models/json/progenetix-model/analyses/examples/analyses-MAX-example.json index 7d7184e68..681e7f82f 100644 --- a/bycon/schemas/models/json/progenetix-model/analyses/examples/analyses-MAX-example.json +++ b/bycon/schemas/models/json/progenetix-model/analyses/examples/analyses-MAX-example.json @@ -1,12 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "aligner": "bwa-0.7.8", - "analysisDate": "2021-10-17", - "biosampleId": "S0001", "id": "analyses-example-0001", + "runId": "SRR10903401", + "biosampleId": "S0001", "individualId": "P0001", + "analysisDate": "2021-10-17", "pipelineName": "Pipeline-panel-0001-v1", "pipelineRef": "https://doi.org/10.48511/workflowhub.workflow.111.1", - "runId": "SRR10903401", + "aligner": "bwa-0.7.8", "variantCaller": "GATK4.0" } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/analyses/examples/analyses-MIN-example.json b/bycon/schemas/models/json/progenetix-model/analyses/examples/analyses-MIN-example.json index 137af6bbf..12a02bfd3 100644 --- a/bycon/schemas/models/json/progenetix-model/analyses/examples/analyses-MIN-example.json +++ b/bycon/schemas/models/json/progenetix-model/analyses/examples/analyses-MIN-example.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "analysisDate": "2021-10-17", "id": "analyses-example-0001", + "analysisDate": "2021-10-17", "pipelineName": "Pipeline-panel-0001-v1" } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/beaconConfiguration.json b/bycon/schemas/models/json/progenetix-model/beaconConfiguration.json index 79ab0ba52..3854124f7 100644 --- a/bycon/schemas/models/json/progenetix-model/beaconConfiguration.json +++ b/bycon/schemas/models/json/progenetix-model/beaconConfiguration.json @@ -1,63 +1,30 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "maturityAttributes": { + "productionStatus": "PROD" + }, + "securityAttributes": { + "defaultGranularity": "record", + "securityLevels": [ + "PUBLIC" + ] + }, "entryTypes": { - "analysis": { - "additionallySupportedSchemas": [], - "defaultSchema": { - "id": "analysis", - "name": "Default schema for a bioinformatics analysis", - "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/analysis", - "schemaVersion": "v2.0.0" - }, - "description": "Apply analytical methods to existing data of a specific type.", - "id": "analysis", - "name": "Bioinformatics analysis of a genomic experiment", - "ontologyTermForThisType": { - "id": "edam:operation_2945", - "label": "Analysis" - }, - "partOfSpecification": "Beacon v2.0.0" - }, - "biosample": { - "additionallySupportedSchemas": [], - "defaultSchema": { - "id": "biosample", - "name": "Default schema for a biological sample", - "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/biosample" - }, - "description": "Any material sample taken from a biological entity for testing, diagnostic, propagation, treatment or research purposes, including a sample obtained from a living organism or taken from the biological object after halting of all its life functions. Biospecimen can contain one or more components including but not limited to cellular molecules, cells, tissues, organs, body fluids, embryos, and body excretory products. [ NCI ]", - "id": "biosample", - "name": "Biological Sample", + "dataset": { + "id": "dataset", + "name": "Dataset", "ontologyTermForThisType": { - "id": "NCIT:C70699", - "label": "Biospecimen" + "id": "NCIT:C47824", + "label": "Data set" }, - "partOfSpecification": "Beacon v2.0.0" - }, - "cohort": { - "aCollectionOf": [ - { - "id": "individual", - "name": "Individuals" - } - ], - "additionalSupportedSchemas": [], + "partOfSpecification": "Beacon v2.0.0", + "description": "A Dataset is a collection of related sets of information, e.g. genomic variations together with associated procedural and biological metadata. In a Beacon context, a datasets may consist of information generated in a specific study or project, or represent the main content of the Beacon resource.", "defaultSchema": { - "id": "cohort", - "name": "Default schema for cohorts", - "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/cohort", + "id": "dataset", + "name": "Default schema for datasets", + "referenceToSchemaDefinition": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/models/json/beacon-v2-default-model/datasets/defaultSchema.json", "schemaVersion": "v2.0.0" }, - "description": "A group of individuals, identified by a common characteristic. [ NCI ]", - "id": "cohort", - "name": "Cohort", - "ontologyTermForThisType": { - "id": "NCIT:C61512", - "label": "Cohort" - }, - "partOfSpecification": "Beacon v2.0.0" - }, - "dataset": { "aCollectionOf": [ { "id": "genomicVariant", @@ -76,96 +43,129 @@ "name": "Genomic Analyses" } ], - "additionalSupportedSchemas": [], - "defaultSchema": { - "id": "dataset", - "name": "Default schema for datasets", - "referenceToSchemaDefinition": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/models/json/beacon-v2-default-model/datasets/defaultSchema.json", - "schemaVersion": "v2.0.0" - }, - "description": "A Dataset is a collection of related sets of information, e.g. genomic variations together with associated procedural and biological metadata. In a Beacon context, a datasets may consist of information generated in a specific study or project, or represent the main content of the Beacon resource.", - "id": "dataset", - "name": "Dataset", + "additionalSupportedSchemas": [] + }, + "cohort": { + "id": "cohort", + "name": "Cohort", "ontologyTermForThisType": { - "id": "NCIT:C47824", - "label": "Data set" + "id": "NCIT:C61512", + "label": "Cohort" }, - "partOfSpecification": "Beacon v2.0.0" - }, - "genomicVariant": { - "additionallySupportedSchemas": [], + "partOfSpecification": "Beacon v2.0.0", + "description": "A group of individuals, identified by a common characteristic. [ NCI ]", "defaultSchema": { - "id": "genomicVariant", - "name": "Default schema for a genomic variation", - "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/genomicVariant", + "id": "cohort", + "name": "Default schema for cohorts", + "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/cohort", "schemaVersion": "v2.0.0" }, - "description": "The location of a sequence.", + "aCollectionOf": [ + { + "id": "individual", + "name": "Individuals" + } + ], + "additionalSupportedSchemas": [] + }, + "genomicVariant": { "id": "genomicVariant", "name": "Genomic Variants", "ontologyTermForThisType": { "id": "ENSGLOSSARY:0000092", "label": "Variant" }, - "partOfSpecification": "Beacon v2.0.0" - }, - "individual": { - "additionallySupportedSchemas": [], + "partOfSpecification": "Beacon v2.0.0", + "description": "The location of a sequence.", "defaultSchema": { - "id": "individual", - "name": "Default schema for an individual", - "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/individual" + "id": "genomicVariant", + "name": "Default schema for a genomic variation", + "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/genomicVariant", + "schemaVersion": "v2.0.0" }, - "description": "A human being. It could be a Patient, a Tissue Donor, a Participant, a Human Study Subject, etc.", + "additionallySupportedSchemas": [] + }, + "individual": { "id": "individual", "name": "Individual", "ontologyTermForThisType": { "id": "NCIT:C25190", "label": "Person" }, - "partOfSpecification": "Beacon v2.0.0" - }, - "phenopacket": { - "additionallySupportedSchemas": [], + "partOfSpecification": "Beacon v2.0.0", + "description": "A human being. It could be a Patient, a Tissue Donor, a Participant, a Human Study Subject, etc.", "defaultSchema": { - "id": "phenopacket", - "name": "Default schema for an phenopacket", - "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/phenopacket" + "id": "individual", + "name": "Default schema for an individual", + "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/individual" }, - "description": "Information about a subject in phenopackets format", - "id": "phenopacket", - "name": "Phenopacket", + "additionallySupportedSchemas": [] + }, + "biosample": { + "id": "biosample", + "name": "Biological Sample", "ontologyTermForThisType": { - "id": "NCIT:C25190", - "label": "Person" + "id": "NCIT:C70699", + "label": "Biospecimen" }, - "partOfSpecification": "BeaconPlus" + "partOfSpecification": "Beacon v2.0.0", + "description": "Any material sample taken from a biological entity for testing, diagnostic, propagation, treatment or research purposes, including a sample obtained from a living organism or taken from the biological object after halting of all its life functions. Biospecimen can contain one or more components including but not limited to cellular molecules, cells, tissues, organs, body fluids, embryos, and body excretory products. [ NCI ]", + "defaultSchema": { + "id": "biosample", + "name": "Default schema for a biological sample", + "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/biosample" + }, + "additionallySupportedSchemas": [] }, "run": { - "additionallySupportedSchemas": [], + "id": "run", + "name": "Experimental run", + "ontologyTermForThisType": { + "id": "NCIT:C148088", + "label": "Sequencing run" + }, + "partOfSpecification": "Beacon v2.0.0", + "description": "The valid and completed operation of a high-throughput sequencing instrument for a single sequencing process. [ NCI ]", "defaultSchema": { "id": "run", "name": "Default schema for a sequencing run", "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/run", "schemaVersion": "v2.0.0" }, - "description": "The valid and completed operation of a high-throughput sequencing instrument for a single sequencing process. [ NCI ]", - "id": "run", - "name": "Experimental run", + "additionallySupportedSchemas": [] + }, + "analysis": { + "id": "analysis", + "name": "Bioinformatics analysis of a genomic experiment", "ontologyTermForThisType": { - "id": "NCIT:C148088", - "label": "Sequencing run" + "id": "edam:operation_2945", + "label": "Analysis" + }, + "partOfSpecification": "Beacon v2.0.0", + "description": "Apply analytical methods to existing data of a specific type.", + "defaultSchema": { + "id": "analysis", + "name": "Default schema for a bioinformatics analysis", + "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/analysis", + "schemaVersion": "v2.0.0" }, - "partOfSpecification": "Beacon v2.0.0" + "additionallySupportedSchemas": [] + }, + "phenopacket": { + "id": "phenopacket", + "name": "Phenopacket", + "ontologyTermForThisType": { + "id": "NCIT:C25190", + "label": "Person" + }, + "partOfSpecification": "BeaconPlus", + "description": "Information about a subject in phenopackets format", + "defaultSchema": { + "id": "phenopacket", + "name": "Default schema for an phenopacket", + "referenceToSchemaDefinition": "http://progenetix.org/services/schemas/phenopacket" + }, + "additionallySupportedSchemas": [] } - }, - "maturityAttributes": { - "productionStatus": "PROD" - }, - "securityAttributes": { - "defaultGranularity": "record", - "securityLevels": [ - "PUBLIC" - ] } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/beaconMap.json b/bycon/schemas/models/json/progenetix-model/beaconMap.json index a78b0f952..cf2f1f133 100644 --- a/bycon/schemas/models/json/progenetix-model/beaconMap.json +++ b/bycon/schemas/models/json/progenetix-model/beaconMap.json @@ -1,104 +1,71 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", "endpointSets": { - "analysis": { - "endpoints": { - "genomicVariant": { - "returnedEntryType": "genomicVariant", - "url": "https://progenetix.org/beacon/analyses/{id}/g_variants" - } - }, - "entryType": "analysis", + "dataset": { + "entryType": "dataset", + "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/datasets", + "rootUrl": "https://progenetix.org/beacon/datasets", + "singleEntryUrl": "https://progenetix.org/beacon/datasets/{id}", "filteringTermsUrl": "https://progenetix.org/beacon/filtering_terms", - "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/analyses", - "rootUrl": "https://progenetix.org/beacon/analyses", - "singleEntryUrl": "https://progenetix.org/beacon/analyses/{id}" - }, - "biosample": { "endpoints": { - "analysis": { - "returnedEntryType": "analysis", - "url": "https://progenetix.org/beacon/biosamples/{id}/analyses" - }, "genomicVariant": { "returnedEntryType": "genomicVariant", - "url": "https://progenetix.org/beacon/biosamples/{id}/g_variants" - }, - "run": { - "returnedEntryType": "run", - "url": "https://progenetix.org/beacon/biosamples/{id}/runs" - } - }, - "entryType": "biosample", - "filteringTermsUrl": "https://progenetix.org/beacon/filtering_terms", - "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/biosamples", - "rootUrl": "https://progenetix.org/beacon/biosamples", - "singleEntryUrl": "https://progenetix.org/beacon/biosamples/{id}" - }, - "cohort": { - "endpoints": { - "analyses": { - "returnedEntryType": "analysis", - "url": "https://progenetix.org/beacon/cohorts/{id}/analyses" + "url": "https://progenetix.org/beacon/datasets/{id}/g_variants" }, "biosample": { "returnedEntryType": "biosample", - "url": "https://progenetix.org/beacon/cohorts/{id}/biosamples" - }, - "genomicVariant": { - "returnedEntryType": "genomicVariant", - "url": "https://progenetix.org/beacon/cohorts/{id}/g_variants" + "url": "https://progenetix.org/beacon/datasets/{id}/biosamples" }, "individual": { "returnedEntryType": "individual", - "url": "https://progenetix.org/beacon/cohorts/{id}/individuals" + "url": "https://progenetix.org/beacon/datasets/{id}/individuals" }, "runs": { "returnedEntryType": "run", - "url": "https://progenetix.org/beacon/cohorts/{id}/runs" + "url": "https://progenetix.org/beacon/datasets/{id}/runs" + }, + "analyses": { + "returnedEntryType": "analysis", + "url": "https://progenetix.org/beacon/datasets/{id}/analyses" } - }, + } + }, + "cohort": { "entryType": "cohort", - "filteringTermsUrl": "https://progenetix.org/beacon/filtering_terms", "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/cohorts", "rootUrl": "https://progenetix.org/beacon/cohorts", - "singleEntryUrl": "https://progenetix.org/beacon/cohorts/{id}" - }, - "dataset": { + "singleEntryUrl": "https://progenetix.org/beacon/cohorts/{id}", + "filteringTermsUrl": "https://progenetix.org/beacon/filtering_terms", "endpoints": { - "analyses": { - "returnedEntryType": "analysis", - "url": "https://progenetix.org/beacon/datasets/{id}/analyses" - }, - "biosample": { - "returnedEntryType": "biosample", - "url": "https://progenetix.org/beacon/datasets/{id}/biosamples" + "individual": { + "returnedEntryType": "individual", + "url": "https://progenetix.org/beacon/cohorts/{id}/individuals" }, "genomicVariant": { "returnedEntryType": "genomicVariant", - "url": "https://progenetix.org/beacon/datasets/{id}/g_variants" + "url": "https://progenetix.org/beacon/cohorts/{id}/g_variants" }, - "individual": { - "returnedEntryType": "individual", - "url": "https://progenetix.org/beacon/datasets/{id}/individuals" + "biosample": { + "returnedEntryType": "biosample", + "url": "https://progenetix.org/beacon/cohorts/{id}/biosamples" }, "runs": { "returnedEntryType": "run", - "url": "https://progenetix.org/beacon/datasets/{id}/runs" + "url": "https://progenetix.org/beacon/cohorts/{id}/runs" + }, + "analyses": { + "returnedEntryType": "analysis", + "url": "https://progenetix.org/beacon/cohorts/{id}/analyses" } - }, - "entryType": "dataset", - "filteringTermsUrl": "https://progenetix.org/beacon/filtering_terms", - "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/datasets", - "rootUrl": "https://progenetix.org/beacon/datasets", - "singleEntryUrl": "https://progenetix.org/beacon/datasets/{id}" + } }, "genomicVariant": { + "entryType": "genomicVariant", + "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/genomicVariations", + "rootUrl": "https://progenetix.org/beacon/g_variants", + "singleEntryUrl": "https://progenetix.org/beacon/g_variants/{id}", + "filteringTermsUrl": "https://progenetix.org/beacon/filtering_terms", "endpoints": { - "analyses": { - "returnedEntryType": "analysis", - "url": "https://progenetix.org/beacon/g_variants/{id}/analyses" - }, "biosample": { "returnedEntryType": "biosample", "url": "https://progenetix.org/beacon/g_variants/{id}/biosamples" @@ -110,40 +77,65 @@ "runs": { "returnedEntryType": "run", "url": "https://progenetix.org/beacon/g_variants/{id}/runs" + }, + "analyses": { + "returnedEntryType": "analysis", + "url": "https://progenetix.org/beacon/g_variants/{id}/analyses" } - }, - "entryType": "genomicVariant", - "filteringTermsUrl": "https://progenetix.org/beacon/filtering_terms", - "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/genomicVariations", - "rootUrl": "https://progenetix.org/beacon/g_variants", - "singleEntryUrl": "https://progenetix.org/beacon/g_variants/{id}" + } }, "individual": { + "entryType": "individual", + "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/individuals", + "rootUrl": "https://progenetix.org/beacon/individuals", + "singleEntryUrl": "https://progenetix.org/beacon/individuals/{id}", + "filteringTermsUrl": "https://progenetix.org/beacon/filtering_terms", "endpoints": { - "analyses": { - "returnedEntryType": "analysis", - "url": "https://progenetix.org/beacon/individuals/{id}/analyses" + "genomicVariant": { + "returnedEntryType": "genomicVariant", + "url": "https://progenetix.org/beacon/individuals/{id}/g_variants" }, "biosample": { "returnedEntryType": "biosample", "url": "https://progenetix.org/beacon/individuals/{id}/biosamples" }, - "genomicVariant": { - "returnedEntryType": "genomicVariant", - "url": "https://progenetix.org/beacon/individuals/{id}/g_variants" - }, "runs": { "returnedEntryType": "run", "url": "https://progenetix.org/beacon/individuals/{id}/runs" + }, + "analyses": { + "returnedEntryType": "analysis", + "url": "https://progenetix.org/beacon/individuals/{id}/analyses" } - }, - "entryType": "individual", + } + }, + "biosample": { + "entryType": "biosample", + "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/biosamples", + "rootUrl": "https://progenetix.org/beacon/biosamples", + "singleEntryUrl": "https://progenetix.org/beacon/biosamples/{id}", "filteringTermsUrl": "https://progenetix.org/beacon/filtering_terms", - "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/individuals", - "rootUrl": "https://progenetix.org/beacon/individuals", - "singleEntryUrl": "https://progenetix.org/beacon/individuals/{id}" + "endpoints": { + "run": { + "returnedEntryType": "run", + "url": "https://progenetix.org/beacon/biosamples/{id}/runs" + }, + "analysis": { + "returnedEntryType": "analysis", + "url": "https://progenetix.org/beacon/biosamples/{id}/analyses" + }, + "genomicVariant": { + "returnedEntryType": "genomicVariant", + "url": "https://progenetix.org/beacon/biosamples/{id}/g_variants" + } + } }, "run": { + "entryType": "run", + "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/runs", + "rootUrl": "https://progenetix.org/beacon/runs", + "singleEntryUrl": "https://progenetix.org/beacon/runs/{id}", + "filteringTermsUrl": "https://progenetix.org/beacon/filtering_terms", "endpoints": { "analysis": { "returnedEntryType": "analysis", @@ -153,12 +145,20 @@ "returnedEntryType": "genomicVariant", "url": "https://progenetix.org/beacon/runs/{id}/g_variants" } - }, - "entryType": "run", + } + }, + "analysis": { + "entryType": "analysis", + "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/analyses", + "rootUrl": "https://progenetix.org/beacon/analyses", + "singleEntryUrl": "https://progenetix.org/beacon/analyses/{id}", "filteringTermsUrl": "https://progenetix.org/beacon/filtering_terms", - "openAPIEndpointsDefinition": "https://progenetix.org/services/endpoints/runs", - "rootUrl": "https://progenetix.org/beacon/runs", - "singleEntryUrl": "https://progenetix.org/beacon/runs/{id}" + "endpoints": { + "genomicVariant": { + "returnedEntryType": "genomicVariant", + "url": "https://progenetix.org/beacon/analyses/{id}/g_variants" + } + } } } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/biosamples/defaultSchema.json b/bycon/schemas/models/json/progenetix-model/biosamples/defaultSchema.json index c4e83e848..e1b486e90 100644 --- a/bycon/schemas/models/json/progenetix-model/biosamples/defaultSchema.json +++ b/bycon/schemas/models/json/progenetix-model/biosamples/defaultSchema.json @@ -1,12 +1,34 @@ { - "$id": "https://progenetix.org/services/schemas/biosample/v2022-04-08", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "$id": "https://progenetix.org/services/schemas/biosample/v2022-04-08", + "title": "Biosample", + "type": "object", "description": "A Biosample refers to a unit of biological material from which the substrate molecules (e.g. genomic DNA, RNA, proteins) for molecular analyses (e.g. sequencing, array hybridisation, mass-spectrometry) are extracted. Examples would be a tissue biopsy, a single cell from a culture for single cell genome sequencing or a protein fraction from a gradient centrifugation. Several instances (e.g. technical replicates) or types of experiments (e.g. genomic array as well as RNA-seq experiments) may refer to the same Biosample.", "properties": { + "id": { + "description": "Biosample identifier (external accession or internal ID).", + "type": "string", + "examples": [ + "pgxind-kftx5ruq" + ] + }, + "individualId": { + "description": "Reference to the individual from which that sample was obtained.", + "type": "string", + "examples": [ + "pgxind-kftx5ruq" + ] + }, + "notes": { + "description": "Any relevant info about the biosample that does not fit into any other field in the schema.", + "type": "string", + "examples": [ + "Some free text" + ] + }, "biosampleStatus": { - "$ref": "../common/ontologyTerm.json", "description": "Ontology value from Experimental Factor Ontology (EFO) Material Entity term (BFO:0000040). Classification of the sample in abnormal sample (EFO:0009655) or reference sample (EFO:0009654).", + "$ref": "../common/ontologyTerm.json", "examples": [ { "id": "EFO:0009654", @@ -34,41 +56,9 @@ } ] }, - "cohorts": { - "description": "Cohorts describe collections of samples or individuals which are part of a common epistemic group, e.g. have been used for a study or share a set of features.\n", - "examples": [ - { - "id": "pgxcohort-arraymap", - "label": "arrayMap collection" - } - ], - "items": { - "$ref": "../common/ontologyTerm.json" - }, - "type": "array" - }, - "collectionMoment": { - "description": "Individual's or cell cullture age at the time of sample collection in the ISO8601 duration format `P[n]Y[n]M[n]DT[n]H[n]M[n]S`.", - "examples": [ - "P32Y6M1D", - "P7D" - ], - "type": "string" - }, - "externalReferences": { - "examples": [ - { - "id": "PMID:9892199" - } - ], - "items": { - "$ref": "../common/externalReference.json" - }, - "type": "array" - }, "histologicalDiagnosis": { - "$ref": "../common/ontologyTerm.json", "description": "Disease diagnosis that was inferred from the histological examination.", + "$ref": "../common/ontologyTerm.json", "examples": [ { "id": "NCIT:C3778", @@ -76,53 +66,9 @@ } ] }, - "icdoMorphology": { - "$ref": "../common/ontologyTerm.json", - "description": "The ICD-O 3 morphology code of this biosample, in a \"pseudo-prefixed\" transformation (since no direct ICD-O 3 registry can be referenced).", - "examples": [ - { - "id": "icdom-94703", - "label": "Medulloblastoma, NOS" - } - ] - }, - "icdoTopography": { - "$ref": "../common/ontologyTerm.json", - "description": "The ICD-O 3 topography code of this biosample, in a \"pseudo-prefixed\" transformation (since no direct ICD-O 3 registry can be referenced).", - "examples": [ - { - "id": "icdot-C71.6", - "label": "cerebellum" - } - ] - }, - "id": { - "description": "Biosample identifier (external accession or internal ID).", - "examples": [ - "pgxind-kftx5ruq" - ], - "type": "string" - }, - "individualId": { - "description": "Reference to the individual from which that sample was obtained.", - "examples": [ - "pgxind-kftx5ruq" - ], - "type": "string" - }, - "info": { - "$ref": "../common/commonDefinitions.json#/definitions/Info" - }, - "notes": { - "description": "Any relevant info about the biosample that does not fit into any other field in the schema.", - "examples": [ - "Some free text" - ], - "type": "string" - }, "pathologicalStage": { - "$ref": "../common/ontologyTerm.json", "description": "Pathological stage, if applicable, preferably as subclass of NCIT:C28108 - Disease Stage Qualifier. RECOMMENDED.", + "$ref": "../common/ontologyTerm.json", "examples": [ { "id": "NCIT:C27977", @@ -135,8 +81,10 @@ ] }, "pathologicalTnmFinding": { - "$ref": "../common/ontologyTerm.json", "description": "Pathological TNM findings, if applicable, preferably as subclass of NCIT:C48698 - Cancer TNM Finding Category (NCIT:C48698). RECOMMENDED.", + "type": "array", + "items": null, + "$ref": "../common/ontologyTerm.json", "examples": [ { "id": "NCIT:C48725", @@ -150,16 +98,37 @@ "id": "NCIT:C48699", "label": "M0 Stage Finding" } - ], - "items": null, - "type": "array" + ] }, - "provenance": { - "$ref": "../common/provenance.json" + "tumorGrade": { + "description": "Tumor grade as child term of NCIT:C28076 (Disease Grade Qualifier) or equivalent.", + "$ref": "../common/ontologyTerm.json", + "examples": [ + { + "id": "NCIT:C28076", + "label": "grade 3" + }, + { + "id": "NCIT:C28080", + "label": "Grade 3a" + }, + { + "id": "NCIT:C62397", + "label": "WHO Central Nervous System Grade IV" + } + ] + }, + "collectionMoment": { + "description": "Individual's or cell cullture age at the time of sample collection in the ISO8601 duration format `P[n]Y[n]M[n]DT[n]H[n]M[n]S`.", + "type": "string", + "examples": [ + "P32Y6M1D", + "P7D" + ] }, "sampleOriginDetail": { - "$ref": "../common/ontologyTerm.json", "description": "Tissue from which the sample was taken or sample origin matching the category set in 'sampleOriginType'. Value from Uber-anatomy ontology (UBERON) or BRENDA tissue / enzyme source (BTO), Ontology for Biomedical Investigations (OBI) or Cell Line Ontology (CLO), e.g. 'cerebellar vermis' (UBERON:0004720), 'HEK-293T cell' (BTO:0002181), 'nasopharyngeal swab specimen' (OBI:0002606), 'cerebrospinal fluid specimen' (OBI:0002502).", + "$ref": "../common/ontologyTerm.json", "examples": [ { "id": "UBERON:0000474", @@ -175,28 +144,59 @@ } ] }, - "tumorGrade": { + "icdoMorphology": { + "description": "The ICD-O 3 morphology code of this biosample, in a \"pseudo-prefixed\" transformation (since no direct ICD-O 3 registry can be referenced).", "$ref": "../common/ontologyTerm.json", - "description": "Tumor grade as child term of NCIT:C28076 (Disease Grade Qualifier) or equivalent.", "examples": [ { - "id": "NCIT:C28076", - "label": "grade 3" - }, + "id": "icdom-94703", + "label": "Medulloblastoma, NOS" + } + ] + }, + "icdoTopography": { + "description": "The ICD-O 3 topography code of this biosample, in a \"pseudo-prefixed\" transformation (since no direct ICD-O 3 registry can be referenced).", + "$ref": "../common/ontologyTerm.json", + "examples": [ { - "id": "NCIT:C28080", - "label": "Grade 3a" - }, + "id": "icdot-C71.6", + "label": "cerebellum" + } + ] + }, + "externalReferences": { + "type": "array", + "items": { + "$ref": "../common/externalReference.json" + }, + "examples": [ { - "id": "NCIT:C62397", - "label": "WHO Central Nervous System Grade IV" + "id": "PMID:9892199" } ] + }, + "cohorts": { + "description": "Cohorts describe collections of samples or individuals which are part of a common epistemic group, e.g. have been used for a study or share a set of features.\n", + "type": "array", + "items": { + "$ref": "../common/ontologyTerm.json" + }, + "examples": [ + { + "id": "pgxcohort-arraymap", + "label": "arrayMap collection" + } + ] + }, + "provenance": { + "$ref": "../common/provenance.json" + }, + "info": { + "$ref": "../common/commonDefinitions.json#/definitions/Info" } }, "required": [ "id" ], - "title": "Biosample", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/biosamples/endpoints.json b/bycon/schemas/models/json/progenetix-model/biosamples/endpoints.json index d6cd3c4ea..73b8f8d5c 100644 --- a/bycon/schemas/models/json/progenetix-model/biosamples/endpoints.json +++ b/bycon/schemas/models/json/progenetix-model/biosamples/endpoints.json @@ -1,102 +1,21 @@ { - "components": { - "parameters": { - "entryId": { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - "filters": { - "in": "query", - "name": "filters", - "schema": { - "examples": [ - [ - "NCIT:C3222" - ], - [ - "OBI:0100058", - "NCIT:C4813" - ] - ], - "items": { - "type": "string" - }, - "type": "array" - } - }, - "includeResultsetResponses": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" - }, - "limit": { - "in": "query", - "name": "limit", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" - } - }, - "requestedSchema": { - "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", - "example": "ga4gh-service-info-v1.0", - "in": "query", - "name": "requestedSchema", - "required": false, - "schema": { - "type": "string" - } - }, - "skip": { - "in": "query", - "name": "skip", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" - } - } - }, - "responses": { - "ResultsOKResponse": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" - } - ] - } - } - }, - "description": "Successful operation." - } - } - }, + "openapi": "3.0.2", + "servers": [], "info": { + "version": "2.0.0", + "title": "GA4GH Beacon API Specification - Biosamples endpoints", + "description": "TBD", "contact": { "email": "beacon@ga4gh.org" }, - "description": "TBD", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "title": "GA4GH Beacon API Specification - Biosamples endpoints", - "version": "2.0.0" + } }, - "openapi": "3.0.2", "paths": { "/biosamples": { "get": { - "description": "Get a list of biosamples", - "operationId": "getBiosamples", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -114,6 +33,11 @@ "$ref": "#/components/parameters/filters" } ], + "description": "Get a list of biosamples", + "operationId": "getBiosamples", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" @@ -121,14 +45,14 @@ "default": { "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] + } }, "post": { "description": "Get a list of biosamples", "operationId": "postBiosamplesRequest", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -144,40 +68,40 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, "/biosamples/{id}": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { "description": "Get details about one biosample, identified by its (unique) 'id'", "operationId": "getOneBiosample", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { "description": "Get details about one Biosample, identified by its (unique) 'id'", "operationId": "postOneBiosample", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -193,19 +117,19 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/biosamples/{id}/analyses": { + "/biosamples/{id}/g_variants": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the analysis list from one biosample, identified by its (unique) 'id'", - "operationId": "getOneBiosampleAnalysis", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -217,27 +141,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the genomic variants list from one biosample, identified by its (unique) 'id'", + "operationId": "getOneBiosampleGenomicVariants", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get the analysis list from one biosample, identified by its (unique) 'id'", - "operationId": "postOneBiosampleAnalysis", + "description": "Get the genomic variants list from one biosample, identified by its (unique) 'id'", + "operationId": "postOneBiosampleGenomicVariants", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -253,19 +177,19 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/biosamples/{id}/g_variants": { + "/biosamples/{id}/analyses": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the genomic variants list from one biosample, identified by its (unique) 'id'", - "operationId": "getOneBiosampleGenomicVariants", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -277,27 +201,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the analysis list from one biosample, identified by its (unique) 'id'", + "operationId": "getOneBiosampleAnalysis", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get the genomic variants list from one biosample, identified by its (unique) 'id'", - "operationId": "postOneBiosampleGenomicVariants", + "description": "Get the analysis list from one biosample, identified by its (unique) 'id'", + "operationId": "postOneBiosampleAnalysis", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -313,19 +237,19 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, "/biosamples/{id}/runs": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the runs list from one biosample, identified by its (unique) 'id'", - "operationId": "getOneBiosampleRuns", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -337,34 +261,34 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the runs list from one biosample, identified by its (unique) 'id'", + "operationId": "getOneBiosampleRuns", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { + "description": "Successful operation", "content": { "application/json": { "schema": { "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" } } - }, - "description": "Successful operation" + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { "description": "Get the runs list from one biosample, identified by its (unique) 'id'", "operationId": "postOneBiosampleRuns", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -377,25 +301,101 @@ }, "responses": { "200": { + "description": "Successful operation", "content": { "application/json": { "schema": { "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" } } - }, - "description": "Successful operation" + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } } }, - "servers": [] + "components": { + "responses": { + "ResultsOKResponse": { + "description": "Successful operation.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" + } + ] + } + } + } + } + }, + "parameters": { + "requestedSchema": { + "name": "requestedSchema", + "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "example": "ga4gh-service-info-v1.0" + }, + "skip": { + "name": "skip", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" + } + }, + "limit": { + "name": "limit", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" + } + }, + "includeResultsetResponses": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" + }, + "entryId": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "filters": { + "name": "filters", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "NCIT:C3222" + ], + [ + "OBI:0100058", + "NCIT:C4813" + ] + ] + } + } + } + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/biosamples/examples/biosample-MID-example.json b/bycon/schemas/models/json/progenetix-model/biosamples/examples/biosample-MID-example.json index 41c4de1eb..e5df7c7d6 100644 --- a/bycon/schemas/models/json/progenetix-model/biosamples/examples/biosample-MID-example.json +++ b/bycon/schemas/models/json/progenetix-model/biosamples/examples/biosample-MID-example.json @@ -1,20 +1,20 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "id": "sample-example-0001", "biosampleStatus": { "id": "EFO:0009655", "label": "abnormal sample" }, - "collectionDate": "2020-09-11", + "sampleOriginType": { + "id": "UBERON:0000992", + "label": "ovary" + }, "collectionMoment": "P32Y6M1D", - "id": "sample-example-0001", + "collectionDate": "2020-09-11", "obtentionProcedure": { "procedureCode": { "id": "OBI:0002654", "label": "needle biopsy" } - }, - "sampleOriginType": { - "id": "UBERON:0000992", - "label": "ovary" } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/biosamples/examples/biosample-MIN-example.json b/bycon/schemas/models/json/progenetix-model/biosamples/examples/biosample-MIN-example.json index d6942fc28..9e5d95162 100644 --- a/bycon/schemas/models/json/progenetix-model/biosamples/examples/biosample-MIN-example.json +++ b/bycon/schemas/models/json/progenetix-model/biosamples/examples/biosample-MIN-example.json @@ -1,10 +1,10 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "id": "sample-example-0001", "biosampleStatus": { "id": "EFO:0009655", "label": "abnormal sample" }, - "id": "sample-example-0001", "sampleOriginType": { "id": "UBERON:0000474", "label": "female reproductive system" diff --git a/bycon/schemas/models/json/progenetix-model/cohorts/defaultSchema.json b/bycon/schemas/models/json/progenetix-model/cohorts/defaultSchema.json index db63c320c..2738cb05a 100644 --- a/bycon/schemas/models/json/progenetix-model/cohorts/defaultSchema.json +++ b/bycon/schemas/models/json/progenetix-model/cohorts/defaultSchema.json @@ -1,160 +1,256 @@ { - "$comment": "version: ga4gh-beacon-cohort-v2.0.0", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, - "definitions": { - "CohortCriteria": { - "description": "Criteria used for defining the cohort. It is assumed that all cohort participants will match or NOT match such criteria.", - "properties": { - "ageRange": { - "$ref": "../common/ageRange.json", - "description": "Individual age range in cohort inclusion criteria" - }, - "diseaseConditions": { - "description": "Diseases in cohort inclusion criteria", - "items": { - "$ref": "../common/disease.json" - }, - "type": "array" - }, - "ethnicities": { - "description": "Ethnias in cohort inclusion criteria", - "items": { - "$ref": "../common/commonDefinitions.json#/definitions/Ethnicity" - }, - "type": "array" - }, - "genders": { - "description": "Gender(s) in cohort inclusion criteria", - "items": { - "$ref": "../common/commonDefinitions.json#/definitions/Sex" - }, - "type": "array" + "$comment": "version: ga4gh-beacon-cohort-v2.0.0", + "description": "A cohort available in the beacon.", + "type": "object", + "properties": { + "cohortType": { + "description": "Cohort type by its definition. If a cohort is declared \u00b4study-defined\u00b4 or \u00b4beacon-defined\u00b4 criteria are to be entered in cohort_inclusion_criteria; if a cohort is declared \u2018user-defined' cohort_inclusion_criteria could be automatically populated from the parameters used to perform the query.", + "type": "string", + "enum": [ + "study-defined", + "beacon-defined", + "user-defined" + ], + "default": "beacon-defined" + }, + "cohortDesign": { + "description": "Cohort type by its design. A plan specification comprised of protocols (which may specify how and what kinds of data will be gathered) that are executed as part of an investigation and is realized during a study design execution. Value from Ontologized MIABIS (OMIABIS) Study design ontology term tree (OBI:0500000).", + "$ref": "../common/ontologyTerm.json", + "examples": [ + { + "id": "OMIABIS:0001017", + "label": "case control study design" }, - "locations": { - "description": "Geographic location(s) in cohort inclusion criteria", - "items": { - "$ref": "../common/commonDefinitions.json#/definitions/GeographicLocation" - }, - "type": "array" + { + "id": "OMIABIS:0001019", + "label": "longitudinal study design" }, - "phenotypicConditions": { - "description": "Phenotypic condition(s) in cohort inclusion criteria", - "items": { - "$ref": "../common/phenotypicFeature.json" - }, - "type": "array" + { + "id": "OMIABIS:0001024", + "label": "twin study design" } - }, - "type": "object" + ] }, + "id": { + "description": "Cohort identifier. For \u00b4study-defined\u00b4 or \u00b4beacon-defined\u00b4cohorts this field is set by the implementer. For \u00b4user-defined\u00b4 this unique identifier could be generated upon the query that defined the cohort, but could be later edited by the user.", + "type": "string", + "examples": [ + "cohort-T2D-2010" + ] + }, + "name": { + "description": "Name of the cohort. For \u00b4user-defined\u00b4 this field could be generated upon the query, e.g. a value that is a concatenationor some representation of the user query.", + "type": "string", + "examples": [ + "Wellcome Trust Case Control Consortium", + "GCAT Genomes for Life" + ] + }, + "inclusionCriteria": { + "description": "Inclusion criteria used for defining the cohort. It is assumed that all cohort participants will match such criteria.", + "type": "object", + "$ref": "#/definitions/CohortCriteria" + }, + "exclusionCriteria": { + "description": "Exclusion criteria used for defining the cohort. It is assumed that NONE of the cohort participants will match such criteria.", + "type": "object", + "$ref": "#/definitions/CohortCriteria" + }, + "cohortSize": { + "description": "Count of unique Individuals in cohort (individuals meeting criteria for \u00b4user-defined\u00b4 cohorts). If not previously known, it could be calculated by counting the individuals in the cohort.", + "type": "integer", + "examples": [ + 14765, + 20000 + ] + }, + "cohortDataTypes": { + "$ref": "#/definitions/DataTypesArray" + }, + "collectionEvents": { + "description": "TBD", + "type": "array", + "items": { + "$ref": "#/definitions/CollectionEvent" + } + } + }, + "definitions": { "CollectionEvent": { "description": "TBD", + "type": "object", "properties": { - "eventAgeRange": { - "$ref": "#/definitions/DataAvailabilityAndDistribution", - "description": "Individual age range, obtained from individual level info in database." - }, - "eventCases": { - "description": "count of cases", - "examples": [ - 543, - 20 - ], - "type": "integer" - }, - "eventControls": { - "description": "count of controls", - "examples": [ - 1000, - 22 - ], - "type": "integer" - }, - "eventDataTypes": { - "$ref": "#/definitions/DataAvailabilityAndDistribution", - "description": "Aggregated data type information available for each cohort data type as declared in cohortDataTypes, and obtained from individual level info.", - "type": "object" - }, - "eventDate": { - "description": "date of collection event/data point", - "examples": [ - "2018-10-01T13:23:45Z", - "2019-04-23T09:11:13Z", - "2017-01-17T20:33:40Z" - ], - "format": "datetime", - "type": "string" - }, - "eventDiseases": { - "$ref": "#/definitions/DataAvailabilityAndDistribution", - "description": "Aggregated information of disease/condition(s) obtained from individual level info in the database." - }, - "eventEthnicities": { - "$ref": "#/definitions/DataAvailabilityAndDistribution", - "description": "Aggregated information of ethnicity obtained from individual level info in database." - }, - "eventGenders": { - "$ref": "#/definitions/DataAvailabilityAndDistribution", - "description": "Aggregated information of gender(s) obtained from individual level info in the database." - }, - "eventLocations": { - "$ref": "#/definitions/DataAvailabilityAndDistribution", - "description": "Aggregated information of geographic location obtained from individual level info in database." - }, "eventNum": { "description": "cardinality of the collection event / data point in a series", + "type": "integer", "examples": [ 1, 2, 3, 4 - ], - "type": "integer" + ] }, - "eventPhenotypes": { - "$ref": "#/definitions/DataAvailabilityAndDistribution", - "description": "Aggregated information of phenotype(s) obtained from individual level info in the database." - }, - "eventSize": { - "description": "Count of individuals in cohort at data point (for \u00b4user-defined\u00b4 cohorts, this is individuals meeting criteria) obtained from individual level info in database.", + "eventDate": { + "description": "date of collection event/data point", + "type": "string", + "format": "datetime", "examples": [ - 1543, - 42 - ], - "type": "integer" + "2018-10-01T13:23:45Z", + "2019-04-23T09:11:13Z", + "2017-01-17T20:33:40Z" + ] }, "eventTimeline": { "description": "Aggregated information of dates of visit/diagnostic/inclusion in study obtained from individual level info in database. Will coincide with collection event date for multi-time", + "type": "object", "properties": { - "end": { - "description": "latest date of visit", + "start": { + "description": "earliest date of visit", + "type": "string", + "format": "datetime", "examples": [ "2018-10-01T13:23:45Z", "2019-04-23T09:11:13Z", "2017-01-17T20:33:40Z" - ], - "format": "datetime", - "type": "string" + ] }, - "start": { - "description": "earliest date of visit", + "end": { + "description": "latest date of visit", + "type": "string", + "format": "datetime", "examples": [ "2018-10-01T13:23:45Z", "2019-04-23T09:11:13Z", "2017-01-17T20:33:40Z" - ], - "format": "datetime", - "type": "string" + ] } - }, - "type": "object" + } + }, + "eventSize": { + "description": "Count of individuals in cohort at data point (for \u00b4user-defined\u00b4 cohorts, this is individuals meeting criteria) obtained from individual level info in database.", + "type": "integer", + "examples": [ + 1543, + 42 + ] + }, + "eventCases": { + "description": "count of cases", + "type": "integer", + "examples": [ + 543, + 20 + ] + }, + "eventControls": { + "description": "count of controls", + "type": "integer", + "examples": [ + 1000, + 22 + ] + }, + "eventLocations": { + "description": "Aggregated information of geographic location obtained from individual level info in database.", + "$ref": "#/definitions/DataAvailabilityAndDistribution" + }, + "eventGenders": { + "description": "Aggregated information of gender(s) obtained from individual level info in the database.", + "$ref": "#/definitions/DataAvailabilityAndDistribution" + }, + "eventEthnicities": { + "description": "Aggregated information of ethnicity obtained from individual level info in database.", + "$ref": "#/definitions/DataAvailabilityAndDistribution" + }, + "eventAgeRange": { + "description": "Individual age range, obtained from individual level info in database.", + "$ref": "#/definitions/DataAvailabilityAndDistribution" + }, + "eventDiseases": { + "description": "Aggregated information of disease/condition(s) obtained from individual level info in the database.", + "$ref": "#/definitions/DataAvailabilityAndDistribution" + }, + "eventPhenotypes": { + "description": "Aggregated information of phenotype(s) obtained from individual level info in the database.", + "$ref": "#/definitions/DataAvailabilityAndDistribution" + }, + "eventDataTypes": { + "description": "Aggregated data type information available for each cohort data type as declared in cohortDataTypes, and obtained from individual level info.", + "type": "object", + "$ref": "#/definitions/DataAvailabilityAndDistribution" + } + } + }, + "CohortCriteria": { + "description": "Criteria used for defining the cohort. It is assumed that all cohort participants will match or NOT match such criteria.", + "type": "object", + "properties": { + "locations": { + "description": "Geographic location(s) in cohort inclusion criteria", + "type": "array", + "items": { + "$ref": "../common/commonDefinitions.json#/definitions/GeographicLocation" + } + }, + "genders": { + "description": "Gender(s) in cohort inclusion criteria", + "type": "array", + "items": { + "$ref": "../common/commonDefinitions.json#/definitions/Sex" + } + }, + "ethnicities": { + "description": "Ethnias in cohort inclusion criteria", + "type": "array", + "items": { + "$ref": "../common/commonDefinitions.json#/definitions/Ethnicity" + } + }, + "diseaseConditions": { + "description": "Diseases in cohort inclusion criteria", + "type": "array", + "items": { + "$ref": "../common/disease.json" + } + }, + "phenotypicConditions": { + "description": "Phenotypic condition(s) in cohort inclusion criteria", + "type": "array", + "items": { + "$ref": "../common/phenotypicFeature.json" + } + }, + "ageRange": { + "description": "Individual age range in cohort inclusion criteria", + "$ref": "../common/ageRange.json" } + } + }, + "DataTypesArray": { + "description": "Type of information. Preferably values from Genomics Cohorts Knowledge Ontology (GeCKO) or others when GeCKO is not applicable.", + "type": "array", + "items": { + "$ref": "../common/ontologyTerm.json" }, - "type": "object" + "examples": [ + { + "id": "OGMS:0000015", + "label": "clinical history" + }, + { + "id": "OBI:0000070", + "label": "genotyping assay" + }, + { + "id": "OMIABIS:0000060", + "label": "survey data" + } + ] }, "DataAvailabilityAndDistribution": { "description": "Aggregated information of geographic location obtained from individual level info in database.", + "type": "object", "properties": { "availability": { "description": "data availability", @@ -165,121 +261,25 @@ "type": "integer" }, "distribution": { + "description": "List of categories and results or counts for each category.", + "type": "object", + "properties": {}, "additionalProperties": { "type": "object" }, - "description": "List of categories and results or counts for each category.", "examples": [ { "genders": { - "female": 51, - "male": 50 + "male": 50, + "female": 51 } } - ], - "properties": {}, - "type": "object" + ] } }, "required": [ "availability" - ], - "type": "object" - }, - "DataTypesArray": { - "description": "Type of information. Preferably values from Genomics Cohorts Knowledge Ontology (GeCKO) or others when GeCKO is not applicable.", - "examples": [ - { - "id": "OGMS:0000015", - "label": "clinical history" - }, - { - "id": "OBI:0000070", - "label": "genotyping assay" - }, - { - "id": "OMIABIS:0000060", - "label": "survey data" - } - ], - "items": { - "$ref": "../common/ontologyTerm.json" - }, - "type": "array" - } - }, - "description": "A cohort available in the beacon.", - "properties": { - "cohortDataTypes": { - "$ref": "#/definitions/DataTypesArray" - }, - "cohortDesign": { - "$ref": "../common/ontologyTerm.json", - "description": "Cohort type by its design. A plan specification comprised of protocols (which may specify how and what kinds of data will be gathered) that are executed as part of an investigation and is realized during a study design execution. Value from Ontologized MIABIS (OMIABIS) Study design ontology term tree (OBI:0500000).", - "examples": [ - { - "id": "OMIABIS:0001017", - "label": "case control study design" - }, - { - "id": "OMIABIS:0001019", - "label": "longitudinal study design" - }, - { - "id": "OMIABIS:0001024", - "label": "twin study design" - } ] - }, - "cohortSize": { - "description": "Count of unique Individuals in cohort (individuals meeting criteria for \u00b4user-defined\u00b4 cohorts). If not previously known, it could be calculated by counting the individuals in the cohort.", - "examples": [ - 14765, - 20000 - ], - "type": "integer" - }, - "cohortType": { - "default": "beacon-defined", - "description": "Cohort type by its definition. If a cohort is declared \u00b4study-defined\u00b4 or \u00b4beacon-defined\u00b4 criteria are to be entered in cohort_inclusion_criteria; if a cohort is declared \u2018user-defined' cohort_inclusion_criteria could be automatically populated from the parameters used to perform the query.", - "enum": [ - "study-defined", - "beacon-defined", - "user-defined" - ], - "type": "string" - }, - "collectionEvents": { - "description": "TBD", - "items": { - "$ref": "#/definitions/CollectionEvent" - }, - "type": "array" - }, - "exclusionCriteria": { - "$ref": "#/definitions/CohortCriteria", - "description": "Exclusion criteria used for defining the cohort. It is assumed that NONE of the cohort participants will match such criteria.", - "type": "object" - }, - "id": { - "description": "Cohort identifier. For \u00b4study-defined\u00b4 or \u00b4beacon-defined\u00b4cohorts this field is set by the implementer. For \u00b4user-defined\u00b4 this unique identifier could be generated upon the query that defined the cohort, but could be later edited by the user.", - "examples": [ - "cohort-T2D-2010" - ], - "type": "string" - }, - "inclusionCriteria": { - "$ref": "#/definitions/CohortCriteria", - "description": "Inclusion criteria used for defining the cohort. It is assumed that all cohort participants will match such criteria.", - "type": "object" - }, - "name": { - "description": "Name of the cohort. For \u00b4user-defined\u00b4 this field could be generated upon the query, e.g. a value that is a concatenationor some representation of the user query.", - "examples": [ - "Wellcome Trust Case Control Consortium", - "GCAT Genomes for Life" - ], - "type": "string" } }, "required": [ @@ -287,5 +287,5 @@ "name", "cohortType" ], - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/cohorts/endpoints.json b/bycon/schemas/models/json/progenetix-model/cohorts/endpoints.json index ec0584c18..9a2938083 100644 --- a/bycon/schemas/models/json/progenetix-model/cohorts/endpoints.json +++ b/bycon/schemas/models/json/progenetix-model/cohorts/endpoints.json @@ -1,115 +1,31 @@ { - "components": { - "parameters": { - "entryId": { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - "filters": { - "in": "query", - "name": "filters", - "schema": { - "examples": [ - [ - "OMIABIS:0001017" - ] - ], - "items": { - "type": "string" - }, - "type": "array" - } - }, - "limit": { - "in": "query", - "name": "limit", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" - } - }, - "requestedSchema": { - "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", - "example": "ga4gh-service-info-v1.0", - "in": "query", - "name": "requestedSchema", - "required": false, - "schema": { - "type": "string" - } - }, - "skip": { - "in": "query", - "name": "skip", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" - } - } - }, - "responses": { - "CollectionsResponse": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCollectionsResponse.json" - } - ] - } - } - }, - "description": "Successful collection list operation." - }, - "ResultsOKResponse": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" - } - ] - } - } - }, - "description": "Successful operation." - } - } - }, + "openapi": "3.0.2", + "servers": [], "info": { + "version": "2.0.0", + "title": "GA4GH Beacon API Specification - Cohorts Endpoints", + "description": "TBD", "contact": { "email": "beacon@ga4gh.org" }, - "description": "TBD", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "title": "GA4GH Beacon API Specification - Cohorts Endpoints", - "version": "2.0.0" + } }, - "openapi": "3.0.2", + "tags": [ + { + "name": "GET Endpoints", + "description": "Available endpoints in this API. All of them have a POST counterpart." + }, + { + "name": "POST Endpoints", + "description": "The same operations than GET, just by POST." + } + ], "paths": { "/cohorts": { "get": { - "description": "Get a list of cohorts", - "operationId": "getCohorts", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -124,6 +40,11 @@ "$ref": "#/components/parameters/filters" } ], + "description": "Get a list of cohorts", + "operationId": "getCohorts", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/CollectionsResponse" @@ -131,14 +52,14 @@ "default": { "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] + } }, "post": { "description": "Get a list of cohorts", "operationId": "postCohortsRequest", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -154,45 +75,45 @@ "$ref": "#/components/responses/CollectionsResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, "/cohorts/{id}": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get details about one cohort, identified by its (unique) 'id'", - "operationId": "getOneCohort", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" } ], + "description": "Get details about one cohort, identified by its (unique) 'id'", + "operationId": "getOneCohort", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { "description": "Get details about one cohort, identified by its (unique) 'id'", "operationId": "postOneCohort", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -208,20 +129,23 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/cohorts/{id}/filtering_terms": { + "/cohorts/{id}/individuals": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the list of filtering terms that could be used with a given cohort, identified by its (unique) 'id'", - "operationId": "getOneCohortFilteringTerms", "parameters": [ + { + "$ref": "#/components/parameters/requestedSchema" + }, { "$ref": "#/components/parameters/skip" }, @@ -229,34 +153,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the individuals from one cohort, identified by its (unique) 'id'", + "operationId": "getOneCohortIndividuals", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" - } - } - }, - "description": "Successful operation" + "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get the list of filtering terms that could be used with a given cohort, identified by its (unique) 'id'", - "operationId": "postOneCohortFilteringTerms", + "description": "Get the individuals from one cohort, identified by its (unique) 'id'", + "operationId": "postOneCohortEntries", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -269,33 +186,23 @@ }, "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" - } - } - }, - "description": "Successful operation" + "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/cohorts/{id}/individuals": { + "/cohorts/{id}/filtering_terms": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the individuals from one cohort, identified by its (unique) 'id'", - "operationId": "getOneCohortIndividuals", "parameters": [ - { - "$ref": "#/components/parameters/requestedSchema" - }, { "$ref": "#/components/parameters/skip" }, @@ -303,27 +210,34 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the list of filtering terms that could be used with a given cohort, identified by its (unique) 'id'", + "operationId": "getOneCohortFilteringTerms", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { - "$ref": "#/components/responses/ResultsOKResponse" + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" + } + } + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get the individuals from one cohort, identified by its (unique) 'id'", - "operationId": "postOneCohortEntries", + "description": "Get the list of filtering terms that could be used with a given cohort, identified by its (unique) 'id'", + "operationId": "postOneCohortFilteringTerms", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -336,28 +250,114 @@ }, "responses": { "200": { - "$ref": "#/components/responses/ResultsOKResponse" + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" + } + } + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } } }, - "servers": [], - "tags": [ - { - "description": "Available endpoints in this API. All of them have a POST counterpart.", - "name": "GET Endpoints" + "components": { + "responses": { + "ResultsOKResponse": { + "description": "Successful operation.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" + } + ] + } + } + } + }, + "CollectionsResponse": { + "description": "Successful collection list operation.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCollectionsResponse.json" + } + ] + } + } + } + } }, - { - "description": "The same operations than GET, just by POST.", - "name": "POST Endpoints" + "parameters": { + "requestedSchema": { + "name": "requestedSchema", + "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "example": "ga4gh-service-info-v1.0" + }, + "skip": { + "name": "skip", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" + } + }, + "limit": { + "name": "limit", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" + } + }, + "entryId": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "filters": { + "name": "filters", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "OMIABIS:0001017" + ] + ] + } + } } - ] + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/cohorts/examples/cohorts-MAX-example.json b/bycon/schemas/models/json/progenetix-model/cohorts/examples/cohorts-MAX-example.json index ac3258aa4..033950838 100644 --- a/bycon/schemas/models/json/progenetix-model/cohorts/examples/cohorts-MAX-example.json +++ b/bycon/schemas/models/json/progenetix-model/cohorts/examples/cohorts-MAX-example.json @@ -1,5 +1,39 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "id": "cohort0001", + "name": "GCAT Genomes for Life", + "cohortType": "study-defined", + "cohortDesign": { + "id": "OMIABIS:0001019", + "label": "longitudinal study design" + }, + "cohortSize": 20000, + "inclusionCriteria": { + "ageRange": { + "start": { + "iso8601duration": "P18Y" + }, + "end": { + "iso8601duration": "P40Y" + } + }, + "locations": [ + { + "id": "GAZ:00004501", + "label": "Catalonia Autonomous Community" + } + ], + "genders": [ + { + "id": "NCIT:C16576", + "label": "female" + }, + { + "id": "NCIT:C20197", + "label": "male" + } + ] + }, "cohortDataTypes": [ { "id": "OGMS:0000015", @@ -14,75 +48,41 @@ "label": "survey data" } ], - "cohortDesign": { - "id": "OMIABIS:0001019", - "label": "longitudinal study design" - }, - "cohortSize": 20000, - "cohortType": "study-defined", "collectionEvents": [ { - "eventDataTypes": { + "eventNum": 1, + "eventDate": "2019-04-23", + "eventSize": 101, + "eventGenders": { "availability": true, + "availabilityCount": 101, "distribution": { - "dataTypes": { - "blood collected from fasting subject": 51, - "survey data": 98 + "genders": { + "male": 50, + "female": 51 } } }, - "eventDate": "2019-04-23", "eventEthnicities": { "availability": true, "availabilityCount": 101, "distribution": { "ethnicities": { - "African": 3, "European": 90, - "Latin American": 8 + "Latin American": 8, + "African": 3 } } }, - "eventGenders": { + "eventDataTypes": { "availability": true, - "availabilityCount": 101, "distribution": { - "genders": { - "female": 51, - "male": 50 + "dataTypes": { + "survey data": 98, + "blood collected from fasting subject": 51 } } - }, - "eventNum": 1, - "eventSize": 101 - } - ], - "id": "cohort0001", - "inclusionCriteria": { - "ageRange": { - "end": { - "iso8601duration": "P40Y" - }, - "start": { - "iso8601duration": "P18Y" - } - }, - "genders": [ - { - "id": "NCIT:C16576", - "label": "female" - }, - { - "id": "NCIT:C20197", - "label": "male" - } - ], - "locations": [ - { - "id": "GAZ:00004501", - "label": "Catalonia Autonomous Community" } - ] - }, - "name": "GCAT Genomes for Life" + } + ] } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/cohorts/examples/cohorts-MID-example.json b/bycon/schemas/models/json/progenetix-model/cohorts/examples/cohorts-MID-example.json index 10537d2b4..d15d674bf 100644 --- a/bycon/schemas/models/json/progenetix-model/cohorts/examples/cohorts-MID-example.json +++ b/bycon/schemas/models/json/progenetix-model/cohorts/examples/cohorts-MID-example.json @@ -1,35 +1,28 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "cohortDataTypes": [ - { - "id": "OGMS:0000015", - "label": "clinical history" - }, - { - "id": "OBI:0000070", - "label": "genotyping assay" - }, - { - "id": "OMIABIS:0000060", - "label": "survey data" - } - ], + "id": "cohort0001", + "name": "GCAT Genomes for Life", + "cohortType": "study-defined", "cohortDesign": { "id": "OMIABIS:0001019", "label": "longitudinal study design" }, "cohortSize": 20000, - "cohortType": "study-defined", - "id": "cohort0001", "inclusionCriteria": { "ageRange": { - "end": { - "iso8601duration": "P40Y" - }, "start": { "iso8601duration": "P18Y" + }, + "end": { + "iso8601duration": "P40Y" } }, + "locations": [ + { + "id": "GAZ:00004501", + "label": "Catalonia Autonomous Community" + } + ], "genders": [ { "id": "NCIT:C16576", @@ -39,13 +32,20 @@ "id": "NCIT:C20197", "label": "male" } - ], - "locations": [ - { - "id": "GAZ:00004501", - "label": "Catalonia Autonomous Community" - } ] }, - "name": "GCAT Genomes for Life" + "cohortDataTypes": [ + { + "id": "OGMS:0000015", + "label": "clinical history" + }, + { + "id": "OBI:0000070", + "label": "genotyping assay" + }, + { + "id": "OMIABIS:0000060", + "label": "survey data" + } + ] } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/cohorts/examples/cohorts-MIN-example.json b/bycon/schemas/models/json/progenetix-model/cohorts/examples/cohorts-MIN-example.json index 2bb57eca0..95396a4c6 100644 --- a/bycon/schemas/models/json/progenetix-model/cohorts/examples/cohorts-MIN-example.json +++ b/bycon/schemas/models/json/progenetix-model/cohorts/examples/cohorts-MIN-example.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "cohortType": "study-defined", "id": "cohort0001", - "name": "GCAT Genomes for Life" + "name": "GCAT Genomes for Life", + "cohortType": "study-defined" } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/GeoLocation.json b/bycon/schemas/models/json/progenetix-model/common/GeoLocation.json index 4a3227501..a0e466370 100644 --- a/bycon/schemas/models/json/progenetix-model/common/GeoLocation.json +++ b/bycon/schemas/models/json/progenetix-model/common/GeoLocation.json @@ -1,13 +1,36 @@ { - "$id": "https://progenetix.org/services/schemas/GeoLocation/v2023-08-15", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "$id": "https://progenetix.org/services/schemas/GeoLocation/v2023-08-15", + "title": "GeoLocation", + "type": "object", + "description": "A GeoLocation object represents a geographic location formatted as a *GeoJSON feature*. The format is compatible with RFC 7946, while currently limiting its scope to features of type \"Point\". Also, the schema defines some optional parameters compatible with the `GeoJSON Feature` `properties` wrapper object. Examples could be: * an address, e.g. of a lab performing an analysis * provenance of an individual, obfuscated to a larger order administrative\n entity (Suffolk, U.K.)\n* a lat/long/alt position where an environmental sample was collected \n", + "properties": { + "type": { + "const": "Feature" + }, + "geometry": { + "$ref": "#/definitions/GeoGeometry" + }, + "properties": { + "$ref": "#/definitions/GeoLabels" + } + }, "definitions": { "GeoGeometry": { "description": "The geographic point object uses the default units from the [DCMI point scheme](http://dublincore.org/documents/dcmi-point/) and avoids optional representation in non-standard units. It consists of an array with at least 2 ordered numbers for - longitude/easting - latitude/nothing.\n", "properties": { + "type": { + "const": "Point" + }, "coordinates": { "description": "An array of 2 (longitude, latitude) or 3 (longitude, latitude, altitude) values.\n", + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "minItems": 2, + "maxItems": 3, "examples": [ [ 8.55, @@ -18,17 +41,7 @@ 27.98785, 8848.86 ] - ], - "items": { - "format": "float", - "type": "number" - }, - "maxItems": 3, - "minItems": 2, - "type": "array" - }, - "type": { - "const": "Point" + ] } }, "required": [ @@ -39,60 +52,47 @@ "GeoLabels": { "description": "GeoLabels represent an instance of the GeoJSON `properties` object. The parameters provide additional information for the interpretation of the location parameters.", "properties": { - "ISO3166alpha3": { + "label": { + "type": "string", "examples": [ - "USA", - "CHE" - ], - "type": "string" + "Heidelberg, Germany", + "Gainesville, FL, United States of America", + "Zurich, Switzerland", + "Str Marasesti 5, 300077 Timisoara, Romania" + ] }, "city": { - "description": "The optional name of the city the point location maps to. While this is a commonly used the point location, it should be considered secondary to the `geometry` values in interpreting the geographic location.", - "type": "string" + "type": "string", + "description": "The optional name of the city the point location maps to. While this is a commonly used the point location, it should be considered secondary to the `geometry` values in interpreting the geographic location." }, "country": { + "type": "string", "description": "The optional name of the country the location maps to, for sanity checks and procedural convenience (see notes for \"city\").", "examples": [ "Switzerland" - ], - "type": "string" + ] }, - "label": { + "ISO3166alpha3": { + "type": "string", "examples": [ - "Heidelberg, Germany", - "Gainesville, FL, United States of America", - "Zurich, Switzerland", - "Str Marasesti 5, 300077 Timisoara, Romania" - ], - "type": "string" + "USA", + "CHE" + ] }, "precision": { + "type": "string", "description": "Used together with coordinate annotation, precision represents an optional label describing the precision that can be inferred from the coordinates. For a precision level of \"city\", coordinates would have to be interpreted as representing any possible location within the city's administrative boundaries, not necessarily at the exact position of the point coordinates. The `precision` parameter can be used to indicate an obfuscation of the coordinates, e.g. for privacy protection.\n", "examples": [ "city" - ], - "type": "string" + ] } } } }, - "description": "A GeoLocation object represents a geographic location formatted as a *GeoJSON feature*. The format is compatible with RFC 7946, while currently limiting its scope to features of type \"Point\". Also, the schema defines some optional parameters compatible with the `GeoJSON Feature` `properties` wrapper object. Examples could be: * an address, e.g. of a lab performing an analysis * provenance of an individual, obfuscated to a larger order administrative\n entity (Suffolk, U.K.)\n* a lat/long/alt position where an environmental sample was collected \n", - "properties": { - "geometry": { - "$ref": "#/definitions/GeoGeometry" - }, - "properties": { - "$ref": "#/definitions/GeoLabels" - }, - "type": { - "const": "Feature" - } - }, "required": [ "type", "geometry", "properties" ], - "title": "GeoLocation", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/VRSallele.json b/bycon/schemas/models/json/progenetix-model/common/VRSallele.json index 8a03e2f3d..2fb870307 100644 --- a/bycon/schemas/models/json/progenetix-model/common/VRSallele.json +++ b/bycon/schemas/models/json/progenetix-model/common/VRSallele.json @@ -1,147 +1,147 @@ { - "$id": "https://progenetix.org/services/schemas/VRSallele/v2023-07-25", "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://progenetix.org/services/schemas/VRSallele/v2023-07-25", + "title": "VRS Allele", + "type": "object", + "meta": { + "contributors": [ + { + "description": "Michael Baudis", + "id": "orcid:0000-0002-9903-4248" + } + ], + "provenance": [ + { + "description": "Progenetix `bycon` project", + "id": "https://github.com/progenetix/bycon/" + }, + { + "description": "VRS 1.3 specification", + "id": "https://raw.githubusercontent.com/ga4gh/vrs/main/schema/vrs.json" + } + ] + }, + "description": "Simplified VRS allele for use in `bycon`.", + "required": { + "all_of": [ + "type", + "state", + "location" + ] + }, + "properties": { + "type": { + "type": "string", + "const": "Allele", + "default": "Allele", + "description": "MUST be \"Allele\"" + }, + "location": { + "$ref": "#/definitions/SequenceLocation" + }, + "state": { + "$ref": "#/definitions/LiteralSequenceExpression" + } + }, "definitions": { "CURIE": { "description": "A [W3C Compact URI](https://www.w3.org/TR/curie/) formatted string. A CURIE string has the structure ``prefix``:``reference``, as defined by the W3C syntax.", - "example": "ensembl:ENSG00000139618", + "type": "string", "pattern": "^\\w[^:]*:.+$", - "type": "string" + "example": "ensembl:ENSG00000139618" }, "LiteralSequenceExpression": { - "additionalProperties": false, "description": "An explicit expression of a Sequence.", + "type": "object", "properties": { - "sequence": { - "description": "A character string of Residues that represents a biological sequence using the conventional sequence order for nucleic acid sequences.", - "pattern": "^[A-Z*\\-]*$", - "type": "string" - }, "type": { + "type": "string", "const": "LiteralSequenceExpression", "default": "LiteralSequenceExpression", - "description": "MUST be \"LiteralSequenceExpression\"", - "type": "string" + "description": "MUST be \"LiteralSequenceExpression\"" + }, + "sequence": { + "description": "A character string of Residues that represents a biological sequence using the conventional sequence order for nucleic acid sequences.", + "type": "string", + "pattern": "^[A-Z*\\-]*$" } }, "required": [ "sequence", "type" ], - "type": "object" + "additionalProperties": false }, "Number": { - "additionalProperties": false, "description": "A simple integer value as a VRS class.", + "type": "object", "properties": { "type": { + "type": "string", "const": "Number", "default": "Number", - "description": "MUST be \"Number\"", - "type": "string" + "description": "MUST be \"Number\"" }, "value": { - "description": "The value represented by Number", - "type": "integer" + "type": "integer", + "description": "The value represented by Number" } }, "required": [ "type", "value" ], - "type": "object" - }, - "SequenceInterval": { - "additionalProperties": false, - "description": "A SequenceInterval represents a span on a Sequence. Positions are always represented by contiguous spans using interbase coordinates or coordinate ranges.", - "properties": { - "end": { - "$ref": "#/definitions/Number", - "description": "The end coordinate or range of the interval. The minimum value of this coordinate or range is 0. MUST represent a coordinate greater than the value of `start`." - }, - "start": { - "$ref": "#/definitions/Number", - "description": "The start coordinate or range of the interval. The minimum value of this coordinate or range is 0. MUST represent a coordinate less than the value of `end`." - }, - "type": { - "const": "SequenceInterval", - "default": "SequenceInterval", - "description": "MUST be \"SequenceInterval\"", - "type": "string" - } - }, - "required": [ - "end", - "start", - "type" - ], - "type": "object" + "additionalProperties": false }, "SequenceLocation": { "description": "A Location defined by an interval on a referenced Sequence.", + "type": "object", "properties": { "_id": { "$ref": "#/definitions/CURIE", "description": "Location Id. MUST be unique within document." }, - "interval": { - "$ref": "#/definitions/SequenceInterval", - "description": "Reference sequence region defined by a SequenceInterval." + "type": { + "type": "string", + "const": "SequenceLocation", + "default": "SequenceLocation", + "description": "MUST be \"SequenceLocation\"" }, "sequence_id": { "$ref": "#/definitions/CURIE", "description": "A VRS Computed Identifier for the reference Sequence." }, - "type": { - "const": "SequenceLocation", - "default": "SequenceLocation", - "description": "MUST be \"SequenceLocation\"", - "type": "string" + "interval": { + "$ref": "#/definitions/SequenceInterval", + "description": "Reference sequence region defined by a SequenceInterval." } - }, - "type": "object" - } - }, - "description": "Simplified VRS allele for use in `bycon`.", - "meta": { - "contributors": [ - { - "description": "Michael Baudis", - "id": "orcid:0000-0002-9903-4248" } - ], - "provenance": [ - { - "description": "Progenetix `bycon` project", - "id": "https://github.com/progenetix/bycon/" - }, - { - "description": "VRS 1.3 specification", - "id": "https://raw.githubusercontent.com/ga4gh/vrs/main/schema/vrs.json" - } - ] - }, - "properties": { - "location": { - "$ref": "#/definitions/SequenceLocation" - }, - "state": { - "$ref": "#/definitions/LiteralSequenceExpression" }, - "type": { - "const": "Allele", - "default": "Allele", - "description": "MUST be \"Allele\"", - "type": "string" + "SequenceInterval": { + "description": "A SequenceInterval represents a span on a Sequence. Positions are always represented by contiguous spans using interbase coordinates or coordinate ranges.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "SequenceInterval", + "default": "SequenceInterval", + "description": "MUST be \"SequenceInterval\"" + }, + "start": { + "$ref": "#/definitions/Number", + "description": "The start coordinate or range of the interval. The minimum value of this coordinate or range is 0. MUST represent a coordinate less than the value of `end`." + }, + "end": { + "$ref": "#/definitions/Number", + "description": "The end coordinate or range of the interval. The minimum value of this coordinate or range is 0. MUST represent a coordinate greater than the value of `start`." + } + }, + "required": [ + "end", + "start", + "type" + ], + "additionalProperties": false } - }, - "required": { - "all_of": [ - "type", - "state", - "location" - ] - }, - "title": "VRS Allele", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/VRScopyNumberChange.json b/bycon/schemas/models/json/progenetix-model/common/VRScopyNumberChange.json index 788fb3556..769c400ec 100644 --- a/bycon/schemas/models/json/progenetix-model/common/VRScopyNumberChange.json +++ b/bycon/schemas/models/json/progenetix-model/common/VRScopyNumberChange.json @@ -1,51 +1,119 @@ { - "$id": "https://progenetix.org/services/schemas/VRScopyNumberChange/v2023-07-25", "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://progenetix.org/services/schemas/VRScopyNumberChange/v2023-07-25", + "title": "VRS Copy Number Change", + "type": "object", + "meta": { + "contributors": [ + { + "description": "Michael Baudis", + "id": "orcid:0000-0002-9903-4248" + } + ], + "provenance": [ + { + "description": "Progenetix `bycon` project", + "id": "https://github.com/progenetix/bycon/" + }, + { + "description": "VRS 1.3 specification", + "id": "https://raw.githubusercontent.com/ga4gh/vrs/main/schema/vrs.json" + } + ] + }, + "description": "Simplified VRS CNV schema for use in `bycon`.", + "required": { + "all_of": [ + "type", + "subject", + "location" + ] + }, + "properties": { + "type": { + "type": "string", + "const": "CopyNumberChange", + "default": "CopyNumberChange", + "description": "MUST be \"CopyNumberChange\"" + }, + "copy_change": { + "type": "string", + "description": "MUST be one of \"efo:0030069\" (complete genomic loss), \"efo:0020073\" (high-level loss), \"efo:0030068\" (low-level loss), \"efo:0030067\" (loss), \"efo:0030064\" (regional base ploidy), \"efo:0030070\" (gain), \"efo:0030071\" (low-level gain), \"efo:0030072\" (high-level gain)." + }, + "subject": { + "$ref": "#/definitions/SequenceLocation" + }, + "required": [ + "copy_change", + "subject", + "variantType" + ] + }, "definitions": { "CURIE": { "description": "A [W3C Compact URI](https://www.w3.org/TR/curie/) formatted string. A CURIE string has the structure ``prefix``:``reference``, as defined by the W3C syntax.", - "example": "ensembl:ENSG00000139618", + "type": "string", "pattern": "^\\w[^:]*:.+$", - "type": "string" + "example": "ensembl:ENSG00000139618" }, "Number": { - "additionalProperties": false, "description": "A simple integer value as a VRS class.", + "type": "object", "properties": { "type": { + "type": "string", "const": "Number", "default": "Number", - "description": "MUST be \"Number\"", - "type": "string" + "description": "MUST be \"Number\"" }, "value": { - "description": "The value represented by Number", - "type": "integer" + "type": "integer", + "description": "The value represented by Number" } }, "required": [ "type", "value" ], - "type": "object" + "additionalProperties": false + }, + "SequenceLocation": { + "description": "A Location defined by an interval on a referenced Sequence.", + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "SequenceLocation", + "default": "SequenceLocation", + "description": "MUST be \"SequenceLocation\"" + }, + "sequence_id": { + "$ref": "#/definitions/CURIE", + "description": "A VRS Computed Identifier for the reference Sequence." + }, + "interval": { + "$ref": "#/definitions/SequenceInterval", + "description": "Reference sequence region defined by a SequenceInterval." + } + } }, "SequenceInterval": { - "additionalProperties": false, "description": "A SequenceInterval represents a span on a Sequence. Positions are always represented by contiguous spans using interbase coordinates or coordinate ranges.", + "type": "object", "properties": { - "end": { - "$ref": "#/definitions/Number", - "description": "The end coordinate or range of the interval. The minimum value of this coordinate or range is 0. MUST represent a coordinate greater than the value of `start`." + "type": { + "type": "string", + "const": "SequenceInterval", + "default": "SequenceInterval", + "description": "MUST be \"SequenceInterval\"" }, "start": { "$ref": "#/definitions/Number", "description": "The start coordinate or range of the interval. The minimum value of this coordinate or range is 0. MUST represent a coordinate less than the value of `end`." }, - "type": { - "const": "SequenceInterval", - "default": "SequenceInterval", - "description": "MUST be \"SequenceInterval\"", - "type": "string" + "end": { + "$ref": "#/definitions/Number", + "description": "The end coordinate or range of the interval. The minimum value of this coordinate or range is 0. MUST represent a coordinate greater than the value of `start`." } }, "required": [ @@ -53,75 +121,7 @@ "start", "type" ], - "type": "object" - }, - "SequenceLocation": { - "description": "A Location defined by an interval on a referenced Sequence.", - "properties": { - "interval": { - "$ref": "#/definitions/SequenceInterval", - "description": "Reference sequence region defined by a SequenceInterval." - }, - "sequence_id": { - "$ref": "#/definitions/CURIE", - "description": "A VRS Computed Identifier for the reference Sequence." - }, - "type": { - "const": "SequenceLocation", - "default": "SequenceLocation", - "description": "MUST be \"SequenceLocation\"", - "type": "string" - } - }, - "type": "object" + "additionalProperties": false } - }, - "description": "Simplified VRS CNV schema for use in `bycon`.", - "meta": { - "contributors": [ - { - "description": "Michael Baudis", - "id": "orcid:0000-0002-9903-4248" - } - ], - "provenance": [ - { - "description": "Progenetix `bycon` project", - "id": "https://github.com/progenetix/bycon/" - }, - { - "description": "VRS 1.3 specification", - "id": "https://raw.githubusercontent.com/ga4gh/vrs/main/schema/vrs.json" - } - ] - }, - "properties": { - "copy_change": { - "description": "MUST be one of \"efo:0030069\" (complete genomic loss), \"efo:0020073\" (high-level loss), \"efo:0030068\" (low-level loss), \"efo:0030067\" (loss), \"efo:0030064\" (regional base ploidy), \"efo:0030070\" (gain), \"efo:0030071\" (low-level gain), \"efo:0030072\" (high-level gain).", - "type": "string" - }, - "required": [ - "copy_change", - "subject", - "variantType" - ], - "subject": { - "$ref": "#/definitions/SequenceLocation" - }, - "type": { - "const": "CopyNumberChange", - "default": "CopyNumberChange", - "description": "MUST be \"CopyNumberChange\"", - "type": "string" - } - }, - "required": { - "all_of": [ - "type", - "subject", - "location" - ] - }, - "title": "VRS Copy Number Change", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/age.json b/bycon/schemas/models/json/progenetix-model/common/age.json index 9ca29f0da..cfaeae60d 100644 --- a/bycon/schemas/models/json/progenetix-model/common/age.json +++ b/bycon/schemas/models/json/progenetix-model/common/age.json @@ -1,13 +1,13 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Age", "description": "Age value definition. Provenance: GA4GH Phenopackets v2 `Age`", + "type": "object", "properties": { "iso8601duration": { "description": "Represents age as a ISO8601 duration (e.g., P40Y10M05D).", - "example": "P32Y6M1D", - "type": "string" + "type": "string", + "example": "P32Y6M1D" } - }, - "title": "Age", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/ageRange.json b/bycon/schemas/models/json/progenetix-model/common/ageRange.json index 204fef563..e6be60b77 100644 --- a/bycon/schemas/models/json/progenetix-model/common/ageRange.json +++ b/bycon/schemas/models/json/progenetix-model/common/ageRange.json @@ -1,16 +1,16 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "AgeRange", "description": "Age range definition. Provenance: GA4GH Phenopackets v2 `AgeRange`", + "type": "object", "properties": { - "end": { - "$ref": "./age.json", - "description": "Represents age as an ISO8601 duration (e.g., P59Y)." - }, "start": { - "$ref": "./age.json", - "description": "Represents age as an ISO8601 duration (e.g., P18Y)." + "description": "Represents age as an ISO8601 duration (e.g., P18Y).", + "$ref": "./age.json" + }, + "end": { + "description": "Represents age as an ISO8601 duration (e.g., P59Y).", + "$ref": "./age.json" } - }, - "title": "AgeRange", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/ancestry.json b/bycon/schemas/models/json/progenetix-model/common/ancestry.json index a60244c33..1d234d12a 100644 --- a/bycon/schemas/models/json/progenetix-model/common/ancestry.json +++ b/bycon/schemas/models/json/progenetix-model/common/ancestry.json @@ -1,7 +1,7 @@ { - "$id": "https://progenetix.org/services/schemas/ancestry/v2021-11-12", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, + "$id": "https://progenetix.org/services/schemas/ancestry/v2021-11-12", + "title": "Ancestry", "meta": { "provenance": [ { @@ -16,21 +16,21 @@ } ] }, + "type": "object", + "required": [ + "ancestry" + ], "properties": { "ancestry": { "$ref": "./ontologyTerm.json" }, - "confidenceScore": { - "format": "float", - "type": "number" - }, "description": { "type": "string" + }, + "confidenceScore": { + "type": "number", + "format": "float" } }, - "required": [ - "ancestry" - ], - "title": "Ancestry", - "type": "object" + "additionalProperties": false } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/celllineInfo.json b/bycon/schemas/models/json/progenetix-model/common/celllineInfo.json index f7c2afc7b..23b9f40aa 100644 --- a/bycon/schemas/models/json/progenetix-model/common/celllineInfo.json +++ b/bycon/schemas/models/json/progenetix-model/common/celllineInfo.json @@ -1,37 +1,37 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, + "title": "Cellline Info", "description": "Definition of cellline information", + "type": "object", "properties": { "id": { "description": "The cellosaurus identifier or another id as CURIE.", - "example": "cellosaurus:CVCL_0004", - "type": "string" + "type": "string", + "example": "cellosaurus:CVCL_0004" }, "label": { "description": "The common name of the cellline", + "type": "string", "example": [ "Namalwa", "HL60" - ], - "type": "string" - }, - "notes": { - "description": "An optional text descriptor.", - "example": "Derived from HeLa", - "type": "string" + ] }, "reference": { "description": "A url.", - "example": "https://www.cellosaurus.org/CVCL_IS01", - "type": "string" + "type": "string", + "example": "https://www.cellosaurus.org/CVCL_IS01" }, "synonyms": { "description": "other names & identifiers for the cellline", - "items": "string", - "type": "array" + "type": "array", + "items": "string" + }, + "notes": { + "description": "An optional text descriptor.", + "type": "string", + "example": "Derived from HeLa" } }, - "title": "Cellline Info", - "type": "object" + "additionalProperties": false } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/commonDefinitions.json b/bycon/schemas/models/json/progenetix-model/common/commonDefinitions.json index 4d11c9f94..eaec928a4 100644 --- a/bycon/schemas/models/json/progenetix-model/common/commonDefinitions.json +++ b/bycon/schemas/models/json/progenetix-model/common/commonDefinitions.json @@ -1,9 +1,57 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Common Definitions", + "description": "Definitions for concepts used in several entry types, but that having only one property are not complex enough to require a full independent schema document.", "definitions": { - "Ethnicity": { + "Sex": { + "description": "Sex of the individual. Recommended values from NCIT General Qualifier (NCIT:C27993): \"unknown\" (not assessed or not available) - NCIT:C17998; \"female\" - NCIT:C16576; \"male\" - NCIT:C20197", "$ref": "./ontologyTerm.json", + "examples": [ + { + "id": "NCIT:C16576", + "label": "female" + }, + { + "id": "NCIT:C20197", + "label": "male" + }, + { + "id": "NCIT:C1799", + "label": "unknown" + } + ] + }, + "KaryotypicSex": { + "description": "The chromosomal sex of an individual represented from a selection of options. The values correspond to the ordinal values in the Phenopackets schema where: 0 - UNKNOWN_KARYOTYPE (Untyped or inconclusive karyotyping); 1 - XX (Female); 2 - XY (Male); 3 - XO (Single X chromosome only); 4 - XXY (Two X and one Y chromosome); 5 - XXX (Three X chromosomes); 6 - XXYY (Two X chromosomes and two Y chromosomes); 7 - XXXY (Three X chromosomes and one Y chromosome); 8 - XXXX (Four X chromosomes); 9 - XYY (One X and two Y chromosomes); 10 - OTHER_KARYOTYPE (None of the above types)", + "$comments": "Compares to https://github.com/phenopackets/phenopacket-schema/blob/master/docs/karyotypicsex.rst", + "type": "string", + "enum": [ + "UNKNOWN_KARYOTYPE", + "XX", + "XY", + "XO", + "XXY", + "XXX", + "XXYY", + "XXXY", + "XXXX", + "XYY", + "OTHER_KARYOTYPE" + ], + "default": "UNKNOWN_KARYOTYPE" + }, + "Timestamp": { + "description": "Time in date-time ISO8601 string format.", + "type": "string", + "format": "date-time", + "examples": [ + "1999-08-05T17:21:00+01:00", + "2002-09-21T02:37:00-08:00" + ] + }, + "Ethnicity": { "description": "Ethnic background of the individual. Recommended is the use of a value from NCIT Race (NCIT:C17049) ontology term descendants, e.g. NCIT:C126531 (Latin American). A geographic ancestral origin category that is assigned to a population group based mainly on physical characteristics that are thought to be distinct and inherent. [ NCI ]", + "$ref": "./ontologyTerm.json", "examples": [ { "id": "NCIT:C42331", @@ -36,8 +84,8 @@ ] }, "GeographicLocation": { - "$ref": "./ontologyTerm.json", "description": "Country or region of origin of the individual (birthplace or residence place regardless of ethnic origin). Value from GAZ Geographic Location ontology (GAZ:00000448), e.g. GAZ:00002459 (United States of America).", + "$ref": "./ontologyTerm.json", "examples": [ { "id": "GAZ:00002955", @@ -61,55 +109,9 @@ "description": "Placeholder to allow the Beacon to return any additional structured information. It is recommended to encapsulate additional informations in this attribute instead of directly adding attributes at the same level than the others in order to avoid collision in the names of attributes in future versions of the specification.", "type": "object" }, - "KaryotypicSex": { - "$comments": "Compares to https://github.com/phenopackets/phenopacket-schema/blob/master/docs/karyotypicsex.rst", - "default": "UNKNOWN_KARYOTYPE", - "description": "The chromosomal sex of an individual represented from a selection of options. The values correspond to the ordinal values in the Phenopackets schema where: 0 - UNKNOWN_KARYOTYPE (Untyped or inconclusive karyotyping); 1 - XX (Female); 2 - XY (Male); 3 - XO (Single X chromosome only); 4 - XXY (Two X and one Y chromosome); 5 - XXX (Three X chromosomes); 6 - XXYY (Two X chromosomes and two Y chromosomes); 7 - XXXY (Three X chromosomes and one Y chromosome); 8 - XXXX (Four X chromosomes); 9 - XYY (One X and two Y chromosomes); 10 - OTHER_KARYOTYPE (None of the above types)", - "enum": [ - "UNKNOWN_KARYOTYPE", - "XX", - "XY", - "XO", - "XXY", - "XXX", - "XXYY", - "XXXY", - "XXXX", - "XYY", - "OTHER_KARYOTYPE" - ], - "type": "string" - }, - "Sex": { - "$ref": "./ontologyTerm.json", - "description": "Sex of the individual. Recommended values from NCIT General Qualifier (NCIT:C27993): \"unknown\" (not assessed or not available) - NCIT:C17998; \"female\" - NCIT:C16576; \"male\" - NCIT:C20197", - "examples": [ - { - "id": "NCIT:C16576", - "label": "female" - }, - { - "id": "NCIT:C20197", - "label": "male" - }, - { - "id": "NCIT:C1799", - "label": "unknown" - } - ] - }, - "Timestamp": { - "description": "Time in date-time ISO8601 string format.", - "examples": [ - "1999-08-05T17:21:00+01:00", - "2002-09-21T02:37:00-08:00" - ], - "format": "date-time", - "type": "string" - }, "Unit": { - "$ref": "./ontologyTerm.json", "description": "The kind of unit. Recommended from NCIT Unit of Category ontology term (NCIT:C42568) descendants", + "$ref": "./ontologyTerm.json", "examples": [ { "id": "NCIT:C70575", @@ -125,7 +127,5 @@ } ] } - }, - "description": "Definitions for concepts used in several entry types, but that having only one property are not complex enough to require a full independent schema document.", - "title": "Common Definitions" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/complexValue.json b/bycon/schemas/models/json/progenetix-model/common/complexValue.json index 4200c6a3c..0092b60bf 100644 --- a/bycon/schemas/models/json/progenetix-model/common/complexValue.json +++ b/bycon/schemas/models/json/progenetix-model/common/complexValue.json @@ -1,11 +1,31 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Complex Value", + "description": "Definition of a complex value class. Provenance: GA4GH Phenopackets v2 `TypedQuantity`", + "type": "object", + "properties": { + "typedQuantities": { + "description": "List of quantities required to fully describe the complex value", + "type": "array", + "items": { + "$ref": "#/definitions/TypedQuantity" + } + } + }, "definitions": { "TypedQuantity": { "properties": { + "quantityType": { + "description": "OntologyClass to describe the type of the measurement. Renamed compared to GA4GH Phenopackets v2 `ComplexValue.TypedQuantity.type`", + "$ref": "./ontologyTerm.json", + "example": { + "id": "NCIT:C25298", + "label": "Systolic Blood Pressure" + } + }, "quantity": { - "$ref": "./quantity.json", "description": "Quantity denoting the outcome of the measurement", + "$ref": "./quantity.json", "example": { "quentity": { "unit": { @@ -14,14 +34,6 @@ } } } - }, - "quantityType": { - "$ref": "./ontologyTerm.json", - "description": "OntologyClass to describe the type of the measurement. Renamed compared to GA4GH Phenopackets v2 `ComplexValue.TypedQuantity.type`", - "example": { - "id": "NCIT:C25298", - "label": "Systolic Blood Pressure" - } } }, "required": [ @@ -29,17 +41,5 @@ "quantity" ] } - }, - "description": "Definition of a complex value class. Provenance: GA4GH Phenopackets v2 `TypedQuantity`", - "properties": { - "typedQuantities": { - "description": "List of quantities required to fully describe the complex value", - "items": { - "$ref": "#/definitions/TypedQuantity" - }, - "type": "array" - } - }, - "title": "Complex Value", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/dataUseConditions.json b/bycon/schemas/models/json/progenetix-model/common/dataUseConditions.json index 90b1b4561..bdc2f83eb 100644 --- a/bycon/schemas/models/json/progenetix-model/common/dataUseConditions.json +++ b/bycon/schemas/models/json/progenetix-model/common/dataUseConditions.json @@ -1,6 +1,17 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Data Use Conditions", + "description": "Data use conditions", + "type": "object", + "properties": { + "duoDataUse": { + "type": "array", + "items": { + "$ref": "#/definitions/DUODataUse" + }, + "minItems": 1 + } + }, "definitions": { "DUODataUse": { "allOf": [ @@ -11,8 +22,22 @@ "$ref": "./ontologyTerm.json" }, { + "type": "object", + "required": [ + "version" + ], "properties": { + "version": { + "type": "string", + "examples": [ + "17-07-2016" + ] + }, "modifiers": { + "type": "array", + "items": { + "$ref": "./ontologyTerm.json" + }, "examples": [ { "id": "EFO:0001645", @@ -21,23 +46,9 @@ { "id": "EFO:0001655" } - ], - "items": { - "$ref": "./ontologyTerm.json" - }, - "type": "array" - }, - "version": { - "examples": [ - "17-07-2016" - ], - "type": "string" + ] } - }, - "required": [ - "version" - ], - "type": "object" + } } ], "examples": [ @@ -60,16 +71,5 @@ ] } }, - "description": "Data use conditions", - "properties": { - "duoDataUse": { - "items": { - "$ref": "#/definitions/DUODataUse" - }, - "minItems": 1, - "type": "array" - } - }, - "title": "Data Use Conditions", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/disease.json b/bycon/schemas/models/json/progenetix-model/common/disease.json index 9c220b460..363887da7 100644 --- a/bycon/schemas/models/json/progenetix-model/common/disease.json +++ b/bycon/schemas/models/json/progenetix-model/common/disease.json @@ -1,26 +1,46 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Disease", "description": "Diseases diagnosed e.g. to an individual, defined by diseaseID, age of onset, stage, level of severity, outcome and the presence of family history. Similarities to GA4GH Phenopackets v2 `Disease`", + "type": "object", "properties": { + "diseaseCode": { + "description": "Disease identifier. Value from disease ontologies such as HPO, OMIM, Orphanet, MONDO, e.g. lactose intolerance (HP:0004789, ICD10CM:E73). Provenance: GA4GH Phenopackets v2 `Disease.term`", + "$ref": "./ontologyTerm.json", + "examples": [ + { + "id": "HP:0004789", + "label": "lactose intolerance" + }, + { + "id": "ICD10CM:E73", + "label": "lactose intolerance" + }, + { + "id": "OMIM:164400", + "label": "Spinocerebellar ataxia 1" + } + ] + }, "ageOfOnset": { "$ref": "./timeElement.json", "examples": [ { - "age": { - "iso8601duration": "P32Y6M1D" - }, "ageGroup": { "id": "NCIT:C49685", "label": "Adult 18-65 Years Old" + }, + "age": { + "iso8601duration": "P32Y6M1D" } }, { "ageRange": { - "end": { - "iso8601duration": "P59Y" - }, "start": { "iso8601duration": "P18Y" + }, + "end": { + "iso8601duration": "P59Y" } } }, @@ -31,60 +51,40 @@ } ] }, - "diseaseCode": { + "stage": { + "description": "Ontology term, e.g. from the Ontology for General Medical Science (OGMS). Provenance: GA4GH Phenopackets v2 `Disease.disease_stage`", "$ref": "./ontologyTerm.json", - "description": "Disease identifier. Value from disease ontologies such as HPO, OMIM, Orphanet, MONDO, e.g. lactose intolerance (HP:0004789, ICD10CM:E73). Provenance: GA4GH Phenopackets v2 `Disease.term`", "examples": [ { - "id": "HP:0004789", - "label": "lactose intolerance" + "id": "OGMS:0000119", + "label": "acute onset" }, { - "id": "ICD10CM:E73", - "label": "lactose intolerance" + "id": "OGMS:0000117", + "label": "asymptomatic" }, { - "id": "OMIM:164400", - "label": "Spinocerebellar ataxia 1" + "id": "OGMS:0000106", + "label": "remission" } ] }, "familyHistory": { "description": "Boolean value indicating determined or self-reported presence of family history of the disease.", + "type": "boolean", "examples": [ true - ], - "type": "boolean" + ] }, "notes": { "description": "Unstructured text to describe additional properties of this disease instance.", + "type": "string", "examples": [ "Some free text" - ], - "type": "string" - }, - "stage": { - "$ref": "./ontologyTerm.json", - "description": "Ontology term, e.g. from the Ontology for General Medical Science (OGMS). Provenance: GA4GH Phenopackets v2 `Disease.disease_stage`", - "examples": [ - { - "id": "OGMS:0000119", - "label": "acute onset" - }, - { - "id": "OGMS:0000117", - "label": "asymptomatic" - }, - { - "id": "OGMS:0000106", - "label": "remission" - } ] } }, "required": [ "diseaseCode" - ], - "title": "Disease", - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/doseInterval.json b/bycon/schemas/models/json/progenetix-model/common/doseInterval.json index 7b31769b8..1ec7032f4 100644 --- a/bycon/schemas/models/json/progenetix-model/common/doseInterval.json +++ b/bycon/schemas/models/json/progenetix-model/common/doseInterval.json @@ -1,25 +1,26 @@ { - "$comments": "From https://github.com/phenopackets/phenopacket-schema/blob/v2/docs/dose-interval.rst", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, + "title": "DoseInterval", + "$comments": "From https://github.com/phenopackets/phenopacket-schema/blob/v2/docs/dose-interval.rst", "description": "This element represents a block of time in which the dosage of a medication was constant. For example, to represent a period of 30 mg twice a day for an interval of 10 days, we would use a Quantity element to represent the individual 30 mg dose, and OntologyClass element to represent twice a day, and an Interval element to represent the 10-day interval. Provenance: Phenopackets v2", + "type": "object", "properties": { + "quantity": { + "$ref": "./quantity.json" + }, "interval": { - "$ref": "./timeInterval.json", "description": "The specific interval over which the dosage was administered in the indicated quantity.", + "$ref": "./timeInterval.json", "examples": [ { - "end": "1967-11-18T12:00:00+01", - "start": "1967-11-11T07:30:00+01" + "start": "1967-11-11T07:30:00+01", + "end": "1967-11-18T12:00:00+01" } ] }, - "quantity": { - "$ref": "./quantity.json" - }, "scheduleFrequency": { - "$ref": "./ontologyTerm.json", "description": "How often doses are administered per day (or other indicated duration)", + "$ref": "./ontologyTerm.json", "examples": [ { "id": "NCIT:C64496", @@ -33,6 +34,5 @@ "interval", "scheduleFrequency" ], - "title": "DoseInterval", - "type": "object" + "additionalProperties": false } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/evidence.json b/bycon/schemas/models/json/progenetix-model/common/evidence.json index 2bd5d171c..493a8c8cd 100644 --- a/bycon/schemas/models/json/progenetix-model/common/evidence.json +++ b/bycon/schemas/models/json/progenetix-model/common/evidence.json @@ -1,19 +1,20 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Evidence", "description": "Definition of an evidence class. Provenance: GA4GH Phenopackets v2 `Evidence`", + "type": "object", "properties": { "evidenceCode": { - "$ref": "./ontologyTerm.json", "description": "An ontology class that represents the evidence type", + "$ref": "./ontologyTerm.json", "example": { "id": "ECO:0006017", "label": "author statement from published clinical study used in manual assertion" } }, "reference": { - "$ref": "./externalReference.json", "description": "Representation of the source of the evidence", + "$ref": "./externalReference.json", "example": { "id": "PMID:30962759", "label": "Recurrent Erythema Nodosum in a Child with a SHOC2 Gene Mutation" @@ -23,6 +24,5 @@ "required": [ "evidenceCode" ], - "title": "Evidence", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/exposure.json b/bycon/schemas/models/json/progenetix-model/common/exposure.json index fbb65c15e..dc7d66709 100644 --- a/bycon/schemas/models/json/progenetix-model/common/exposure.json +++ b/bycon/schemas/models/json/progenetix-model/common/exposure.json @@ -1,24 +1,12 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Exposure", "description": "Exposures (lifestyle, behavioural exposures) occurred to individual,defined by exposure ID, date and age of onset, dose, and duration.", + "type": "object", "properties": { - "ageAtExposure": { - "$ref": "../common/age.json" - }, - "date": { - "description": "Date of the exposure in ISO8601 format.", - "format": "date", - "type": "string" - }, - "duration": { - "description": "Exposure duration in ISO8601 format", - "example": "P32Y6M1D", - "type": "string" - }, "exposureCode": { - "$ref": "./ontologyTerm.json", "description": "Exposure ID. Value from Environment Exposure Ontology.", + "$ref": "./ontologyTerm.json", "examples": [ { "id": "CHEBI:46661", @@ -30,13 +18,26 @@ } ] }, - "unit": { - "$ref": "../common/commonDefinitions.json#/definitions/Unit", - "description": "Unit of the exposure. Recommended from NCIT Unit of Category ontology term (NCIT:C42568) descendants." - }, "value": { "description": "Quantification of the exposure.", "type": "number" + }, + "unit": { + "description": "Unit of the exposure. Recommended from NCIT Unit of Category ontology term (NCIT:C42568) descendants.", + "$ref": "../common/commonDefinitions.json#/definitions/Unit" + }, + "duration": { + "description": "Exposure duration in ISO8601 format", + "type": "string", + "example": "P32Y6M1D" + }, + "date": { + "description": "Date of the exposure in ISO8601 format.", + "type": "string", + "format": "date" + }, + "ageAtExposure": { + "$ref": "../common/age.json" } }, "required": [ @@ -45,6 +46,5 @@ "unit", "duration" ], - "title": "Exposure", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/externalReference.json b/bycon/schemas/models/json/progenetix-model/common/externalReference.json index 1c893ced1..c8a6cdd89 100644 --- a/bycon/schemas/models/json/progenetix-model/common/externalReference.json +++ b/bycon/schemas/models/json/progenetix-model/common/externalReference.json @@ -1,29 +1,29 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "ExternalReference", "description": "Definition of an external reference class. Provenance: GA4GH Phenopackets v2 `ExternalReference`", + "type": "object", "properties": { "id": { "description": "An application specific identifier. RECOMMENDED.", + "type": "string", "examples": [ "PMID:34054918" - ], - "type": "string" + ] + }, + "reference": { + "description": "A url.", + "type": "string", + "example": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8155688/" }, "notes": { "description": "An optional text descriptor. Renamed compared to GA4GH Phenopackets v2 `ExternalReference.description`", + "type": "string", "examples": [ "Signatures of Discriminative Copy Number Aberrations in 31 Cancer Subtypes" - ], - "type": "string" - }, - "reference": { - "description": "A url.", - "example": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8155688/", - "type": "string" + ] } }, "required": [], - "title": "ExternalReference", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/file.json b/bycon/schemas/models/json/progenetix-model/common/file.json index b5661aafc..fe4659c6d 100644 --- a/bycon/schemas/models/json/progenetix-model/common/file.json +++ b/bycon/schemas/models/json/progenetix-model/common/file.json @@ -1,40 +1,40 @@ { - "$id": "https://progenetix.org/services/schemas/file/v2022-05-04", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "$id": "https://progenetix.org/services/schemas/file/v2022-05-04", + "title": "File", "description": "Information about a file referenced from a Phenopacket.", - "examples": [ - { - "fileAttributes": { - "fileFormat": "pgxseg", - "genomeAssembly": "GRCh38" - }, - "uri": "http://progenetix.test/beacon/biosamples/pgxbs-kftviebk/genomicVariations/?output=pgxseg" - } - ], + "type": "object", "properties": { - "fileAttributes": { - "description": "Additional attributes describuing the file, as `key: value` pairs.", - "items": { - "type": "object" - }, - "type": "array" + "uri": { + "description": "A valid URI in local or global context.", + "type": "string" }, "individualToFileIdentifiers": { "description": "The mapping between the Individual.id or Biosample.id to any identifier in the file.", + "type": "array", "items": { "type": "object" - }, - "type": "array" + } }, - "uri": { - "description": "A valid URI in local or global context.", - "type": "string" + "fileAttributes": { + "description": "Additional attributes describuing the file, as `key: value` pairs.", + "type": "array", + "items": { + "type": "object" + } } }, + "examples": [ + { + "uri": "http://progenetix.test/beacon/biosamples/pgxbs-kftviebk/genomicVariations/?output=pgxseg", + "fileAttributes": { + "fileFormat": "pgxseg", + "genomeAssembly": "GRCh38" + } + } + ], "required": [ "uri" ], - "title": "File", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/gestationalAge.json b/bycon/schemas/models/json/progenetix-model/common/gestationalAge.json index a74efb903..4c971a795 100644 --- a/bycon/schemas/models/json/progenetix-model/common/gestationalAge.json +++ b/bycon/schemas/models/json/progenetix-model/common/gestationalAge.json @@ -1,28 +1,28 @@ { - "$comments": "From https://github.com/phenopackets/phenopacket-schema/blob/v2/docs/gestational-age.rst", "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "GestationalAge", "description": "Gestational age (or menstrual age) is the time elapsed between the first day of the last normal menstrual period and the day of delivery. The first day of the last menstrual period occurs approximately 2 weeks before ovulation and approximately 3 weeks before implantation of the blastocyst. Because most women know when their last period began but not when ovulation occurred, this definition traditionally has been used when estimating the expected date of delivery. In contrast, chronological age (or postnatal age) is the time elapsed after birth. Provenance: Phenopackets v2", + "type": "object", + "$comments": "From https://github.com/phenopackets/phenopacket-schema/blob/v2/docs/gestational-age.rst", "properties": { - "days": { - "description": "Days beyond the completed weeks, if available.", - "examples": [ - 2, - 4 - ], - "type": "integer" - }, "weeks": { "description": "Completed weeks of gestation according to the above definition.", + "type": "integer", "examples": [ 4, 33 - ], - "type": "integer" + ] + }, + "days": { + "description": "Days beyond the completed weeks, if available.", + "type": "integer", + "examples": [ + 2, + 4 + ] } }, "required": [ "weeks" - ], - "title": "GestationalAge", - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/measurement.json b/bycon/schemas/models/json/progenetix-model/common/measurement.json index 47869c597..62d151bf1 100644 --- a/bycon/schemas/models/json/progenetix-model/common/measurement.json +++ b/bycon/schemas/models/json/progenetix-model/common/measurement.json @@ -1,22 +1,18 @@ { - "$id": "https://progenetix.org/services/schemas/measurement/v2021-11-12", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "$id": "https://progenetix.org/services/schemas/measurement/v2021-11-12", + "title": "Measurement", "description": "Definition of a measurement class.", + "type": "object", "properties": { "assayCode": { - "$ref": "./ontologyTerm.json", "description": "Class that describes the assay used to produce the measurement", + "$ref": "./ontologyTerm.json", "example": { "id": "LOINC:26515-7", "label": "Platelets [#/volume] in Blood" } }, - "date": { - "description": "Date of measurement.", - "format": "date-time", - "type": "string" - }, "measurementValue": { "description": "The result of the measurement", "oneOf": [ @@ -28,14 +24,9 @@ } ] }, - "notes": { - "description": "Unstructured text to describe this measurement.", - "example": "Some free text", - "type": "string" - }, "observationMoment": { - "$ref": "timeElement.json#/oneOf", "description": "Moment in time at which measurement was performed. Recommended.", + "$ref": "timeElement.json#/oneOf", "examples": [ { "age": { @@ -44,21 +35,30 @@ } ] }, + "date": { + "description": "Date of measurement.", + "type": "string", + "format": "date-time" + }, "procedure": { - "$ref": "procedure.json", "description": "Clinical procedure performed to acquire the sample used for the measurement.", + "$ref": "procedure.json", "example": { "code": { "id": "NCIT:C5189", "label": "Radical Cystoprostatectomy" } } + }, + "notes": { + "description": "Unstructured text to describe this measurement.", + "type": "string", + "example": "Some free text" } }, "required": [ "assayCode", "measurementValue" ], - "title": "Measurement", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/metaData.json b/bycon/schemas/models/json/progenetix-model/common/metaData.json index a230bc366..324bcbd7d 100644 --- a/bycon/schemas/models/json/progenetix-model/common/metaData.json +++ b/bycon/schemas/models/json/progenetix-model/common/metaData.json @@ -1,36 +1,36 @@ { - "$id": "https://progenetix.org/services/schemas/metaData/v2022-04-06", "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://progenetix.org/services/schemas/metaData/v2022-04-06", + "title": "Metadata", "description": "Metadata to be used with a Phenopacket.", + "type": "object", "properties": { + "submittedBy": { + "type": "string" + }, "createdBy": { "type": "string" }, "externalReferences": { + "type": "array", "items": { "$ref": "../common/externalReference.json" - }, - "type": "array" + } }, "phenopacketSchemaVersion": { "type": "string" }, "resources": { + "type": "array", "items": { "$ref": "resource.json" - }, - "type": "array" - }, - "submittedBy": { - "type": "string" + } }, "updates": { + "type": "array", "items": { "$ref": "update.json" - }, - "type": "array" + } } - }, - "title": "Metadata", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/ontologyTerm.json b/bycon/schemas/models/json/progenetix-model/common/ontologyTerm.json index f72492599..575d359f8 100644 --- a/bycon/schemas/models/json/progenetix-model/common/ontologyTerm.json +++ b/bycon/schemas/models/json/progenetix-model/common/ontologyTerm.json @@ -1,27 +1,27 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Ontology Term", "description": "Definition of an ontology term.", + "type": "object", "properties": { "id": { "description": "A CURIE identifier, e.g. as `id` for an ontology term.", + "type": "string", + "pattern": "^\\w[^:]+:.+$", "examples": [ "ga4gh:GA.01234abcde", "DUO:0000004", "orcid:0000-0003-3463-0775", "PMID:15254584" - ], - "pattern": "^\\w[^:]+:.+$", - "type": "string" + ] }, "label": { - "description": "The text that describes the term. By default it could be the preferred text of the term, but is it acceptable to customize it for a clearer description and understanding of the term in an specific context.", - "type": "string" + "type": "string", + "description": "The text that describes the term. By default it could be the preferred text of the term, but is it acceptable to customize it for a clearer description and understanding of the term in an specific context." } }, "required": [ "id" ], - "title": "Ontology Term", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/pedigree.json b/bycon/schemas/models/json/progenetix-model/common/pedigree.json index 00df1fcf8..8a4b667b9 100644 --- a/bycon/schemas/models/json/progenetix-model/common/pedigree.json +++ b/bycon/schemas/models/json/progenetix-model/common/pedigree.json @@ -1,124 +1,125 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Pedigree", + "description": "Pedigree studies in which the individual is part of.", + "type": "object", + "properties": { + "id": { + "description": "Pedigree identifier.", + "type": "string", + "example": "Pedigree1001" + }, + "disease": { + "$ref": "../common/disease.json" + }, + "numSubjects": { + "description": "Total number of subjects in pedigree.", + "type": "integer", + "example": 10 + }, + "members": { + "type": "array", + "description": "List of members of the pedigree. If the current pedigree definition is attached to the proband, it contains the whole list of pedigree members, including the proband. If the definition is attached to an individual different than the proband, it only contains two entries: one that describes that member, e.g. the proband mother or father, and one that points to the proband.", + "items": { + "$ref": "#/definitions/pedigreeMember" + }, + "minItems": 1 + } + }, "definitions": { "pedigreeMember": { + "type": "object", + "properties": { + "memberId": { + "description": "Identifier of the individual. The individual could be part of the same Beacon datasets or not, in which case the information here is meant to complete the pedigree. If the individual is also in the dataset use that Individual ID. If it is not the in the dataset, use a non-collading ID, e.g. concatenating the Pedigree ID with a local ID, similarly to the example 'Pedigree1001-m1'.", + "type": "string", + "examples": [ + "Pedigree1001-m1", + "Ind0012122" + ] + }, + "role": { + "description": "Pedigree role, defined as relationship to proband. Value from Family Member term (NCIT:C41256), e.g. \"proband\" (NCIT:C64435),\"identical twin\" (NCIT:C73429), \"mother\" (NCIT:C25189).", + "$ref": "./ontologyTerm.json", + "examples": [ + { + "id": "NCIT:C64435", + "label": "Proband" + }, + { + "id": "NCIT:C96580", + "label": "Biological Mother" + }, + { + "id": "NCIT:C96572", + "label": "Biological Father" + }, + { + "id": "NCIT:C165848", + "label": "Identical Twin Brother" + } + ] + }, + "affected": { + "description": "Is the individual affected by the disease in the pedigree?", + "type": "boolean" + } + }, "examples": [ { "membersInProband": [ { - "affected": true, "memberId": "Ind0012122", "role": { "id": "NCIT:C64435", "label": "Proband" - } + }, + "affected": true }, { - "affected": false, "memberId": "Pedigree1001-m2", "role": { "id": "NCIT:C96580", "label": "Biological Mother" - } + }, + "affected": false }, { - "affected": true, "memberId": "Pedigree1001-m3", "role": { "id": "NCIT:C96572", "label": "Biological Father" - } + }, + "affected": true } ] }, { "membersInMother": [ { - "affected": false, "memberId": "Ind0028989", "role": { "id": "NCIT:C96580", "label": "Biological Mother" - } + }, + "affected": false }, { - "affected": true, "memberId": "Ind0012122", "role": { "id": "NCIT:C64435", "label": "Proband" - } + }, + "affected": true } ] } ], - "properties": { - "affected": { - "description": "Is the individual affected by the disease in the pedigree?", - "type": "boolean" - }, - "memberId": { - "description": "Identifier of the individual. The individual could be part of the same Beacon datasets or not, in which case the information here is meant to complete the pedigree. If the individual is also in the dataset use that Individual ID. If it is not the in the dataset, use a non-collading ID, e.g. concatenating the Pedigree ID with a local ID, similarly to the example 'Pedigree1001-m1'.", - "examples": [ - "Pedigree1001-m1", - "Ind0012122" - ], - "type": "string" - }, - "role": { - "$ref": "./ontologyTerm.json", - "description": "Pedigree role, defined as relationship to proband. Value from Family Member term (NCIT:C41256), e.g. \"proband\" (NCIT:C64435),\"identical twin\" (NCIT:C73429), \"mother\" (NCIT:C25189).", - "examples": [ - { - "id": "NCIT:C64435", - "label": "Proband" - }, - { - "id": "NCIT:C96580", - "label": "Biological Mother" - }, - { - "id": "NCIT:C96572", - "label": "Biological Father" - }, - { - "id": "NCIT:C165848", - "label": "Identical Twin Brother" - } - ] - } - }, "required": [ "memberId", "role", "affected" - ], - "type": "object" - } - }, - "description": "Pedigree studies in which the individual is part of.", - "properties": { - "disease": { - "$ref": "../common/disease.json" - }, - "id": { - "description": "Pedigree identifier.", - "example": "Pedigree1001", - "type": "string" - }, - "members": { - "description": "List of members of the pedigree. If the current pedigree definition is attached to the proband, it contains the whole list of pedigree members, including the proband. If the definition is attached to an individual different than the proband, it only contains two entries: one that describes that member, e.g. the proband mother or father, and one that points to the proband.", - "items": { - "$ref": "#/definitions/pedigreeMember" - }, - "minItems": 1, - "type": "array" - }, - "numSubjects": { - "description": "Total number of subjects in pedigree.", - "example": 10, - "type": "integer" + ] } }, "required": [ @@ -126,6 +127,5 @@ "disease", "members" ], - "title": "Pedigree", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/phenotypicFeature.json b/bycon/schemas/models/json/progenetix-model/common/phenotypicFeature.json index fa5739b0f..12cd7995e 100644 --- a/bycon/schemas/models/json/progenetix-model/common/phenotypicFeature.json +++ b/bycon/schemas/models/json/progenetix-model/common/phenotypicFeature.json @@ -1,20 +1,13 @@ { - "$id": "https://progenetix.org/services/schemas/phenotypicFeature/v2021-11-12", "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://progenetix.org/services/schemas/phenotypicFeature/v2021-11-12", + "title": "PhenotypicFeature", "description": "Used to describe a phenotype that characterizes the subject or biosample.", + "type": "object", "properties": { - "evidence": { - "$ref": "./evidence.json", - "description": "The evidence for an assertion of the observation of a type. RECOMMENDED." - }, - "excluded": { - "default": false, - "description": "Flag to indicate whether the disease was observed or not. Default is `false`, in other words the disease was observed. Therefore it is only required in cases to indicate that the disease was looked for, but found to be absent. More formally, this modifier indicates the logical negation of the OntologyClass used in the `featureType` field. CAUTION: It is imperative to check this field for correct interpretation of the disease! source: Phenopackets v.2", - "type": "boolean" - }, "featureType": { - "$ref": "./ontologyTerm.json", "description": "Term denoting the phenotypic feature. Preferably a value from Human Phenotype Ontology (HPO).", + "$ref": "./ontologyTerm.json", "examples": [ { "id": "HP:0000002", @@ -30,8 +23,17 @@ } ] }, + "excluded": { + "description": "Flag to indicate whether the disease was observed or not. Default is `false`, in other words the disease was observed. Therefore it is only required in cases to indicate that the disease was looked for, but found to be absent. More formally, this modifier indicates the logical negation of the OntologyClass used in the `featureType` field. CAUTION: It is imperative to check this field for correct interpretation of the disease! source: Phenopackets v.2", + "type": "boolean", + "default": false + }, "modifiers": { "description": "For instance one or more terms from HPO Clinical Modifier (HP:0012823). This subontology is designed to provide terms to characterize and specify the phenotypic abnormalities defined in the Phenotypic abnormality subontology, with respect to severity, laterality, age of onset, and other aspects. source: HPO:probinson", + "type": "array", + "items": { + "$ref": "./ontologyTerm.json" + }, "examples": [ { "id": "HP:0032500", @@ -41,24 +43,19 @@ "id": "HP:4000053", "label": "Displaced fracture" } - ], - "items": { - "$ref": "./ontologyTerm.json" - }, - "type": "array" - }, - "notes": { - "description": "Unstructured text to describe additional properties of this phenotypic feature.", - "example": "Some free text", - "type": "string" + ] }, "onset": { - "$ref": "./timeElement.json#/oneOf", - "description": "Age or time at which the feature was first observed." + "description": "Age or time at which the feature was first observed.", + "$ref": "./timeElement.json#/oneOf" }, "resolution": { - "$ref": "timeElement.json#/oneOf", - "description": "Age or time at which the feature resolved or abated." + "description": "Age or time at which the feature resolved or abated.", + "$ref": "timeElement.json#/oneOf" + }, + "evidence": { + "description": "The evidence for an assertion of the observation of a type. RECOMMENDED.", + "$ref": "./evidence.json" }, "severity": { "$ref": "./ontologyTerm.json", @@ -72,11 +69,14 @@ "label": "Moderate" } ] + }, + "notes": { + "description": "Unstructured text to describe additional properties of this phenotypic feature.", + "type": "string", + "example": "Some free text" } }, "required": [ "featureType" - ], - "title": "PhenotypicFeature", - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/procedure.json b/bycon/schemas/models/json/progenetix-model/common/procedure.json index 42e41e682..d316f191a 100644 --- a/bycon/schemas/models/json/progenetix-model/common/procedure.json +++ b/bycon/schemas/models/json/progenetix-model/common/procedure.json @@ -1,14 +1,31 @@ { - "$id": "https://progenetix.org/services/schemas/procedure/v2021-11-12", "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://progenetix.org/services/schemas/procedure/v2021-11-12", + "title": "Procedure", "description": "Class describing a clinical procedure or intervention.", + "type": "object", "properties": { - "ageAtProcedure": { - "$ref": "timeElement.json#/oneOf" + "procedureCode": { + "description": "Clinical procedure performed. Recommended values from Medical Action Ontology (MAXO) `Medical action` term tree (MAXO:0000001)", + "$ref": "./ontologyTerm.json", + "examples": [ + { + "id": "MAXO:0001175", + "label": "liver transplantation" + }, + { + "id": "MAXO:0000136", + "label": "high-resolution microendoscopy" + }, + { + "id": "OBI:0002654", + "label": "needle biopsy" + } + ] }, "bodySite": { - "$ref": "./ontologyTerm.json", "description": "Specific body site where the procedure was performed. Recommended valuee from Uber-anatomy ontology (UBERON)", + "$ref": "./ontologyTerm.json", "examples": [ { "id": "UBERON:0003403", @@ -22,32 +39,15 @@ }, "dateOfProcedure": { "description": "Date of procedure, in ISO8601 format", - "example": "2010-07-10", + "type": "string", "format": "date-time", - "type": "string" + "example": "2010-07-10" }, - "procedureCode": { - "$ref": "./ontologyTerm.json", - "description": "Clinical procedure performed. Recommended values from Medical Action Ontology (MAXO) `Medical action` term tree (MAXO:0000001)", - "examples": [ - { - "id": "MAXO:0001175", - "label": "liver transplantation" - }, - { - "id": "MAXO:0000136", - "label": "high-resolution microendoscopy" - }, - { - "id": "OBI:0002654", - "label": "needle biopsy" - } - ] + "ageAtProcedure": { + "$ref": "timeElement.json#/oneOf" } }, "required": [ "procedureCode" - ], - "title": "Procedure", - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/provenance.json b/bycon/schemas/models/json/progenetix-model/common/provenance.json index cf37ade4e..725782fbe 100644 --- a/bycon/schemas/models/json/progenetix-model/common/provenance.json +++ b/bycon/schemas/models/json/progenetix-model/common/provenance.json @@ -1,7 +1,7 @@ { - "$id": "https://progenetix.org/services/schemas/provenance/v2021-11-12", "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "The Provenance class is the wrapper object for schemas informing about technical, geographic or collection associated origin of a higher oreder object such as an Individual or Biosample.\n", + "$id": "https://progenetix.org/services/schemas/provenance/v2021-11-12", + "title": "Provenance", "meta": { "provenance": [ { @@ -9,18 +9,18 @@ "id": "https://github.com/progenetix/bycon/" } ], - "sb_status": "community", "used_by": [ { "description": "Progenetix database schema (Beacon+ backend)", "id": "https://github.com/progenetix/schemas/" } - ] + ], + "sb_status": "community" }, + "description": "The Provenance class is the wrapper object for schemas informing about technical, geographic or collection associated origin of a higher oreder object such as an Individual or Biosample.\n", "properties": { "geo_location": { "$ref": "GeoLocation.json" } - }, - "title": "Provenance" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/quantity.json b/bycon/schemas/models/json/progenetix-model/common/quantity.json index 1a9969704..c7853dc26 100644 --- a/bycon/schemas/models/json/progenetix-model/common/quantity.json +++ b/bycon/schemas/models/json/progenetix-model/common/quantity.json @@ -1,25 +1,25 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Quantity", "description": "Definition of a quantity class. Provenance: GA4GH Phenopackets v2 `Quantity`", + "type": "object", "properties": { - "referenceRange": { - "$ref": "./referenceRange.json", - "description": "The normal range for the value", - "example": {} - }, "unit": { "$ref": "./commonDefinitions.json#/definitions/Unit" }, "value": { "description": "The value of the quantity in the units", "type": "number" + }, + "referenceRange": { + "description": "The normal range for the value", + "$ref": "./referenceRange.json", + "example": {} } }, "required": [ "unit", "value" ], - "title": "Quantity", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/referenceRange.json b/bycon/schemas/models/json/progenetix-model/common/referenceRange.json index 2f538934c..1b42d26e8 100644 --- a/bycon/schemas/models/json/progenetix-model/common/referenceRange.json +++ b/bycon/schemas/models/json/progenetix-model/common/referenceRange.json @@ -1,30 +1,31 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "ReferenceRange", "description": "Definition of a range class.", + "type": "object", "properties": { - "high": { - "description": "Upper range end of normal", + "unit": { + "description": "The kind of unit.", + "$ref": "./commonDefinitions.json#/definitions/Unit", "examples": [ - 135 - ], - "type": "number" + { + "id": "NCIT:C49670", + "label": "Millimeter of Mercury" + } + ] }, "low": { "description": "Lower range end of normal", + "type": "number", "examples": [ 85 - ], - "type": "number" + ] }, - "unit": { - "$ref": "./commonDefinitions.json#/definitions/Unit", - "description": "The kind of unit.", + "high": { + "description": "Upper range end of normal", + "type": "number", "examples": [ - { - "id": "NCIT:C49670", - "label": "Millimeter of Mercury" - } + 135 ] } }, @@ -33,6 +34,5 @@ "low", "high" ], - "title": "ReferenceRange", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/resource.json b/bycon/schemas/models/json/progenetix-model/common/resource.json index 97386761d..b73d298e2 100644 --- a/bycon/schemas/models/json/progenetix-model/common/resource.json +++ b/bycon/schemas/models/json/progenetix-model/common/resource.json @@ -1,7 +1,7 @@ { - "$id": "https://progenetix.org/services/schemas/resource/v2022-04-06", "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "Resource used for referencing an object.", + "$id": "https://progenetix.org/services/schemas/resource/v2022-04-06", + "title": "Resource", "meta": { "provenance": [ { @@ -14,34 +14,34 @@ } ] }, + "description": "Resource used for referencing an object.", + "type": "object", + "required": [ + "namespacePrefix", + "id", + "name", + "url", + "version", + "iriPrefix" + ], "properties": { "id": { "type": "string" }, - "iriPrefix": { + "name": { "type": "string" }, - "name": { + "url": { "type": "string" }, "namespacePrefix": { "type": "string" }, - "url": { + "version": { "type": "string" }, - "version": { + "iriPrefix": { "type": "string" } - }, - "required": [ - "namespacePrefix", - "id", - "name", - "url", - "version", - "iriPrefix" - ], - "title": "Resource", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/timeElement.json b/bycon/schemas/models/json/progenetix-model/common/timeElement.json index de387f4b9..92768d555 100644 --- a/bycon/schemas/models/json/progenetix-model/common/timeElement.json +++ b/bycon/schemas/models/json/progenetix-model/common/timeElement.json @@ -1,7 +1,9 @@ { - "$comments": "If using an ontology class the use of NCIT Age Group ontology term (NCIT:C20587) descendants is recommended.", "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "TimeElement", "description": "Definition of a wrapper for various time descriptors. This follows the Phenopackets structure https://github.com/phenopackets/phenopacket-schema/blob/v2/docs/time-element.rst", + "type": "object", + "$comments": "If using an ontology class the use of NCIT Age Group ontology term (NCIT:C20587) descendants is recommended.", "oneOf": [ { "$ref": "./age.json" @@ -21,7 +23,5 @@ { "$ref": "./ontologyTerm.json" } - ], - "title": "TimeElement", - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/timeInterval.json b/bycon/schemas/models/json/progenetix-model/common/timeInterval.json index 1d4a2a475..49d824f5f 100644 --- a/bycon/schemas/models/json/progenetix-model/common/timeInterval.json +++ b/bycon/schemas/models/json/progenetix-model/common/timeInterval.json @@ -1,20 +1,21 @@ { - "$comments": "From https://github.com/phenopackets/phenopacket-schema/blob/v2/docs/time-interval.rst", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, + "title": "TimeInterval", "description": "Time interval with start and end defined as ISO8601 time stamps.", + "type": "object", + "$comments": "From https://github.com/phenopackets/phenopacket-schema/blob/v2/docs/time-interval.rst", "properties": { - "end": { + "start": { "$ref": "./commonDefinitions.json#/definitions/Timestamp", "examples": [ - "2022-03-10T15:25:07Z" + "1999-08-05T17:21:00+01:00", + "2002-09-21T02:37:00-08:00" ] }, - "start": { + "end": { "$ref": "./commonDefinitions.json#/definitions/Timestamp", "examples": [ - "1999-08-05T17:21:00+01:00", - "2002-09-21T02:37:00-08:00" + "2022-03-10T15:25:07Z" ] } }, @@ -22,6 +23,5 @@ "start", "end" ], - "title": "TimeInterval", - "type": "object" + "additionalProperties": false } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/treatment.json b/bycon/schemas/models/json/progenetix-model/common/treatment.json index 50853681f..7c67d6a6a 100644 --- a/bycon/schemas/models/json/progenetix-model/common/treatment.json +++ b/bycon/schemas/models/json/progenetix-model/common/treatment.json @@ -1,53 +1,53 @@ { - "$comments": "Compares to https://github.com/phenopackets/phenopacket-schema/blob/master/docs/treatment.rst, with modifications.", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Treatment", "description": "Treatment(s) prescribed/administered, defined by treatment ID, date and age of onset, dose, schedule and duration.", + "$comments": "Compares to https://github.com/phenopackets/phenopacket-schema/blob/master/docs/treatment.rst, with modifications.", + "type": "object", "properties": { - "ageAtOnset": { - "$ref": "./age.json" - }, - "cumulativeDose": { - "$ref": "./quantity.json" - }, - "doseIntervals": { - "items": { - "$ref": "./doseInterval.json" - }, - "type": "array" - }, - "routeOfAdministration": { + "treatmentCode": { + "description": "Code of treatment. Value from NCIT or any relevant ontology. Compares to `agent` in Phenopackets v2", "$ref": "./ontologyTerm.json", - "description": "Route of treatment. Value from NCIT Route of Administration tree (NCIT:C38114).", "examples": [ { - "id": "NCIT:C38304", - "label": "Topical" + "id": "NCIT:C287", + "label": "Aspirin" }, { - "id": "NCIT:C78373", - "label": "Dietary" + "id": "NCIT:C62078", + "label": "Tamoxifen" } ] }, - "treatmentCode": { + "routeOfAdministration": { + "description": "Route of treatment. Value from NCIT Route of Administration tree (NCIT:C38114).", "$ref": "./ontologyTerm.json", - "description": "Code of treatment. Value from NCIT or any relevant ontology. Compares to `agent` in Phenopackets v2", "examples": [ { - "id": "NCIT:C287", - "label": "Aspirin" + "id": "NCIT:C38304", + "label": "Topical" }, { - "id": "NCIT:C62078", - "label": "Tamoxifen" + "id": "NCIT:C78373", + "label": "Dietary" } ] + }, + "ageAtOnset": { + "$ref": "./age.json" + }, + "doseIntervals": { + "type": "array", + "items": { + "$ref": "./doseInterval.json" + } + }, + "cumulativeDose": { + "$ref": "./quantity.json" } }, "required": [ "treatmentCode" ], - "title": "Treatment", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/update.json b/bycon/schemas/models/json/progenetix-model/common/update.json index ca4c1186b..e3dc6f1c2 100644 --- a/bycon/schemas/models/json/progenetix-model/common/update.json +++ b/bycon/schemas/models/json/progenetix-model/common/update.json @@ -1,18 +1,18 @@ { - "$id": "https://progenetix.org/services/schemas/update/v2022-04-06", "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://progenetix.org/services/schemas/update/v2022-04-06", + "title": "Update", "description": "Update information used with a Phenopacket.", + "type": "object", "properties": { - "comment": { - "type": "string" - }, "timestamp": { "$ref": "..common//commonDefinitions.json#/definitions/Timestamp" }, "updatedBy": { "type": "string" + }, + "comment": { + "type": "string" } - }, - "title": "Update", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/value.json b/bycon/schemas/models/json/progenetix-model/common/value.json index ef9281235..e044e0294 100644 --- a/bycon/schemas/models/json/progenetix-model/common/value.json +++ b/bycon/schemas/models/json/progenetix-model/common/value.json @@ -1,6 +1,8 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Value", "description": "Definition of a value class. Provenance: GA4GH Phenopackets v2 `Value`", + "type": "object", "oneOf": [ { "$ref": "./quantity.json" @@ -8,7 +10,5 @@ { "$ref": "./ontologyTerm.json" } - ], - "title": "Value", - "type": "object" + ] } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/common/vitalStatus.json b/bycon/schemas/models/json/progenetix-model/common/vitalStatus.json index 0ddf82bb5..684d9fafa 100644 --- a/bycon/schemas/models/json/progenetix-model/common/vitalStatus.json +++ b/bycon/schemas/models/json/progenetix-model/common/vitalStatus.json @@ -1,38 +1,38 @@ { - "$id": "https://progenetix.org/services/schemas/vitalStatus/v2021-12-02", "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://progenetix.org/services/schemas/vitalStatus/v2021-12-02", + "title": "VitalStatus", "description": "This element can be used to report whether the individual is living or dead at the timepoint when the phenopacket was created (or if the status is unknown). Source: Phenopackets v2, with modifications", + "type": "object", + "required": [ + "status" + ], "properties": { - "cause_of_death": { - "$ref": "./ontologyTerm.json" - }, - "followup_time": { - "description": "The followup after the diagnosis of the primary disease, as ISO 8601 duration. This is the primary value which is also represented - if existing - through the `survival_time_in_days` attribute (for compatibility with Phenopackets v2).", - "examples": [ - "P11Y2M", - "P33D" - ], - "type": "string" - }, "status": { + "type": "string", "enum": [ "UNKNOWN_STATUS", "ALIVE", "DECEASED" - ], - "type": "string" + ] + }, + "time_of_death": { + "$ref": "timeElement.json#/oneOf" + }, + "cause_of_death": { + "$ref": "./ontologyTerm.json" }, "survival_time_in_days": { "description": "The survival or followup (if ALIVE) time after primary diagnosis. In the Progenetix Beacon this is a duplicate representation of the `followup_time` ISO 8601 value.", "type": "integer" }, - "time_of_death": { - "$ref": "timeElement.json#/oneOf" + "followup_time": { + "description": "The followup after the diagnosis of the primary disease, as ISO 8601 duration. This is the primary value which is also represented - if existing - through the `survival_time_in_days` attribute (for compatibility with Phenopackets v2).", + "type": "string", + "examples": [ + "P11Y2M", + "P33D" + ] } - }, - "required": [ - "status" - ], - "title": "VitalStatus", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/datasets/defaultSchema.json b/bycon/schemas/models/json/progenetix-model/datasets/defaultSchema.json index 4a470f26e..d053e7185 100644 --- a/bycon/schemas/models/json/progenetix-model/datasets/defaultSchema.json +++ b/bycon/schemas/models/json/progenetix-model/datasets/defaultSchema.json @@ -1,50 +1,36 @@ { - "$comment": "version: ga4gh-beacon-dataset-v2.0.0", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, "description": "A dataset available in the beacon", + "$comment": "version: ga4gh-beacon-dataset-v2.0.0", + "type": "object", "properties": { - "createDateTime": { - "$ref": "../common/commonDefinitions.json#/definitions/Timestamp", - "description": "The time the dataset was created (ISO 8601 format)", + "id": { + "type": "string", + "description": "Unique identifier of the dataset", "examples": [ - "2017-01-17T20:33:40Z" + "ds01010101" ] }, - "dataUseConditions": { - "$ref": "../common/dataUseConditions.json", - "description": "Data use conditions applying to this dataset." + "name": { + "type": "string", + "description": "Name of the dataset", + "examples": [ + "Dataset with synthetic data" + ] }, "description": { + "type": "string", "description": "Description of the dataset", "examples": [ "This dataset provides examples of the actual data in this Beacon instance." - ], - "type": "string" - }, - "externalUrl": { - "description": "URL to an external system providing more dataset information (RFC 3986 format).", - "examples": [ - "http://example.org/wiki/Main_Page" - ], - "type": "string" - }, - "id": { - "description": "Unique identifier of the dataset", - "examples": [ - "ds01010101" - ], - "type": "string" - }, - "info": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Info" + ] }, - "name": { - "description": "Name of the dataset", + "createDateTime": { + "$ref": "../common/commonDefinitions.json#/definitions/Timestamp", + "description": "The time the dataset was created (ISO 8601 format)", "examples": [ - "Dataset with synthetic data" - ], - "type": "string" + "2017-01-17T20:33:40Z" + ] }, "updateDateTime": { "$ref": "../common/commonDefinitions.json#/definitions/Timestamp", @@ -54,16 +40,30 @@ ] }, "version": { + "type": "string", "description": "Version of the dataset", "examples": [ "v1.1" - ], - "type": "string" + ] + }, + "externalUrl": { + "type": "string", + "description": "URL to an external system providing more dataset information (RFC 3986 format).", + "examples": [ + "http://example.org/wiki/Main_Page" + ] + }, + "info": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Info" + }, + "dataUseConditions": { + "description": "Data use conditions applying to this dataset.", + "$ref": "../common/dataUseConditions.json" } }, "required": [ "id", "name" ], - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/datasets/endpoints.json b/bycon/schemas/models/json/progenetix-model/datasets/endpoints.json index da1987ff8..c2371629e 100644 --- a/bycon/schemas/models/json/progenetix-model/datasets/endpoints.json +++ b/bycon/schemas/models/json/progenetix-model/datasets/endpoints.json @@ -1,132 +1,31 @@ { - "components": { - "parameters": { - "datasetIds": { - "in": "query", - "name": "datasetIds", - "schema": { - "examples": [ - [ - "progenetix", - "examplez" - ], - "cellz" - ], - "items": { - "type": "string" - }, - "type": "array" - } - }, - "entryId": { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - "filters": { - "in": "query", - "name": "filters", - "schema": { - "examples": [ - [ - "DUO:0000007" - ] - ], - "items": { - "type": "string" - }, - "type": "array" - } - }, - "limit": { - "in": "query", - "name": "limit", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" - } - }, - "requestedSchema": { - "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", - "example": "ga4gh-service-info-v1.0", - "in": "query", - "name": "requestedSchema", - "required": false, - "schema": { - "type": "string" - } - }, - "skip": { - "in": "query", - "name": "skip", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" - } - } - }, - "responses": { - "CollectionsResponse": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCollectionsResponse.json" - } - ] - } - } - }, - "description": "Successful collection list operation." - }, - "ResultsOKResponse": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" - } - ] - } - } - }, - "description": "Successful operation." - } - } - }, + "openapi": "3.0.2", + "servers": [], "info": { + "version": "2.0.0", + "title": "GA4GH Beacon API Specification - Datasets Endpoints", + "description": "TBD", "contact": { "email": "beacon@ga4gh.org" }, - "description": "TBD", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "title": "GA4GH Beacon API Specification - Datasets Endpoints", - "version": "2.0.0" + } }, - "openapi": "3.0.2", + "tags": [ + { + "name": "GET Endpoints", + "description": "Available endpoints in this API. All of them have a POST counterpart." + }, + { + "name": "POST Endpoints", + "description": "The same operations than GET, just by POST." + } + ], "paths": { "/datasets": { "get": { - "description": "Get a list of datasets", - "operationId": "getDatasets", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -144,6 +43,11 @@ "$ref": "#/components/parameters/filters" } ], + "description": "Get a list of datasets", + "operationId": "getDatasets", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/CollectionsResponse" @@ -151,14 +55,14 @@ "default": { "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] + } }, "post": { "description": "Get a list of datasets", "operationId": "postDatasetsRequest", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -174,45 +78,45 @@ "$ref": "#/components/responses/CollectionsResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, "/datasets/{id}": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get details about one dataset, identified by its (unique) 'id'", - "operationId": "getOneDataset", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" } ], + "description": "Get details about one dataset, identified by its (unique) 'id'", + "operationId": "getOneDataset", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { "description": "Get details about one dataset, identified by its (unique) 'id'", "operationId": "postOneDataset", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -228,19 +132,19 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/datasets/{id}/biosamples": { + "/datasets/{id}/g_variants": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the biosamples list from one dataset, identified by its (unique) 'id'", - "operationId": "getOneDatasetBiosamples", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -252,27 +156,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the genomic variants list from one dataset, identified by its (unique) 'id'", + "operationId": "getOneDatasetEntries", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get the biosamples list from one dataset, identified by its (unique) 'id'", - "operationId": "postOneDatasetBiosamples", + "description": "Get the genomic variants list from one dataset, identified by its (unique) 'id'", + "operationId": "postOneDatasetEntries", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -288,20 +192,23 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/datasets/{id}/filtering_terms": { + "/datasets/{id}/biosamples": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the list of filtering terms that could be used with a given dataset, identified by its (unique) 'id'", - "operationId": "getOneDatasetFilteringTerms", "parameters": [ + { + "$ref": "#/components/parameters/requestedSchema" + }, { "$ref": "#/components/parameters/skip" }, @@ -309,34 +216,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the biosamples list from one dataset, identified by its (unique) 'id'", + "operationId": "getOneDatasetBiosamples", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" - } - } - }, - "description": "Successful operation" + "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get the list of filtering terms that could be used with a given dataset, identified by its (unique) 'id'", - "operationId": "postOneDatasetFilteringTerms", + "description": "Get the biosamples list from one dataset, identified by its (unique) 'id'", + "operationId": "postOneDatasetBiosamples", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -349,29 +249,22 @@ }, "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" - } - } - }, - "description": "Successful operation" + "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/datasets/{id}/g_variants": { + "/datasets/{id}/individuals": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the genomic variants list from one dataset, identified by its (unique) 'id'", - "operationId": "getOneDatasetEntries", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -383,27 +276,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the individuals list from one dataset, identified by its (unique) 'id'", + "operationId": "getOneDatasetIndividuals", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get the genomic variants list from one dataset, identified by its (unique) 'id'", - "operationId": "postOneDatasetEntries", + "description": "Get the biosamples list from one dataset, identified by its (unique) 'id'", + "operationId": "postOneDatasetIndividuals", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -419,23 +312,20 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/datasets/{id}/individuals": { + "/datasets/{id}/filtering_terms": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the individuals list from one dataset, identified by its (unique) 'id'", - "operationId": "getOneDatasetIndividuals", "parameters": [ - { - "$ref": "#/components/parameters/requestedSchema" - }, { "$ref": "#/components/parameters/skip" }, @@ -443,27 +333,34 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the list of filtering terms that could be used with a given dataset, identified by its (unique) 'id'", + "operationId": "getOneDatasetFilteringTerms", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { - "$ref": "#/components/responses/ResultsOKResponse" + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" + } + } + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get the biosamples list from one dataset, identified by its (unique) 'id'", - "operationId": "postOneDatasetIndividuals", + "description": "Get the list of filtering terms that could be used with a given dataset, identified by its (unique) 'id'", + "operationId": "postOneDatasetFilteringTerms", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -476,28 +373,131 @@ }, "responses": { "200": { - "$ref": "#/components/responses/ResultsOKResponse" + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" + } + } + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } } }, - "servers": [], - "tags": [ - { - "description": "Available endpoints in this API. All of them have a POST counterpart.", - "name": "GET Endpoints" + "components": { + "responses": { + "ResultsOKResponse": { + "description": "Successful operation.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" + } + ] + } + } + } + }, + "CollectionsResponse": { + "description": "Successful collection list operation.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCollectionsResponse.json" + } + ] + } + } + } + } }, - { - "description": "The same operations than GET, just by POST.", - "name": "POST Endpoints" + "parameters": { + "requestedSchema": { + "name": "requestedSchema", + "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "example": "ga4gh-service-info-v1.0" + }, + "skip": { + "name": "skip", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" + } + }, + "limit": { + "name": "limit", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" + } + }, + "entryId": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "datasetIds": { + "name": "datasetIds", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "progenetix", + "examplez" + ], + "cellz" + ] + } + }, + "filters": { + "name": "filters", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "DUO:0000007" + ] + ] + } + } } - ] + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/datasets/examples/dataset-Max-example.json b/bycon/schemas/models/json/progenetix-model/datasets/examples/dataset-Max-example.json index 9bf90334f..9b5cec8a7 100644 --- a/bycon/schemas/models/json/progenetix-model/datasets/examples/dataset-Max-example.json +++ b/bycon/schemas/models/json/progenetix-model/datasets/examples/dataset-Max-example.json @@ -1,25 +1,25 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "id": "ds01010101", + "name": "Dataset with synthetic data", + "description": "This dataset provides examples of the actual data in this Beacon instance.", "createDateTime": "2017-01-17T20:33:40Z", + "updateDateTime": "2017-01-17T20:33:40Z", + "version": "v1.1", + "externalUrl": "http://example.org/wiki/Main_Page", "dataUseConditions": { "duoDataUse": [ { "id": "DUO:0000007", "label": "disease specific research", + "version": "17-07-2016", "modifiers": [ { "id": "EFO:0001645", "label": "coronary artery disease" } - ], - "version": "17-07-2016" + ] } ] - }, - "description": "This dataset provides examples of the actual data in this Beacon instance.", - "externalUrl": "http://example.org/wiki/Main_Page", - "id": "ds01010101", - "name": "Dataset with synthetic data", - "updateDateTime": "2017-01-17T20:33:40Z", - "version": "v1.1" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/endpoints.json b/bycon/schemas/models/json/progenetix-model/endpoints.json index 054b9c6c4..b803c697b 100644 --- a/bycon/schemas/models/json/progenetix-model/endpoints.json +++ b/bycon/schemas/models/json/progenetix-model/endpoints.json @@ -1,152 +1,167 @@ { - "components": { - "parameters": { - "limit": { - "in": "query", - "name": "limit", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" - } - }, - "requestedSchema": { - "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", - "example": "ga4gh-service-info-v1.0", - "in": "query", - "name": "requestedSchema", - "required": false, - "schema": { - "type": "string" - } - }, - "skip": { - "in": "query", - "name": "skip", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" - } - } - }, - "responses": { - "infoOKResponse": { - "content": { - "application/json": { - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconInfoResponse.json", - "description": "Response of a request for information about a Beacon" - } - } - }, - "description": "Successful operation" - } - } - }, + "openapi": "3.0.2", + "servers": [], "info": { + "version": "2.0.0", + "title": "GA4GH Beacon API Specification", + "description": "A Beacon is a web service for data discovery and sharing that can be queried for information about entry types defined by a Model.", "contact": { "email": "beacon@ga4gh.org" }, - "description": "A Beacon is a web service for data discovery and sharing that can be queried for information about entry types defined by a Model.", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "title": "GA4GH Beacon API Specification", - "version": "2.0.0" + } }, - "openapi": "3.0.2", "paths": { "/": { + "parameters": [ + { + "$ref": "#/components/parameters/requestedSchema" + } + ], "get": { "description": "Get information about the beacon", "operationId": "getBeaconRoot", + "tags": [ + "Informational endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/infoOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "Informational endpoints" - ] - }, + } + } + }, + "/info": { "parameters": [ { "$ref": "#/components/parameters/requestedSchema" } - ] + ], + "get": { + "description": "Get information about the beacon", + "operationId": "getBeaconInfoRoot", + "tags": [ + "Informational endpoints" + ], + "responses": { + "200": { + "$ref": "#/components/responses/infoOKResponse" + }, + "default": { + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" + } + } + } + }, + "/service-info": { + "get": { + "description": "Get information about the beacon using GA4GH ServiceInfo format", + "operationId": "getBeaconServiceInfo", + "tags": [ + "Informational endpoints" + ], + "responses": { + "200": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/ga4gh-service-info-1-0-0-schema.json" + } + } + } + } + } + } }, "/configuration": { "get": { "description": "TBD", "operationId": "getBeaconConfiguration", + "tags": [ + "Configuration" + ], "responses": { "200": { + "description": "Successful operation", "content": { "application/json": { "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconConfigurationResponse.json", - "description": "Response of a request for information about a Beacon" + "description": "Response of a request for information about a Beacon", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconConfigurationResponse.json" } } - }, - "description": "Successful operation" + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "Configuration" - ] + } } }, "/entry_types": { "get": { "description": "TBD", "operationId": "getEntryTypes", + "tags": [ + "Configuration" + ], "parameters": [], "responses": { "200": { + "description": "Successful operation", "content": { "application/json": { "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconEntryTypesResponse.json", - "description": "Response of a request for information about a Beacon" + "description": "Response of a request for information about a Beacon", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconEntryTypesResponse.json" } } - }, - "description": "Successful operation" + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "Configuration" - ] + } } }, - "/filtering_terms": { + "/map": { "get": { - "description": "Get the list of filtering terms handled by this beacon", - "operationId": "getFilteringTerms", + "description": "TBD", + "operationId": "getBeaconMap", + "tags": [ + "Configuration" + ], + "parameters": [], "responses": { "200": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "description": "Response of a request for information about a Beacon", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconMapResponse.json" + } + } + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "Informational endpoints" - ] - }, + } + } + }, + "/filtering_terms": { "parameters": [ { "$ref": "#/components/parameters/skip" @@ -154,79 +169,64 @@ { "$ref": "#/components/parameters/limit" } - ] - }, - "/info": { + ], "get": { - "description": "Get information about the beacon", - "operationId": "getBeaconInfoRoot", - "responses": { - "200": { - "$ref": "#/components/responses/infoOKResponse" - }, - "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" - } - }, + "description": "Get the list of filtering terms handled by this beacon", + "operationId": "getFilteringTerms", "tags": [ "Informational endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/requestedSchema" - } - ] - }, - "/map": { - "get": { - "description": "TBD", - "operationId": "getBeaconMap", - "parameters": [], + ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconMapResponse.json", - "description": "Response of a request for information about a Beacon" - } - } - }, - "description": "Successful operation" + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "Configuration" - ] + } } - }, - "/service-info": { - "get": { - "description": "Get information about the beacon using GA4GH ServiceInfo format", - "operationId": "getBeaconServiceInfo", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/ga4gh-service-info-1-0-0-schema.json" - } - } - }, - "description": "Successful operation" + } + }, + "components": { + "responses": { + "infoOKResponse": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "description": "Response of a request for information about a Beacon", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconInfoResponse.json" + } } + } + } + }, + "parameters": { + "requestedSchema": { + "name": "requestedSchema", + "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", + "in": "query", + "required": false, + "schema": { + "type": "string" }, - "tags": [ - "Informational endpoints" - ] + "example": "ga4gh-service-info-v1.0" + }, + "skip": { + "name": "skip", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" + } + }, + "limit": { + "name": "limit", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" + } } } - }, - "servers": [] + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/genomicVariations/defaultSchema.json b/bycon/schemas/models/json/progenetix-model/genomicVariations/defaultSchema.json index ea206d69e..c915ab179 100644 --- a/bycon/schemas/models/json/progenetix-model/genomicVariations/defaultSchema.json +++ b/bycon/schemas/models/json/progenetix-model/genomicVariations/defaultSchema.json @@ -1,243 +1,128 @@ { - "$comment": "version: ga4gh-beacon-variant-v2.0.0", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, - "definitions": { - "CaseLevelVariant": { - "description": "", - "properties": { - "alleleOrigin": { - "$ref": "../common/ontologyTerm.json", - "description": "Ontology value for allele origin of variant in sample from the Variant Origin (SO:0001762). Categories are `somatic variant`, `germline variant`, `maternal variant`, `paternal variant`, `de novo variant`, `pedigree specific variant`, `population specific variant`. Corresponds to Variant Inheritance in FHIR.", - "examples": [ - { - "id": "SO:0001777", - "label": "somatic variant" - }, - { - "id": "SO:0001778", - "label": "germline variant" - }, - { - "id": "SO:0001775", - "label": "maternal variant" - }, - { - "id": "SO:0001776", - "label": "paternal variant" - }, - { - "id": "SO:0001781", - "label": "de novo variant" - }, - { - "id": "SO:0001779", - "label": "pedigree specific variant" - }, - { - "id": "SO:0001780", - "label": "population specific variant" - } - ] - }, - "analysisId": { - "description": "Reference to the bioinformatics analysis ID (`analysis.id`)", - "examples": [ - "pgxcs-kftvldsu" - ], - "type": "string" - }, - "biosampleId": { - "description": "Reference to biosample ID (`biosample.id`)", - "examples": [ - "bs001104" - ], - "type": "string" - }, - "clinicalInterpretations": { - "items": { - "$ref": "#/definitions/PhenoClinicEffect" - }, - "type": "array" - }, - "id": { - "description": "Internal id of this case level *instance* of the variant. This is an optional housekeeping parameter and should not be confused with the identifier of the variant (`variantInternalId`).", - "examples": [ - "id0001-var101101118" - ], - "type": "string" - }, - "individualId": { - "description": "Reference to individual ID (`individual.id`)", - "examples": [ - "ind0001" - ], - "type": "string" - }, - "phenotypicEffects": { - "items": { - "$ref": "#/definitions/PhenoClinicEffect" - }, - "type": "array" + "title": "Genomic Variation", + "$comment": "version: ga4gh-beacon-variant-v2.0.0", + "description": "Schema for a genomic variant entry.", + "type": "object", + "required": [ + "variantInternalId", + "variation" + ], + "properties": { + "variation": { + "oneOf": [ + { + "$ref": "../common/VRSallele.json" }, - "runId": { - "description": "Reference to the experimental run ID (`run.id`)", - "examples": [ - "SRR10903401" - ], - "type": "string" + { + "$ref": "../common/VRScopyNumberChange.json" }, - "zygosity": { - "$ref": "../common/ontologyTerm.json", - "description": "Ontology term for zygosity in which variant is present in the sample from the Zygosity Ontology (GENO:0000391) , e.g `heterozygous` (GENO:0000135)", - "examples": [ - { - "id": "GENO:0000135", - "label": "heterozygous" - }, - { - "id": "GENO:0000136", - "label": "homozygous" - }, - { - "id": "GENO:0000604", - "label": "hemizygous X-linked" - } - ] + { + "$ref": "#/definitions/LegacyVariation" } - }, - "required": [ - "biosampleId" ], - "type": "object" + "description": "The schema to describe the genomic variation.\n#### Source\n\n * https://raw.githubusercontent.com/ga4gh/vrs/1.3/schema/vrs.json#/definitions/MolecularVariation\n * https://raw.githubusercontent.com/ga4gh/vrs/1.3/schema/vrs.json#/definitions/SystemicVariation" }, - "FrequencyInPopulations": { + "variantInternalId": { + "description": "Reference to the **internal** variant ID. This represents the primary key/identifier of that variant **inside** a given Beacon instance. Different Beacon instances may use identical id values, referring to unrelated variants. Public identifiers such as the GA4GH Variant Representation Id (VRSid) MUST be returned in the `identifiers` section. A Beacon instance can, of course, use the VRSid as their own internal id but still MUST represent this then in the `identifiers` section.", + "type": "string", + "examples": [ + "var00001", + "v110112" + ] + }, + "identifiers": { + "$ref": "#/definitions/Identifiers" + }, + "molecularAttributes": { + "$ref": "#/definitions/MolecularAttributes" + }, + "caseLevelData": { + "type": "array", + "description": "caseLevelData reports about the variation instances observed in individual analyses.", + "items": { + "$ref": "#/definitions/CaseLevelVariant" + } + }, + "variantLevelData": { + "$ref": "#/definitions/VariantLevelData" + }, + "frequencyInPopulations": { + "type": "array", + "items": { + "$ref": "#/definitions/FrequencyInPopulations" + } + } + }, + "definitions": { + "LegacyVariation": { + "type": "object", + "required": [ + "variantType", + "alternateBases", + "location" + ], "properties": { - "frequencies": { - "items": { - "$ref": "#/definitions/PopulationFrequency" - }, - "minItems": 1, - "type": "array" - }, - "source": { - "description": "The study", - "examples": [ - "The Genome Aggregation Database (gnomAD)", - "The European Genome-phenome Archive (EGA)" - ], - "type": "string" + "location": { + "$ref": "https://raw.githubusercontent.com/ga4gh/vrs/1.2/schema/vrs.json#/definitions/Location" }, - "sourceReference": { - "description": "A reference to further documentation or details.", + "variantType": { + "description": "The `variantType` declares the nature of the variation in relation to a reference. In a response, it is used to describe the variation. In a request, it is used to declare the type of event the Beacon client is looking for. If in queries variants can not be defined through a sequence of one or more bases (`precise` variants) it can be used standalone (i.e. without `alternateBases`) together with positional parameters. Examples here are e.g. queries for structural variants such as `DUP` (increased allelic count of material from the genomic region between `start` and `end` positions without assumption about the placement of the additional sequence) or `DEL` (deletion of sequence following `start`). Either `alternateBases` or `variantType` is required, with the exception of range queries (single `start` and `end` parameters).", + "type": "string", "examples": [ - "https://gnomad.broadinstitute.org/", - "https://ega-archive.org/" + "SNP", + "DEL", + "DUP", + "BND" ], - "type": "string" + "default": "SNP" }, - "version": { - "description": "version of the source data.", - "examples": [ - "gnomAD v3.1.1" - ], - "type": "string" - } - }, - "required": [ - "source", - "sourceReference", - "frequencies" - ], - "type": "object" - }, - "GenomicFeature": { - "description": "Genomic feature(s) related to the variant. NOTE: Although genes could also be referenced using these attributes, they have an independent section to allow direct queries.", - "properties": { - "featureClass": { - "$ref": "../common/ontologyTerm.json", - "description": "Ontology term that describes the class of genomic feature affected by the variant. Values from Ensembl Glossary (ENSGLOSSARY ontology) are recommended, e.g. protein coding gene, non-coding RNA, long non-coding RNA. ", + "referenceBases": { + "description": "Reference bases for this variant (starting from `start`). * Accepted values: IUPAC codes for nucleotides (e.g. `https://www.bioinformatics.org/sms/iupac.html`). N is a wildcard, that denotes the position of any base, and can be used as a standalone base of any type or within a partially known sequence. As example, a query of `ANNT` the Ns can take take any form of `[ACGT]` and will match `ANNT`, `ACNT`, `ACCT`, `ACGT` ... and so forth. * an *empty value* is used in the case of insertions with the maximally trimmed, inserted sequence being indicated in `AlternateBases`. NOTE: Many Beacon instances could not support UIPAC codes and it is not mandatory for them to do so. In such cases the use of [ACGTN] is mandated.", + "type": "string", + "pattern": "^([ACGTUNRYSWKMBDHV\\-\\.]*)$", "examples": [ - { - "id": "ENSGLOSSARY:0000158", - "label": "5 prime UTR variant" - } + "A", + "T", + "N", + "", + "ACG" ] }, - "featureID": { - "$ref": "../common/ontologyTerm.json", - "description": "Where applicable, ID/accession/name of genomic feature related to the `featureClass`. Preferably in CURIE format. If the value is a gene id or name, it points to the gene related to the `featureClass`, e.g. `the 5 prime UTR upstream of TP53`", + "alternateBases": { + "description": "Alternate bases for this variant (starting from `start`). * Accepted values: IUPAC codes for nucleotides (e.g. `https://www.bioinformatics.org/sms/iupac.html`). N is a wildcard, that denotes the position of any base, and can beused as a standalone base of any type or within a partially knownsequence. As example, a query of `ANNT` the Ns can take take any form of[ACGT] and will match `ANNT`, `ACNT`, `ACCT`, `ACGT` ... and so forth.* an *empty value* is used in the case of deletions with the maximally trimmed, deleted sequence being indicated in `ReferenceBases`* Categorical variant queries, e.g. such *not* being represented through sequence & position, make use of the `variantType` parameter. * Either `alternateBases` or `variantType` is required.", + "type": "string", + "pattern": "^([ACGTUNRYSWKMBDHV\\-\\.]*)$", "examples": [ - { - "id": "HGNC:11998", - "label": "TP53" - } + "T", + "G", + "N", + "AG", + "" ] } - }, - "required": [ - "featureClass" - ], - "type": "object" + } }, "Identifiers": { + "type": "object", "properties": { - "clinvarVariantId": { - "description": "ClinVar variant id. Other id values used by ClinVar can be added to `variantAlternativeIds`", - "examples": [ - "clinvar:12345", - "9325" - ], - "pattern": "^(clinvar:)?\\d+$", - "type": "string" - }, - "genomicHGVSId": { - "description": "HGVSId descriptor.", - "examples": [ - "NC_000017.11:g.43057063G>A" - ], - "type": "string" - }, - "proteinHGVSIds": { - "description": "List of HGVSId descriptor(s) at protein level (for protein-altering variants).", - "examples": [ - [ - "NP_009225.1:p.Glu1817Ter" - ], - [ - "LRG 199p1:p.Val25Gly (preferred)" - ] - ], - "items": { - "type": "string" - }, - "type": "array" - }, - "transcriptHGVSIds": { - "description": "List of HGVSId descriptor(s) at transcript level.", - "examples": [ - [ - "NC 000023.10(NM004006.2):c.357+1G" - ] - ], - "items": { - "type": "string" - }, - "type": "array" - }, "variantAlternativeIds": { "description": "List of cross-referencing ID(s), for the variant in other databases (e.g. dbSNP, ClinVar, ClinGen, COSMIC), as `externalReferences` with CURIE(s).", + "type": "array", + "items": { + "$ref": "../common/externalReference.json" + }, "examples": [ [ { "id": "dbSNP:rs587780345", - "notes": "dbSNP id", - "reference": "https://www.ncbi.nlm.nih.gov/snp/rs587780345" + "reference": "https://www.ncbi.nlm.nih.gov/snp/rs587780345", + "notes": "dbSNP id" }, { "id": "ClinGen:CA152954", - "notes": "ClinGen Allele Registry id", - "reference": "http://reg.clinicalgenome.org/redmine/projects/registry/genboree_registry/by_caid?caid=CA152954" + "reference": "http://reg.clinicalgenome.org/redmine/projects/registry/genboree_registry/by_caid?caid=CA152954", + "notes": "ClinGen Allele Registry id" }, { "id": "UniProtKB:P35557#VAR_003699", @@ -250,78 +135,61 @@ "reference": "https://www.omim.org/entry/164757#0001" } ] - ], + ] + }, + "genomicHGVSId": { + "description": "HGVSId descriptor.", + "type": "string", + "examples": [ + "NC_000017.11:g.43057063G>A" + ] + }, + "transcriptHGVSIds": { + "description": "List of HGVSId descriptor(s) at transcript level.", + "type": "array", "items": { - "$ref": "../common/externalReference.json" + "type": "string" }, - "type": "array" - } - }, - "type": "object" - }, - "LegacyVariation": { - "properties": { - "alternateBases": { - "description": "Alternate bases for this variant (starting from `start`). * Accepted values: IUPAC codes for nucleotides (e.g. `https://www.bioinformatics.org/sms/iupac.html`). N is a wildcard, that denotes the position of any base, and can beused as a standalone base of any type or within a partially knownsequence. As example, a query of `ANNT` the Ns can take take any form of[ACGT] and will match `ANNT`, `ACNT`, `ACCT`, `ACGT` ... and so forth.* an *empty value* is used in the case of deletions with the maximally trimmed, deleted sequence being indicated in `ReferenceBases`* Categorical variant queries, e.g. such *not* being represented through sequence & position, make use of the `variantType` parameter. * Either `alternateBases` or `variantType` is required.", "examples": [ - "T", - "G", - "N", - "AG", - "" - ], - "pattern": "^([ACGTUNRYSWKMBDHV\\-\\.]*)$", - "type": "string" - }, - "location": { - "$ref": "https://raw.githubusercontent.com/ga4gh/vrs/1.2/schema/vrs.json#/definitions/Location" + [ + "NC 000023.10(NM004006.2):c.357+1G" + ] + ] }, - "referenceBases": { - "description": "Reference bases for this variant (starting from `start`). * Accepted values: IUPAC codes for nucleotides (e.g. `https://www.bioinformatics.org/sms/iupac.html`). N is a wildcard, that denotes the position of any base, and can be used as a standalone base of any type or within a partially known sequence. As example, a query of `ANNT` the Ns can take take any form of `[ACGT]` and will match `ANNT`, `ACNT`, `ACCT`, `ACGT` ... and so forth. * an *empty value* is used in the case of insertions with the maximally trimmed, inserted sequence being indicated in `AlternateBases`. NOTE: Many Beacon instances could not support UIPAC codes and it is not mandatory for them to do so. In such cases the use of [ACGTN] is mandated.", + "proteinHGVSIds": { + "description": "List of HGVSId descriptor(s) at protein level (for protein-altering variants).", + "type": "array", + "items": { + "type": "string" + }, "examples": [ - "A", - "T", - "N", - "", - "ACG" - ], - "pattern": "^([ACGTUNRYSWKMBDHV\\-\\.]*)$", - "type": "string" + [ + "NP_009225.1:p.Glu1817Ter" + ], + [ + "LRG 199p1:p.Val25Gly (preferred)" + ] + ] }, - "variantType": { - "default": "SNP", - "description": "The `variantType` declares the nature of the variation in relation to a reference. In a response, it is used to describe the variation. In a request, it is used to declare the type of event the Beacon client is looking for. If in queries variants can not be defined through a sequence of one or more bases (`precise` variants) it can be used standalone (i.e. without `alternateBases`) together with positional parameters. Examples here are e.g. queries for structural variants such as `DUP` (increased allelic count of material from the genomic region between `start` and `end` positions without assumption about the placement of the additional sequence) or `DEL` (deletion of sequence following `start`). Either `alternateBases` or `variantType` is required, with the exception of range queries (single `start` and `end` parameters).", + "clinvarVariantId": { + "description": "ClinVar variant id. Other id values used by ClinVar can be added to `variantAlternativeIds`", + "pattern": "^(clinvar:)?\\d+$", + "type": "string", "examples": [ - "SNP", - "DEL", - "DUP", - "BND" - ], - "type": "string" + "clinvar:12345", + "9325" + ] } - }, - "required": [ - "variantType", - "alternateBases", - "location" - ], - "type": "object" + } }, "MolecularAttributes": { + "type": "object", "properties": { - "aminoacidChanges": { - "description": "Lisf of change(s) at aminoacid level for protein affecting variants.", - "examples": [ - [ - "V304*" - ] - ], + "geneIds": { + "type": "array", "items": { "type": "string" }, - "type": "array" - }, - "geneIds": { "examples": [ [ "ACE2" @@ -329,21 +197,21 @@ [ "BRCA1" ] - ], - "items": { - "type": "string" - }, - "type": "array" + ] }, "genomicFeatures": { "description": "List of Genomic feature(s) affected by the variant.", + "type": "array", "items": { "$ref": "#/definitions/GenomicFeature" - }, - "type": "array" + } }, "molecularEffects": { "description": "Ontology term that includes describes the class of molecular consequence generated by the variant. Values from Ensembl Glossary Variant Consequence (ENSGLOSSARY:0000134 ontology branch) are recommended, e.g. Stop gained, Missense variant, Coding sequence variant.", + "type": "array", + "items": { + "$ref": "../common/ontologyTerm.json" + }, "examples": [ { "id": "ENSGLOSSARY:0000143", @@ -353,58 +221,80 @@ "id": "ENSGLOSSARY:0000150", "label": "Missense variant" } - ], + ] + }, + "aminoacidChanges": { + "description": "Lisf of change(s) at aminoacid level for protein affecting variants.", + "type": "array", "items": { - "$ref": "../common/ontologyTerm.json" + "type": "string" }, - "type": "array" + "examples": [ + [ + "V304*" + ] + ] } - }, - "type": "object" + } }, - "PhenoClinicEffect": { - "description": "List of annotated effects on disease or phenotypes.", + "GenomicFeature": { + "description": "Genomic feature(s) related to the variant. NOTE: Although genes could also be referenced using these attributes, they have an independent section to allow direct queries.", + "type": "object", "properties": { - "annotatedWith": { - "$ref": "#/definitions/SoftwareTool" - }, - "category": { + "featureClass": { + "description": "Ontology term that describes the class of genomic feature affected by the variant. Values from Ensembl Glossary (ENSGLOSSARY ontology) are recommended, e.g. protein coding gene, non-coding RNA, long non-coding RNA. ", "$ref": "../common/ontologyTerm.json", - "description": "Ontology term for the type of disease, condition, phenotypic measurement, etc. ", "examples": [ { - "id": "MONDO:0000001", - "label": "disease or disorder" - }, - { - "id": "HP:0000118", - "label": "phenotypic abnormality" + "id": "ENSGLOSSARY:0000158", + "label": "5 prime UTR variant" } ] }, - "clinicalRelevance": { - "description": "A value from the five-tiered classification from the American College of Medical Genetics (ACMG) designed to describe the likelihood that a genomic sequence variant is causative of an inherited disease. (NCIT:C168798).", - "enum": [ - "benign", - "likely benign", - "uncertain significance", - "likely pathogenic", - "pathogenic" - ], - "example": "pathogenic", - "type": "string" - }, + "featureID": { + "description": "Where applicable, ID/accession/name of genomic feature related to the `featureClass`. Preferably in CURIE format. If the value is a gene id or name, it points to the gene related to the `featureClass`, e.g. `the 5 prime UTR upstream of TP53`", + "$ref": "../common/ontologyTerm.json", + "examples": [ + { + "id": "HGNC:11998", + "label": "TP53" + } + ] + } + }, + "required": [ + "featureClass" + ] + }, + "PhenoClinicEffect": { + "description": "List of annotated effects on disease or phenotypes.", + "type": "object", + "properties": { "conditionId": { "description": "Internal identifier of the phenotype or clinical effect.", + "type": "string", "examples": [ "disease1", "phen2234" - ], - "type": "string" + ] + }, + "category": { + "description": "Ontology term for the type of disease, condition, phenotypic measurement, etc. ", + "$ref": "../common/ontologyTerm.json", + "examples": [ + { + "id": "MONDO:0000001", + "label": "disease or disorder" + }, + { + "id": "HP:0000118", + "label": "phenotypic abnormality" + } + ] }, "effect": { - "$ref": "../common/ontologyTerm.json", "description": "Ontology term for the phenotypic or clinical effect. ", + "$ref": "../common/ontologyTerm.json", "examples": [ { "id": "MONDO:0003582", @@ -416,9 +306,21 @@ } ] }, + "clinicalRelevance": { + "description": "A value from the five-tiered classification from the American College of Medical Genetics (ACMG) designed to describe the likelihood that a genomic sequence variant is causative of an inherited disease. (NCIT:C168798).", + "type": "string", + "enum": [ + "benign", + "likely benign", + "uncertain significance", + "likely pathogenic", + "pathogenic" + ], + "example": "pathogenic" + }, "evidenceType": { - "$ref": "../common/ontologyTerm.json", "description": "Ontology term for the type of evidence supporting variant-disease association from the Evidence & Conclusion Ontology (ECO). ", + "$ref": "../common/ontologyTerm.json", "examples": [ { "id": "ECO:0000361", @@ -429,148 +331,246 @@ "label": "experimental evidence" } ] + }, + "annotatedWith": { + "$ref": "#/definitions/SoftwareTool" } }, "required": [ "conditionId", "effect" - ], - "type": "object" + ] }, - "PopulationFrequency": { + "FrequencyInPopulations": { + "type": "object", "properties": { - "alleleFrequency": { - "description": "Allele frequency between 0 and 1.", + "source": { + "type": "string", + "description": "The study", "examples": [ - 3.186e-05 - ], - "type": "number" + "The Genome Aggregation Database (gnomAD)", + "The European Genome-phenome Archive (EGA)" + ] + }, + "sourceReference": { + "type": "string", + "description": "A reference to further documentation or details.", + "examples": [ + "https://gnomad.broadinstitute.org/", + "https://ega-archive.org/" + ] + }, + "version": { + "type": "string", + "description": "version of the source data.", + "examples": [ + "gnomAD v3.1.1" + ] }, + "frequencies": { + "type": "array", + "items": { + "$ref": "#/definitions/PopulationFrequency" + }, + "minItems": 1 + } + }, + "required": [ + "source", + "sourceReference", + "frequencies" + ] + }, + "PopulationFrequency": { + "type": "object", + "properties": { "population": { + "type": "string", "description": "A name for the population. A population could an ethnic, geographical one or just the `members`of a study.", "examples": [ "East Asian", "ICGC Chronic Lymphocytic Leukemia-ES", "Men", "Children" - ], - "type": "string" + ] + }, + "alleleFrequency": { + "type": "number", + "description": "Allele frequency between 0 and 1.", + "examples": [ + 3.186e-05 + ] } }, "required": [ "population", "alleleFrequency" - ], - "type": "object" + ] }, - "SoftwareTool": { + "CaseLevelVariant": { + "type": "object", + "description": "", "properties": { - "toolName": { - "description": "Name of the tool.", + "id": { + "description": "Internal id of this case level *instance* of the variant. This is an optional housekeeping parameter and should not be confused with the identifier of the variant (`variantInternalId`).", + "type": "string", "examples": [ - "Ensembl Variant Effect Predictor (VEP)" - ], - "type": "string" + "id0001-var101101118" + ] }, - "toolReferences": { - "additionalProperties": true, - "description": "References to the tool", + "individualId": { + "description": "Reference to individual ID (`individual.id`)", + "type": "string", + "examples": [ + "ind0001" + ] + }, + "biosampleId": { + "description": "Reference to biosample ID (`biosample.id`)", + "type": "string", + "examples": [ + "bs001104" + ] + }, + "analysisId": { + "description": "Reference to the bioinformatics analysis ID (`analysis.id`)", + "type": "string", + "examples": [ + "pgxcs-kftvldsu" + ] + }, + "runId": { + "description": "Reference to the experimental run ID (`run.id`)", + "type": "string", + "examples": [ + "SRR10903401" + ] + }, + "zygosity": { + "description": "Ontology term for zygosity in which variant is present in the sample from the Zygosity Ontology (GENO:0000391) , e.g `heterozygous` (GENO:0000135)", + "$ref": "../common/ontologyTerm.json", "examples": [ { - "bio.toolsId": "https://bio.tools/vep" + "id": "GENO:0000135", + "label": "heterozygous" }, { - "url": "http://www.ensembl.org/vep" + "id": "GENO:0000136", + "label": "homozygous" + }, + { + "id": "GENO:0000604", + "label": "hemizygous X-linked" } - ], - "minProperties": 1, - "properties": {}, - "type": "object" + ] }, - "version": { - "description": "Version used.", + "alleleOrigin": { + "description": "Ontology value for allele origin of variant in sample from the Variant Origin (SO:0001762). Categories are `somatic variant`, `germline variant`, `maternal variant`, `paternal variant`, `de novo variant`, `pedigree specific variant`, `population specific variant`. Corresponds to Variant Inheritance in FHIR.", + "$ref": "../common/ontologyTerm.json", "examples": [ - "rel 104" - ], - "type": "string" + { + "id": "SO:0001777", + "label": "somatic variant" + }, + { + "id": "SO:0001778", + "label": "germline variant" + }, + { + "id": "SO:0001775", + "label": "maternal variant" + }, + { + "id": "SO:0001776", + "label": "paternal variant" + }, + { + "id": "SO:0001781", + "label": "de novo variant" + }, + { + "id": "SO:0001779", + "label": "pedigree specific variant" + }, + { + "id": "SO:0001780", + "label": "population specific variant" + } + ] + }, + "clinicalInterpretations": { + "type": "array", + "items": { + "$ref": "#/definitions/PhenoClinicEffect" + } + }, + "phenotypicEffects": { + "type": "array", + "items": { + "$ref": "#/definitions/PhenoClinicEffect" + } } }, "required": [ - "toolName", - "version", - "toolReferences" - ], - "type": "object" + "biosampleId" + ] }, "VariantLevelData": { + "type": "object", "properties": { "clinicalInterpretations": { + "type": "array", "items": { "$ref": "#/definitions/PhenoClinicEffect" - }, - "type": "array" + } }, "phenotypicEffects": { + "type": "array", "items": { "$ref": "#/definitions/PhenoClinicEffect" - }, - "type": "array" + } } - }, - "type": "object" - } - }, - "description": "Schema for a genomic variant entry.", - "properties": { - "caseLevelData": { - "description": "caseLevelData reports about the variation instances observed in individual analyses.", - "items": { - "$ref": "#/definitions/CaseLevelVariant" - }, - "type": "array" - }, - "frequencyInPopulations": { - "items": { - "$ref": "#/definitions/FrequencyInPopulations" - }, - "type": "array" - }, - "identifiers": { - "$ref": "#/definitions/Identifiers" - }, - "molecularAttributes": { - "$ref": "#/definitions/MolecularAttributes" - }, - "variantInternalId": { - "description": "Reference to the **internal** variant ID. This represents the primary key/identifier of that variant **inside** a given Beacon instance. Different Beacon instances may use identical id values, referring to unrelated variants. Public identifiers such as the GA4GH Variant Representation Id (VRSid) MUST be returned in the `identifiers` section. A Beacon instance can, of course, use the VRSid as their own internal id but still MUST represent this then in the `identifiers` section.", - "examples": [ - "var00001", - "v110112" - ], - "type": "string" - }, - "variantLevelData": { - "$ref": "#/definitions/VariantLevelData" + } }, - "variation": { - "description": "The schema to describe the genomic variation.\n#### Source\n\n * https://raw.githubusercontent.com/ga4gh/vrs/1.3/schema/vrs.json#/definitions/MolecularVariation\n * https://raw.githubusercontent.com/ga4gh/vrs/1.3/schema/vrs.json#/definitions/SystemicVariation", - "oneOf": [ - { - "$ref": "../common/VRSallele.json" + "SoftwareTool": { + "type": "object", + "properties": { + "toolName": { + "description": "Name of the tool.", + "type": "string", + "examples": [ + "Ensembl Variant Effect Predictor (VEP)" + ] }, - { - "$ref": "../common/VRScopyNumberChange.json" + "version": { + "description": "Version used.", + "type": "string", + "examples": [ + "rel 104" + ] }, - { - "$ref": "#/definitions/LegacyVariation" + "toolReferences": { + "description": "References to the tool", + "type": "object", + "properties": {}, + "additionalProperties": true, + "examples": [ + { + "bio.toolsId": "https://bio.tools/vep" + }, + { + "url": "http://www.ensembl.org/vep" + } + ], + "minProperties": 1 } + }, + "required": [ + "toolName", + "version", + "toolReferences" ] } }, - "required": [ - "variantInternalId", - "variation" - ], - "title": "Genomic Variation", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/genomicVariations/endpoints.json b/bycon/schemas/models/json/progenetix-model/genomicVariations/endpoints.json index 225e4e7de..7334566ff 100644 --- a/bycon/schemas/models/json/progenetix-model/genomicVariations/endpoints.json +++ b/bycon/schemas/models/json/progenetix-model/genomicVariations/endpoints.json @@ -1,200 +1,21 @@ { - "components": { - "parameters": { - "alternateBases": { - "in": "query", - "name": "alternateBases", - "schema": { - "type": "string" - } - }, - "aminoacidChange": { - "example": "V600E", - "in": "query", - "name": "aminoacidchange", - "schema": { - "type": "string" - } - }, - "assemblyId": { - "in": "query", - "name": "assemblyId", - "schema": { - "type": "string" - } - }, - "end": { - "in": "query", - "name": "end", - "schema": { - "items": { - "format": "int64", - "minimum": 0, - "type": "integer" - }, - "maxItems": 2, - "minItems": 0, - "type": "array" - } - }, - "entryId": { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - "filters": { - "in": "query", - "name": "filters", - "schema": { - "examples": [ - [ - "EFO:0009655" - ], - [ - "NCIT:C48725", - "NCIT:C28080" - ] - ], - "items": { - "type": "string" - }, - "type": "array" - } - }, - "geneId": { - "example": "BRAF", - "in": "query", - "name": "geneid", - "schema": { - "type": "string" - } - }, - "genomicAlleleShortForm": { - "example": "NM_004006.2:c.4375C>T", - "in": "query", - "name": "allele", - "schema": { - "type": "string" - } - }, - "includeResultsetResponses": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" - }, - "limit": { - "in": "query", - "name": "limit", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" - } - }, - "referenceBases": { - "in": "query", - "name": "referenceBases", - "schema": { - "type": "string" - } - }, - "referenceName": { - "in": "query", - "name": "referenceName", - "schema": { - "type": "string" - } - }, - "requestedSchema": { - "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", - "example": "ga4gh-service-info-v1.0", - "in": "query", - "name": "requestedSchema", - "required": false, - "schema": { - "type": "string" - } - }, - "skip": { - "in": "query", - "name": "skip", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" - } - }, - "start": { - "in": "query", - "name": "start", - "schema": { - "items": { - "format": "int64", - "minimum": 0, - "type": "integer" - }, - "maxItems": 2, - "minItems": 1, - "type": "array" - } - }, - "variantMaxLength": { - "in": "query", - "name": "variantMaxLength", - "schema": { - "format": "int64", - "minimum": 0, - "type": "integer" - } - }, - "variantMinLength": { - "in": "query", - "name": "variantMinLength", - "schema": { - "format": "int64", - "minimum": 0, - "type": "integer" - } - } - }, - "responses": { - "ResultsOKResponse": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" - } - ] - } - } - }, - "description": "Successful operation." - } - } - }, + "openapi": "3.0.2", + "servers": [], "info": { + "version": "2.0.0", + "title": "GA4GH Beacon API Specification - Genomic Variations Endpoints", + "description": "TBD", "contact": { "email": "beacon@ga4gh.org" }, - "description": "TBD", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "title": "GA4GH Beacon API Specification - Genomic Variations Endpoints", - "version": "2.0.0" + } }, - "openapi": "3.0.2", "paths": { "/g_variants": { "get": { - "description": "Get a list of example entries", - "operationId": "getExampleEntries", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -245,6 +66,11 @@ "$ref": "#/components/parameters/filters" } ], + "description": "Get a list of example entries", + "operationId": "getExampleEntries", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" @@ -252,14 +78,14 @@ "default": { "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] + } }, "post": { "description": "Get a list of example entries", "operationId": "postExampleEntriesRequest", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -275,40 +101,40 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, "/g_variants/{id}": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { "description": "Get details about one genomic variation, identified by its (unique) 'id'", "operationId": "getOneGenomicVariation", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { "description": "Get details about one genomic variation, identified by its (unique) 'id'", "operationId": "postOneGenomicVariation", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -324,19 +150,19 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, "/g_variants/{id}/biosamples": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the biosamples list from one genomic variant, identified by its (unique) 'id'", - "operationId": "getOneGenomicVariantBiosamples", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -348,27 +174,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the biosamples list from one genomic variant, identified by its (unique) 'id'", + "operationId": "getOneGenomicVariantBiosamples", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { "description": "Get the biosamples list from one genomic variant, identified by its (unique) 'id'", "operationId": "postOneGenomicVariantBiosamples", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -384,19 +210,19 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, "/g_variants/{id}/individuals": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the individuals list from one genomic variant, identified by its (unique) 'id'", - "operationId": "getOneGenomicVariantIndividuals", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -408,27 +234,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the individuals list from one genomic variant, identified by its (unique) 'id'", + "operationId": "getOneGenomicVariantIndividuals", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { "description": "Get the biosamples list from one genomic variant, identified by its (unique) 'id'", "operationId": "postOneGenomicVariantIndividuals", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -444,15 +270,189 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } } }, - "servers": [] + "components": { + "responses": { + "ResultsOKResponse": { + "description": "Successful operation.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" + } + ] + } + } + } + } + }, + "parameters": { + "requestedSchema": { + "name": "requestedSchema", + "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "example": "ga4gh-service-info-v1.0" + }, + "skip": { + "name": "skip", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" + } + }, + "limit": { + "name": "limit", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" + } + }, + "includeResultsetResponses": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" + }, + "entryId": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "start": { + "name": "start", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "minItems": 1, + "maxItems": 2 + } + }, + "end": { + "name": "end", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "minItems": 0, + "maxItems": 2 + } + }, + "assemblyId": { + "name": "assemblyId", + "in": "query", + "schema": { + "type": "string" + } + }, + "referenceName": { + "name": "referenceName", + "in": "query", + "schema": { + "type": "string" + } + }, + "referenceBases": { + "name": "referenceBases", + "in": "query", + "schema": { + "type": "string" + } + }, + "alternateBases": { + "name": "alternateBases", + "in": "query", + "schema": { + "type": "string" + } + }, + "variantMinLength": { + "name": "variantMinLength", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 0 + } + }, + "variantMaxLength": { + "name": "variantMaxLength", + "in": "query", + "schema": { + "type": "integer", + "format": "int64", + "minimum": 0 + } + }, + "genomicAlleleShortForm": { + "name": "allele", + "in": "query", + "schema": { + "type": "string" + }, + "example": "NM_004006.2:c.4375C>T" + }, + "geneId": { + "name": "geneid", + "in": "query", + "schema": { + "type": "string" + }, + "example": "BRAF" + }, + "aminoacidChange": { + "name": "aminoacidchange", + "in": "query", + "schema": { + "type": "string" + }, + "example": "V600E" + }, + "filters": { + "name": "filters", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "EFO:0009655" + ], + [ + "NCIT:C48725", + "NCIT:C28080" + ] + ] + } + } + } + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/genomicVariations/examples/genomicVariant-MID-example.json b/bycon/schemas/models/json/progenetix-model/genomicVariations/examples/genomicVariant-MID-example.json index 1322d2192..4c6b7c004 100644 --- a/bycon/schemas/models/json/progenetix-model/genomicVariations/examples/genomicVariant-MID-example.json +++ b/bycon/schemas/models/json/progenetix-model/genomicVariations/examples/genomicVariant-MID-example.json @@ -1,62 +1,44 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "frequencyInPopulations": [ - { - "frequencies": [ - { - "alleleFrequency": 2.939e-05, - "population": "European (non-Finish)" - }, - { - "alleleFrequency": 0, - "population": "Other" - } - ], - "source": "gnomaD Genomes", - "sourceReference": "https://gnomad.broadinstitute.org/", - "version": "v3.1.1" - }, - { - "frequencies": [ - { - "alleleFrequency": 9e-05, - "population": "Total" - }, - { - "alleleFrequency": 6e-05, - "population": "European" + "variantInternalId": "var123", + "variation": { + "variantType": "SNP", + "referenceBases": "G", + "alternateBases": "A", + "location": { + "type": "SequenceLocation", + "interval": { + "type": "SequenceInterval", + "start": { + "type": "Number", + "value": 55039979 }, - { - "alleleFrequency": 0, - "population": "African" + "end": { + "type": "Number", + "value": 55039980 } - ], - "source": "ALFA", - "sourceReference": "https://www.ncbi.nlm.nih.gov/snp/docs/gsr/alfa/", - "version": "20201027095038" + }, + "sequence_id": "refseq:NC_000001.11" } - ], + }, "identifiers": { - "clinVarIds": [ - "434136", - "VCV000440707.6" + "variantAlternativeIds": [ + "dbSNP:rs3975092470", + "ClinGen: CA340482854" ], "genomicHGVSId": "NC_000001.11:g.55039979G>A", - "proteinHGVSIds": [ - "NP_777596.2:p.Glu48Lys" - ], "transcriptHGVSIds": [ "NM_174936.4:c.142G>A" ], - "variantAlternativeIds": [ - "dbSNP:rs3975092470", - "ClinGen: CA340482854" + "proteinHGVSIds": [ + "NP_777596.2:p.Glu48Lys" + ], + "clinVarIds": [ + "434136", + "VCV000440707.6" ] }, "molecularAttributes": { - "aminoacidChanges": [ - "E48K" - ], "geneIds": [ "PCSK9", "LRG_275" @@ -66,55 +48,73 @@ "id": "ENSGLOSSARY:0000150", "label": "Missense variant" } + ], + "aminoacidChanges": [ + "E48K" ] }, - "variantInternalId": "var123", "variantLevelData": { "clinicalInterpretations": [ { + "conditionId": "famchol1", "category": { "id": "MONDO:0000001", "label": "disease or disorder" }, - "clinicalRelevance": "pathogenic", - "conditionId": "famchol1", "effect": { "id": "MONDO:0007750", "label": "Familial hypercholesterolemia 1" - } + }, + "clinicalRelevance": "pathogenic" }, { + "conditionId": "famchol3", "category": { "id": "MONDO:0000001", "label": "disease or disorder" }, - "clinicalRelevance": "uncertain significance", - "conditionId": "famchol3", "effect": { "id": "MONDO:0011369", "label": "hypercholesterolemia, autosomal dominant, 3" - } + }, + "clinicalRelevance": "uncertain significance" } ] }, - "variation": { - "alternateBases": "A", - "location": { - "interval": { - "end": { - "type": "Number", - "value": 55039980 - }, - "start": { - "type": "Number", - "value": 55039979 + "frequencyInPopulations": [ + { + "source": "gnomaD Genomes", + "sourceReference": "https://gnomad.broadinstitute.org/", + "version": "v3.1.1", + "frequencies": [ + { + "population": "European (non-Finish)", + "alleleFrequency": 2.939e-05 }, - "type": "SequenceInterval" - }, - "sequence_id": "refseq:NC_000001.11", - "type": "SequenceLocation" + { + "population": "Other", + "alleleFrequency": 0 + } + ] }, - "referenceBases": "G", - "variantType": "SNP" - } + { + "source": "ALFA", + "sourceReference": "https://www.ncbi.nlm.nih.gov/snp/docs/gsr/alfa/", + "version": "20201027095038", + "frequencies": [ + { + "population": "Total", + "alleleFrequency": "9e-05" + }, + { + "population": "European", + "alleleFrequency": "6e-05" + }, + { + "population": "African", + "alleleFrequency": 0 + } + ] + } + ] } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/genomicVariations/examples/genomicVariant-MIN-VRS-example.json b/bycon/schemas/models/json/progenetix-model/genomicVariations/examples/genomicVariant-MIN-VRS-example.json index 2c606f739..b772e3455 100644 --- a/bycon/schemas/models/json/progenetix-model/genomicVariations/examples/genomicVariant-MIN-VRS-example.json +++ b/bycon/schemas/models/json/progenetix-model/genomicVariations/examples/genomicVariant-MIN-VRS-example.json @@ -2,25 +2,25 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "variantInternalId": "GRCh37-1-55505652-G-A", "variation": { + "state": { + "sequence": "A", + "type": "SequenceState" + }, + "type": "Allele", "location": { + "type": "SequenceLocation", "interval": { - "end": { - "type": "Number", - "value": 5505653 - }, + "type": "SequenceInterval", "start": { "type": "Number", "value": 5505652 }, - "type": "SequenceInterval" + "end": { + "type": "Number", + "value": 5505653 + } }, - "sequence_id": "refseq:NC_000001.10", - "type": "SequenceLocation" - }, - "state": { - "sequence": "A", - "type": "SequenceState" - }, - "type": "Allele" + "sequence_id": "refseq:NC_000001.10" + } } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/genomicVariations/examples/genomicVariant-MIN-example.json b/bycon/schemas/models/json/progenetix-model/genomicVariations/examples/genomicVariant-MIN-example.json index db0221335..ef57e18a7 100644 --- a/bycon/schemas/models/json/progenetix-model/genomicVariations/examples/genomicVariant-MIN-example.json +++ b/bycon/schemas/models/json/progenetix-model/genomicVariations/examples/genomicVariant-MIN-example.json @@ -2,22 +2,22 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "variantInternalId": "GRCh37-1-55505652-G-A", "variation": { + "variantType": "SNP", "alternateBases": "A", "location": { + "type": "SequenceLocation", "interval": { - "end": { - "type": "Number", - "value": 5505653 - }, + "type": "SequenceInterval", "start": { "type": "Number", "value": 5505652 }, - "type": "SequenceInterval" + "end": { + "type": "Number", + "value": 5505653 + } }, - "sequence_id": "refseq:NC_000001.10", - "type": "SequenceLocation" - }, - "variantType": "SNP" + "sequence_id": "refseq:NC_000001.10" + } } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/genomicVariations/requestParameters.json b/bycon/schemas/models/json/progenetix-model/genomicVariations/requestParameters.json index e322b6bb1..e86f32af3 100644 --- a/bycon/schemas/models/json/progenetix-model/genomicVariations/requestParameters.json +++ b/bycon/schemas/models/json/progenetix-model/genomicVariations/requestParameters.json @@ -1,94 +1,94 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Genomic Variations Request Parameters", "description": "The request parameters schemas define the parameters used in query documents against a given entity.", + "type": "object", "properties": { "g_variant": { + "type": "object", "properties": { - "alternateBases": { - "$ref": "./requestParametersComponents.json#/definitions/AlternateBases" - }, - "aminoacidChange": { - "description": "Aminoacid alteration in 1 letter format", - "examples": [ - "V600E", - "M734V" - ], - "type": "string" + "variantInternalId": { + "description": "An id value used for all variant instances of the same composition. In Progenetix this is used to aggregate all the instances of \"caseLevelData\" variants.", + "type": "string", + "pattern": "^\\w[\\w\\:\\-\\,]+?\\w$" }, "assemblyId": { "$ref": "./requestParametersComponents.json#/definitions/Assembly" }, + "referenceName": { + "$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`", + "type": "array", + "items": { + "type": "integer", + "format": "int64", + "minimum": 0 + }, + "minItems": 1, + "maxItems": 2 + }, "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]).\"", + "type": "array", "items": { + "type": "integer", "format": "int64", - "minimum": 1, - "type": "integer" + "minimum": 1 }, - "maxItems": 2, "minItems": 0, - "type": "array" - }, - "geneId": { - "description": "* A gene identifier * It is strongly suggested to use a symbol following\n the HGNC (https://www.genenames.org) nomenclature.", - "examples": [ - "BRAF", - "SCN5A" - ], - "type": "string" - }, - "genomicAlleleShortForm": { - "description": "Genomic HGVSId descriptor.", - "examples": [ - "NM_004006.2:c.4375C>T" - ], - "type": "string" - }, - "mateName": { - "$ref": "./requestParametersComponents.json#/definitions/RefSeqId" + "maxItems": 2 }, "referenceBases": { "$ref": "./requestParametersComponents.json#/definitions/ReferenceBases" }, - "referenceName": { - "$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`", - "items": { - "format": "int64", - "minimum": 0, - "type": "integer" - }, - "maxItems": 2, - "minItems": 1, - "type": "array" + "alternateBases": { + "$ref": "./requestParametersComponents.json#/definitions/AlternateBases" }, - "variantInternalId": { - "description": "An id value used for all variant instances of the same composition. In Progenetix this is used to aggregate all the instances of \"caseLevelData\" variants.", - "pattern": "^\\w[\\w\\:\\-\\,]+?\\w$", + "variantType": { + "description": "The `variantType` is used to query variants which are not defined through a sequence of one or more bases using the `alternateBases` parameter. Examples here are e.g. structural variants: * DUP\n - increased allelic count of material from the genomic region between\n `start` and `end` positions\n - no assumption about the placement of the additional sequences is being\n made (i.e. no _in situ_ requirement as tandem duplications)\n* DEL: deletion of sequence following `start` * BND: breakend, i.e. termination of the allele at position `start` or in\n the `startMin` => `startMax` interval, or fusion of the sequence to distant\n partner\nEither `alternateBases` or `variantType` is required, with the exception of range queries (single\\ `start` and `end` parameters).", "type": "string" }, + "variantMinLength": { + "description": "* Minimum length in bases of a genomic variant * This is an optional parameter without prescribed use. While a length is\n commonly available for structural variants such as copy number variations,\n it is recommended that length based queries should also be supported for\n variants with indicated referenceBases and alternateBases, to enable\n length-specific wildcard queries.", + "type": "integer", + "format": "int64", + "minimum": 0 + }, "variantMaxLength": { "description": "* Maximum length in bases of a genomic variant. * This is an optional parameter without prescribed use. While a length is\n commonly available for structural variants such as copy number variations,\n it is recommended that length based queries should also be supported for\n variants with indicated referenceBases and alternateBases, to enable\n length-specific wildcard queries.", + "type": "integer", "format": "int64", - "minimum": 1, - "type": "integer" + "minimum": 1 }, - "variantMinLength": { - "description": "* Minimum length in bases of a genomic variant * This is an optional parameter without prescribed use. While a length is\n commonly available for structural variants such as copy number variations,\n it is recommended that length based queries should also be supported for\n variants with indicated referenceBases and alternateBases, to enable\n length-specific wildcard queries.", - "format": "int64", - "minimum": 0, - "type": "integer" + "mateName": { + "$ref": "./requestParametersComponents.json#/definitions/RefSeqId" }, - "variantType": { - "description": "The `variantType` is used to query variants which are not defined through a sequence of one or more bases using the `alternateBases` parameter. Examples here are e.g. structural variants: * DUP\n - increased allelic count of material from the genomic region between\n `start` and `end` positions\n - no assumption about the placement of the additional sequences is being\n made (i.e. no _in situ_ requirement as tandem duplications)\n* DEL: deletion of sequence following `start` * BND: breakend, i.e. termination of the allele at position `start` or in\n the `startMin` => `startMax` interval, or fusion of the sequence to distant\n partner\nEither `alternateBases` or `variantType` is required, with the exception of range queries (single\\ `start` and `end` parameters).", - "type": "string" + "geneId": { + "description": "* A gene identifier * It is strongly suggested to use a symbol following\n the HGNC (https://www.genenames.org) nomenclature.", + "type": "string", + "examples": [ + "BRAF", + "SCN5A" + ] + }, + "aminoacidChange": { + "description": "Aminoacid alteration in 1 letter format", + "type": "string", + "examples": [ + "V600E", + "M734V" + ] + }, + "genomicAlleleShortForm": { + "description": "Genomic HGVSId descriptor.", + "type": "string", + "examples": [ + "NM_004006.2:c.4375C>T" + ] } - }, - "type": "object" + } } - }, - "title": "Genomic Variations Request Parameters", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/genomicVariations/requestParametersComponents.json b/bycon/schemas/models/json/progenetix-model/genomicVariations/requestParametersComponents.json index 9ae39713a..b007a9842 100644 --- a/bycon/schemas/models/json/progenetix-model/genomicVariations/requestParametersComponents.json +++ b/bycon/schemas/models/json/progenetix-model/genomicVariations/requestParametersComponents.json @@ -1,34 +1,34 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "description": "Component definitions used in 'requestParameters.json'.\nThe purpose of this file is to separate components from actual parameters to avoid confusion.", "definitions": { - "AlternateBases": { - "description": "Alternate bases for this variant (starting from `start`). * Accepted values: [ACGTN] * N is a wildcard, that denotes the position of any base and can be used as\n a standalone base of any type or within a partially known sequence. As example,\n a query of `ANNT` the Ns can take take any form of [ACGT] and will match\n `ANNT`, `ACNT`, `ACCT`, `ACGT` ... and so forth.\n* an _empty value_ is used in the case of deletions with the maximally\n trimmed, deleted sequence being indicated in `ReferenceBases`\n* Categorical variant queries, _i.e._ such *not* being represented through\n sequence & position, make use of the `variantType` parameter.\n* Either `alternateBases` or `variantType` is required.", - "pattern": "^([ACGTUNRYSWKMBDHV\\-\\.]*)$", - "type": "string" - }, "Assembly": { "description": "Genomic assembly accession and version as RefSqeq assembly accession (e.g. \"GCF_000001405.39\") or a versioned assembly name or synonym such as UCSC Genome Browser assembly (e.g. \"hg38\") or Genome Reference Consortium Human (e.g. \"GRCh38.p13\") names.", + "type": "string", "example": [ "GCF_000001405.39", "hg38", "GRCh38.p13" - ], - "type": "string" + ] }, "RefSeqId": { "description": "Reference sequence id for genomic reference sequence in which variant coordinates are given, e.g. \"NC_000009\" for human chromosome 9. Preferably the RefSeqId, alternatively, names, synonymous or aliases e.g. \"Chr9\" could be used.", + "type": "string", "example": [ "NC_000009", "Chr9", "NC_012920.1" - ], - "type": "string" + ] }, "ReferenceBases": { "description": "Reference bases for this variant (starting from `start`). * Accepted values: [ACGTN] * N is a wildcard, that denotes the position of any base,\n and can be used as a standalone base of any type or within a partially known\n sequence. As example, a query of `ANNT` the Ns can take take any form of [ACGT]\n and will match `ANNT`, `ACNT`, `ACCT`, `ACGT` ... and so forth.\n* an *empty value* is used in the case of insertions with the maximally trimmed,\n inserted sequence being indicated in `AlternateBases`", - "pattern": "^([ACGTUNRYSWKMBDHV\\-\\.]*)$", - "type": "string" + "type": "string", + "pattern": "^([ACGTUNRYSWKMBDHV\\-\\.]*)$" + }, + "AlternateBases": { + "description": "Alternate bases for this variant (starting from `start`). * Accepted values: [ACGTN] * N is a wildcard, that denotes the position of any base and can be used as\n a standalone base of any type or within a partially known sequence. As example,\n a query of `ANNT` the Ns can take take any form of [ACGT] and will match\n `ANNT`, `ACNT`, `ACCT`, `ACGT` ... and so forth.\n* an _empty value_ is used in the case of deletions with the maximally\n trimmed, deleted sequence being indicated in `ReferenceBases`\n* Categorical variant queries, _i.e._ such *not* being represented through\n sequence & position, make use of the `variantType` parameter.\n* Either `alternateBases` or `variantType` is required.", + "type": "string", + "pattern": "^([ACGTUNRYSWKMBDHV\\-\\.]*)$" } - }, - "description": "Component definitions used in 'requestParameters.json'.\nThe purpose of this file is to separate components from actual parameters to avoid confusion." + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/individuals/defaultSchema.json b/bycon/schemas/models/json/progenetix-model/individuals/defaultSchema.json index adb15810a..70d30ca02 100644 --- a/bycon/schemas/models/json/progenetix-model/individuals/defaultSchema.json +++ b/bycon/schemas/models/json/progenetix-model/individuals/defaultSchema.json @@ -1,17 +1,45 @@ { - "$id": "https://progenetix.org/services/schemas/individual/v2023-01-10", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "$id": "https://progenetix.org/services/schemas/individual/v2023-01-10", + "title": "Individual", + "type": "object", + "required": [ + "id", + "sex" + ], "properties": { - "ancestries": { + "id": { + "type": "string", + "description": "The resource-local identifier for this individual.", + "examples": [ + "pgxind-kftx25eh" + ] + }, + "sex": { + "$ref": "../common/commonDefinitions.json#/definitions/Sex" + }, + "ethnicities": { + "$note": "forward-looking in Beacon+ as an array", + "type": "array", "items": { - "$ref": "../common/ancestry.json" - }, - "type": "array" + "$ref": "../common/commonDefinitions.json#/definitions/Ethnicity" + } + }, + "geographicOrigin": { + "$ref": "../common/commonDefinitions.json#/definitions/GeographicLocation" + }, + "indexDisease": { + "$note": "special for Beacon+ instead of diseases", + "description": "This is the main (cancer) disease analyzed by the associated biosample(s).", + "$ref": "../common/disease.json" }, "auxiliaryDiseases": { "$note": "special for Beacon+ instead of diseases", "description": "These are additional diseases, e.g. germline syndromes (\"Li-Fraumeni\" ...).", + "type": "array", + "items": { + "$ref": "../common/disease.json" + }, "examples": [ { "disease_code": { @@ -19,85 +47,57 @@ "label": "Li-Fraumeni Syndrome" } } - ], - "items": { - "$ref": "../common/disease.json" - }, - "type": "array" - }, - "dateOfBirth": { - "examples": [ - "1967-11-11", - "2002-09-21" - ], - "format": "date", - "type": "string" - }, - "description": { - "examples": [ - "HapMap project contributor" - ], - "type": "string" + ] }, - "ethnicities": { - "$note": "forward-looking in Beacon+ as an array", + "pedigrees": { + "type": "array", "items": { - "$ref": "../common/commonDefinitions.json#/definitions/Ethnicity" - }, - "type": "array" + "$ref": "../common/pedigree.json" + } }, - "exposures": { + "phenotypicFeatures": { + "type": "array", "items": { - "$ref": "../common/exposure.json" - }, - "type": "array" + "$ref": "../common/phenotypicFeature.json" + } }, - "externalReferences": { - "examples": [ - { - "description": "HapMap individual", - "id": "biosample:SAME122868" - }, - { - "id": "PMID:9950502" - }, - { - "description": "Prognostic analysis of mantle cell lymphoma genomes", - "id": "geo:GSE13331" - } - ], + "treatments": { + "type": "array", "items": { - "$ref": "../common/externalReference.json" - }, - "type": "array" + "$ref": "../common/treatment.json" + } }, - "geographicOrigin": { - "$ref": "../common/commonDefinitions.json#/definitions/GeographicLocation" + "interventionsOrProcedures": { + "type": "array", + "items": { + "$ref": "../common/procedure.json" + } }, - "id": { - "description": "The resource-local identifier for this individual.", - "examples": [ - "pgxind-kftx25eh" - ], - "type": "string" + "measures": { + "type": "array", + "items": { + "$ref": "../common/measurement.json" + } }, - "indexDisease": { - "$note": "special for Beacon+ instead of diseases", - "$ref": "../common/disease.json", - "description": "This is the main (cancer) disease analyzed by the associated biosample(s)." + "exposures": { + "type": "array", + "items": { + "$ref": "../common/exposure.json" + } }, "info": { "description": "Additional structured data which may not be common across different Beacon instances.", "type": "object" }, - "interventionsOrProcedures": { - "items": { - "$ref": "../common/procedure.json" - }, - "type": "array" + "description": { + "type": "string", + "examples": [ + "HapMap project contributor" + ] }, "karyotypicSex": { "description": "Chromosomal sex of an individual as being used by Phenopackets. Following the definition there.", + "type": "string", "enum": [ "UNKNOWN_KARYOTYPE", "XX", @@ -110,54 +110,54 @@ "XXXX", "XYY", "OTHER_KARYOTYPE" - ], - "type": "string" + ] }, - "measures": { - "items": { - "$ref": "../common/measurement.json" - }, - "type": "array" + "dateOfBirth": { + "type": "string", + "format": "date", + "examples": [ + "1967-11-11", + "2002-09-21" + ] }, - "pedigrees": { + "externalReferences": { + "type": "array", "items": { - "$ref": "../common/pedigree.json" + "$ref": "../common/externalReference.json" }, - "type": "array" + "examples": [ + { + "id": "biosample:SAME122868", + "description": "HapMap individual" + }, + { + "id": "PMID:9950502" + }, + { + "id": "geo:GSE13331", + "description": "Prognostic analysis of mantle cell lymphoma genomes" + } + ] }, - "phenotypicFeatures": { - "items": { - "$ref": "../common/phenotypicFeature.json" - }, - "type": "array" + "vitalStatus": { + "$ref": "../common/vitalStatus.json" }, "provenance": { "$ref": "../common/provenance.json" }, - "sex": { - "$ref": "../common/commonDefinitions.json#/definitions/Sex" - }, - "treatments": { + "ancestries": { + "type": "array", "items": { - "$ref": "../common/treatment.json" - }, - "type": "array" + "$ref": "../common/ancestry.json" + } }, "updated": { + "type": "string", + "format": "date-time", "examples": [ "2020-09-10T17:44:10.170Z" - ], - "format": "date-time", - "type": "string" - }, - "vitalStatus": { - "$ref": "../common/vitalStatus.json" + ] } }, - "required": [ - "id", - "sex" - ], - "title": "Individual", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/individuals/endpoints.json b/bycon/schemas/models/json/progenetix-model/individuals/endpoints.json index e5621919b..fa3ed2aaf 100644 --- a/bycon/schemas/models/json/progenetix-model/individuals/endpoints.json +++ b/bycon/schemas/models/json/progenetix-model/individuals/endpoints.json @@ -1,98 +1,21 @@ { - "components": { - "parameters": { - "entryId": { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - "filters": { - "in": "query", - "name": "filters", - "schema": { - "examples": [ - [ - "NCIT:C20197" - ] - ], - "items": { - "type": "string" - }, - "type": "array" - } - }, - "includeResultsetResponses": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" - }, - "limit": { - "in": "query", - "name": "limit", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" - } - }, - "requestedSchema": { - "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", - "example": "ga4gh-service-info-v1.0", - "in": "query", - "name": "requestedSchema", - "required": false, - "schema": { - "type": "string" - } - }, - "skip": { - "in": "query", - "name": "skip", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" - } - } - }, - "responses": { - "ResultsOKResponse": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" - } - ] - } - } - }, - "description": "Successful operation." - } - } - }, + "openapi": "3.0.2", + "servers": [], "info": { + "version": "2.0.0", + "title": "GA4GH Beacon API Specification - Individuals Endpoints", + "description": "TBD", "contact": { "email": "beacon@ga4gh.org" }, - "description": "TBD", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "title": "GA4GH Beacon API Specification - Individuals Endpoints", - "version": "2.0.0" + } }, - "openapi": "3.0.2", "paths": { "/individuals": { "get": { - "description": "Get a list of individuals", - "operationId": "getIndividuals", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -110,6 +33,11 @@ "$ref": "#/components/parameters/filters" } ], + "description": "Get a list of individuals", + "operationId": "getIndividuals", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" @@ -117,14 +45,14 @@ "default": { "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] + } }, "post": { "description": "Get a list of example entries", "operationId": "postIndividualsRequest", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -140,50 +68,40 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/individuals/filtering_terms": { + "/individuals/{id}": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the list of filtering terms that could be used with individuals.", - "operationId": "getIndivualsFilteringTerms", - "parameters": [ - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/limit" - } + "description": "Get details about one individual, identified by its (unique) 'id'", + "operationId": "getOneIndividual", + "tags": [ + "GET Endpoints" ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" - } - } - }, - "description": "Successful operation" + "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] + } }, "post": { - "description": "Get the list of filtering terms that could be used with individuals.", - "operationId": "postIndividualsFilteringTerms", + "description": "Get details about one Individual, identified by its (unique) 'id'", + "operationId": "postOneIndividual", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -196,50 +114,54 @@ }, "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" - } - } - }, - "description": "Successful operation" + "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/individuals/{id}": { + "/individuals/{id}/g_variants": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get details about one individual, identified by its (unique) 'id'", - "operationId": "getOneIndividual", + "parameters": [ + { + "$ref": "#/components/parameters/requestedSchema" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/limit" + } + ], + "description": "Get the genomic variants list from one individual, identified by its (unique) 'id'", + "operationId": "getOneIndividualGenomicVariants", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get details about one Individual, identified by its (unique) 'id'", - "operationId": "postOneIndividual", + "description": "Get the genomic variants list from one individual, identified by its (unique) 'id'", + "operationId": "potOneIndividualGenomicVariants", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -255,19 +177,19 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, "/individuals/{id}/biosamples": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the biosamples list from one individual, identified by its (unique) 'id'", - "operationId": "getOneIndividualBiosamples", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -279,27 +201,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the biosamples list from one individual, identified by its (unique) 'id'", + "operationId": "getOneIndividualBiosamples", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { "description": "Get the biosamples list from one individual, identified by its (unique) 'id'", "operationId": "postOneIndividualBiosamples", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -315,23 +237,15 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/individuals/{id}/g_variants": { + "/individuals/filtering_terms": { "get": { - "description": "Get the genomic variants list from one individual, identified by its (unique) 'id'", - "operationId": "getOneIndividualGenomicVariants", "parameters": [ - { - "$ref": "#/components/parameters/requestedSchema" - }, { "$ref": "#/components/parameters/skip" }, @@ -339,27 +253,34 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the list of filtering terms that could be used with individuals.", + "operationId": "getIndivualsFilteringTerms", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { - "$ref": "#/components/responses/ResultsOKResponse" + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" + } + } + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get the genomic variants list from one individual, identified by its (unique) 'id'", - "operationId": "potOneIndividualGenomicVariants", + "description": "Get the list of filtering terms that could be used with individuals.", + "operationId": "postIndividualsFilteringTerms", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -372,18 +293,97 @@ }, "responses": { "200": { - "$ref": "#/components/responses/ResultsOKResponse" + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" + } + } + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } } }, - "servers": [] + "components": { + "responses": { + "ResultsOKResponse": { + "description": "Successful operation.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" + } + ] + } + } + } + } + }, + "parameters": { + "requestedSchema": { + "name": "requestedSchema", + "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "example": "ga4gh-service-info-v1.0" + }, + "skip": { + "name": "skip", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" + } + }, + "limit": { + "name": "limit", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" + } + }, + "includeResultsetResponses": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" + }, + "entryId": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "filters": { + "name": "filters", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "NCIT:C20197" + ] + ] + } + } + } + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/individuals/examples/individual-MID-example.json b/bycon/schemas/models/json/progenetix-model/individuals/examples/individual-MID-example.json index 217c80cc7..32490b9cf 100644 --- a/bycon/schemas/models/json/progenetix-model/individuals/examples/individual-MID-example.json +++ b/bycon/schemas/models/json/progenetix-model/individuals/examples/individual-MID-example.json @@ -1,17 +1,30 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "id": "Ind001", + "sex": { + "id": "NCIT:C16576", + "label": "female" + }, + "ethnicity": { + "id": "NCIT:C43851", + "label": "European" + }, + "geographicOrigin": { + "id": "GAZ:00002955", + "label": "Slovenia" + }, "diseases": [ { + "diseaseCode": { + "id": "OMIM:164400", + "label": "Spinocerebellar ataxia 1" + }, "ageOfOnset": { "ageGroup": { "id": "NCIT:C49685", "label": "Adult 18-65 Years Old" } }, - "diseaseCode": { - "id": "OMIM:164400", - "label": "Spinocerebellar ataxia 1" - }, "familyHistory": false, "severity": { "id": "HP:0012829", @@ -23,15 +36,6 @@ } } ], - "ethnicity": { - "id": "NCIT:C43851", - "label": "European" - }, - "geographicOrigin": { - "id": "GAZ:00002955", - "label": "Slovenia" - }, - "id": "Ind001", "measures": [ { "assayCode": { @@ -40,11 +44,11 @@ }, "date": "2017-05-03", "measurementValue": { + "value": 55345, "units": { "id": "NCIT:C103452", "label": "Per Milliliter" - }, - "value": 55345 + } }, "observationMoment": { "age": { @@ -52,9 +56,5 @@ } } } - ], - "sex": { - "id": "NCIT:C16576", - "label": "female" - } + ] } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/individuals/examples/individual-with-pedigree-MID-example.json b/bycon/schemas/models/json/progenetix-model/individuals/examples/individual-with-pedigree-MID-example.json index 5ef76f67f..40db5f470 100644 --- a/bycon/schemas/models/json/progenetix-model/individuals/examples/individual-with-pedigree-MID-example.json +++ b/bycon/schemas/models/json/progenetix-model/individuals/examples/individual-with-pedigree-MID-example.json @@ -1,17 +1,30 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "id": "Ind001", + "sex": { + "id": "NCIT:C16576", + "label": "female" + }, + "ethnicity": { + "id": "NCIT:C43851", + "label": "European" + }, + "geographicOrigin": { + "id": "GAZ:00002586", + "label": "State of Wisconsin" + }, "diseases": [ { + "diseaseCode": { + "id": "HP:0001645", + "label": "Sudden cardiac death" + }, "ageOfOnset": { "ageGroup": { "id": "NCIT:C16731", "label": "Newborn" } }, - "diseaseCode": { - "id": "HP:0001645", - "label": "Sudden cardiac death" - }, "familyHistory": true, "severity": { "id": "HP:0012828", @@ -19,63 +32,50 @@ } } ], - "ethnicity": { - "id": "NCIT:C43851", - "label": "European" - }, - "geographicOrigin": { - "id": "GAZ:00002586", - "label": "State of Wisconsin" - }, - "id": "Ind001", "pedigrees": [ { + "id": "SCD-Pedigree001", "disease": { "diseaseCode": { "id": "HP:0001645", "label": "Sudden cardiac death" } }, - "id": "SCD-Pedigree001", + "numSubjects": 4, "members": [ { - "affected": true, "memberId": "Ind001", "role": { "id": "NCIT:C64435", "label": "Proband" - } + }, + "affected": true }, { - "affected": false, "memberId": "Ind011", "role": { "id": "NCIT:C96572", "label": "Biological Father" - } + }, + "affected": false }, { - "affected": false, "memberId": "Ind012", "role": { "id": "NCIT:C96572", "label": "Biological Father" - } + }, + "affected": false }, { - "affected": false, "memberId": "Ind022", "role": { "id": "NCIT:C111201", "label": "Full Brother" - } + }, + "affected": false } - ], - "numSubjects": 4 + ] } - ], - "sex": { - "id": "NCIT:C16576", - "label": "female" - } + ] } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/individuals/examples/pedigree-example.json b/bycon/schemas/models/json/progenetix-model/individuals/examples/pedigree-example.json index 0af1070d8..3017c7b74 100644 --- a/bycon/schemas/models/json/progenetix-model/individuals/examples/pedigree-example.json +++ b/bycon/schemas/models/json/progenetix-model/individuals/examples/pedigree-example.json @@ -1,45 +1,45 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", + "id": "SCD-Pedigree001", "disease": { "diseaseCode": { "id": "HP:0004789", "label": "lactose intolerance" } }, - "id": "SCD-Pedigree001", + "numSubjects": 4, "members": [ { - "affected": true, "memberId": "Ind001", "role": { "id": "NCIT:C64435", "label": "Proband" - } + }, + "affected": true }, { - "affected": false, "memberId": "Pedigree1001-m1", "role": { "id": "NCIT:C96572", "label": "Biological Father" - } + }, + "affected": false }, { - "affected": false, "memberId": "Pedigree1001-m3", "role": { "id": "NCIT:C96572", "label": "Biological Father" - } + }, + "affected": false }, { - "affected": false, "memberId": "Pedigree1001-m2", "role": { "id": "NCIT:C111201", "label": "Full Brother" - } + }, + "affected": false } - ], - "numSubjects": 4 + ] } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/phenopackets/defaultSchema.json b/bycon/schemas/models/json/progenetix-model/phenopackets/defaultSchema.json index d770f71e2..609746fba 100644 --- a/bycon/schemas/models/json/progenetix-model/phenopackets/defaultSchema.json +++ b/bycon/schemas/models/json/progenetix-model/phenopackets/defaultSchema.json @@ -1,7 +1,7 @@ { - "$id": "https://progenetix.org/services/schemas/phenopacket/v2023-01-10", "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "The Phenopacket class is a bare-bones JSON-schema rewrite of the Phenopackets v2 standard.", + "$id": "https://progenetix.org/services/schemas/phenopacket/v2023-01-10", + "title": "Phenopacket", "meta": { "provenance": [ { @@ -14,50 +14,50 @@ } ] }, + "description": "The Phenopacket class is a bare-bones JSON-schema rewrite of the Phenopackets v2 standard.", "properties": { + "id": { + "type": "string", + "description": "The resource-local identifier for this Phenopacket.", + "examples": [ + "pgxpxf-kftx25eh" + ] + }, + "subject": { + "$ref": "../individuals/defaultSchema.json" + }, "biosamples": { + "type": "array", "items": { "$ref": "../biosamples/defaultSchema.json" - }, - "type": "array" + } }, "diseases": { + "type": "array", "items": { "$ref": "../common/disease.json" - }, - "type": "array" + } }, - "files": { + "phenotypicFeatures": { + "type": "array", "items": { - "$ref": "../common/file.json" - }, - "type": "array" - }, - "id": { - "description": "The resource-local identifier for this Phenopacket.", - "examples": [ - "pgxpxf-kftx25eh" - ], - "type": "string" + "$ref": "../common/phenotypicFeature.json" + } }, "measurements": { + "type": "array", "items": { "$ref": "../common/measurement.json" - }, - "type": "array" - }, - "metaData": { - "ref": "../common/metaData.json" + } }, - "phenotypicFeatures": { + "files": { + "type": "array", "items": { - "$ref": "../common/phenotypicFeature.json" - }, - "type": "array" + "$ref": "../common/file.json" + } }, - "subject": { - "$ref": "../individuals/defaultSchema.json" + "metaData": { + "ref": "../common/metaData.json" } - }, - "title": "Phenopacket" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/phenopackets/endpoints.json b/bycon/schemas/models/json/progenetix-model/phenopackets/endpoints.json index d43ffde30..da99274a0 100644 --- a/bycon/schemas/models/json/progenetix-model/phenopackets/endpoints.json +++ b/bycon/schemas/models/json/progenetix-model/phenopackets/endpoints.json @@ -1,98 +1,21 @@ { - "components": { - "parameters": { - "entryId": { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - "filters": { - "in": "query", - "name": "filters", - "schema": { - "examples": [ - [ - "NCIT:C20197" - ] - ], - "items": { - "type": "string" - }, - "type": "array" - } - }, - "includeResultsetResponses": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" - }, - "limit": { - "in": "query", - "name": "limit", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" - } - }, - "requestedSchema": { - "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", - "example": "ga4gh-service-info-v1.0", - "in": "query", - "name": "requestedSchema", - "required": false, - "schema": { - "type": "string" - } - }, - "skip": { - "in": "query", - "name": "skip", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" - } - } - }, - "responses": { - "ResultsOKResponse": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" - } - ] - } - } - }, - "description": "Successful operation." - } - } - }, + "openapi": "3.0.2", + "servers": [], "info": { + "version": "2.0.0", + "title": "GA4GH Beacon API Specification - Phenopackets Endpoints", + "description": "TBD", "contact": { "email": "beacon@ga4gh.org" }, - "description": "TBD", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "title": "GA4GH Beacon API Specification - Phenopackets Endpoints", - "version": "2.0.0" + } }, - "openapi": "3.0.2", "paths": { "/phenopackets": { "get": { - "description": "Get a list of phenopackets", - "operationId": "getIndividuals", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -110,6 +33,11 @@ "$ref": "#/components/parameters/filters" } ], + "description": "Get a list of phenopackets", + "operationId": "getIndividuals", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" @@ -117,14 +45,14 @@ "default": { "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] + } }, "post": { "description": "Get a list of example entries", "operationId": "postIndividualsRequest", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -140,50 +68,40 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/phenopackets/filtering_terms": { + "/phenopackets/{id}": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the list of filtering terms that could be used with phenopackets.", - "operationId": "getIndivualsFilteringTerms", - "parameters": [ - { - "$ref": "#/components/parameters/skip" - }, - { - "$ref": "#/components/parameters/limit" - } + "description": "Get details about one individual, identified by its (unique) 'id'", + "operationId": "getOneIndividual", + "tags": [ + "GET Endpoints" ], "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" - } - } - }, - "description": "Successful operation" + "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] + } }, "post": { - "description": "Get the list of filtering terms that could be used with phenopackets.", - "operationId": "postIndividualsFilteringTerms", + "description": "Get details about one Individual, identified by its (unique) 'id'", + "operationId": "postOneIndividual", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -196,50 +114,54 @@ }, "responses": { "200": { - "content": { - "application/json": { - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" - } - } - }, - "description": "Successful operation" + "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/phenopackets/{id}": { + "/phenopackets/{id}/g_variants": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get details about one individual, identified by its (unique) 'id'", - "operationId": "getOneIndividual", + "parameters": [ + { + "$ref": "#/components/parameters/requestedSchema" + }, + { + "$ref": "#/components/parameters/skip" + }, + { + "$ref": "#/components/parameters/limit" + } + ], + "description": "Get the genomic variants list from one individual, identified by its (unique) 'id'", + "operationId": "getOneIndividualGenomicVariants", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get details about one Individual, identified by its (unique) 'id'", - "operationId": "postOneIndividual", + "description": "Get the genomic variants list from one individual, identified by its (unique) 'id'", + "operationId": "potOneIndividualGenomicVariants", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -255,19 +177,19 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, "/phenopackets/{id}/biosamples": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the biosamples list from one individual, identified by its (unique) 'id'", - "operationId": "getOneIndividualBiosamples", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -279,27 +201,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the biosamples list from one individual, identified by its (unique) 'id'", + "operationId": "getOneIndividualBiosamples", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { "description": "Get the biosamples list from one individual, identified by its (unique) 'id'", "operationId": "postOneIndividualBiosamples", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -315,23 +237,15 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/phenopackets/{id}/g_variants": { + "/phenopackets/filtering_terms": { "get": { - "description": "Get the genomic variants list from one individual, identified by its (unique) 'id'", - "operationId": "getOneIndividualGenomicVariants", "parameters": [ - { - "$ref": "#/components/parameters/requestedSchema" - }, { "$ref": "#/components/parameters/skip" }, @@ -339,27 +253,34 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the list of filtering terms that could be used with phenopackets.", + "operationId": "getIndivualsFilteringTerms", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { - "$ref": "#/components/responses/ResultsOKResponse" + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" + } + } + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get the genomic variants list from one individual, identified by its (unique) 'id'", - "operationId": "potOneIndividualGenomicVariants", + "description": "Get the list of filtering terms that could be used with phenopackets.", + "operationId": "postIndividualsFilteringTerms", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -372,18 +293,97 @@ }, "responses": { "200": { - "$ref": "#/components/responses/ResultsOKResponse" + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconFilteringTermsResponse.json" + } + } + } }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } } }, - "servers": [] + "components": { + "responses": { + "ResultsOKResponse": { + "description": "Successful operation.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" + } + ] + } + } + } + } + }, + "parameters": { + "requestedSchema": { + "name": "requestedSchema", + "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "example": "ga4gh-service-info-v1.0" + }, + "skip": { + "name": "skip", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" + } + }, + "limit": { + "name": "limit", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" + } + }, + "includeResultsetResponses": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" + }, + "entryId": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "filters": { + "name": "filters", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "NCIT:C20197" + ] + ] + } + } + } + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/runs/defaultSchema.json b/bycon/schemas/models/json/progenetix-model/runs/defaultSchema.json index 14cb5a8dd..3f525b6e2 100644 --- a/bycon/schemas/models/json/progenetix-model/runs/defaultSchema.json +++ b/bycon/schemas/models/json/progenetix-model/runs/defaultSchema.json @@ -1,52 +1,42 @@ { - "$comment": "version: ga4gh-beacon-biosample-v2.0.0", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "title": "Experimental run", + "$comment": "version: ga4gh-beacon-biosample-v2.0.0", "description": "Schema for the experimental run (e.g. sequencing run, array processing...) leading to the raw data for the (computational) analysis.", + "type": "object", "properties": { - "biosampleId": { - "description": "Reference to the biosample ID.", - "examples": [ - "008dafdd-a3d1-4801-8c0a-8714e2b58e48" - ], - "type": "string" - }, "id": { "description": "Run ID.", + "type": "string", "examples": [ "SRR10903401" - ], - "type": "string" + ] + }, + "biosampleId": { + "description": "Reference to the biosample ID.", + "type": "string", + "examples": [ + "008dafdd-a3d1-4801-8c0a-8714e2b58e48" + ] }, "individualId": { "description": "Reference to the individual ID.", + "type": "string", "examples": [ "TCGA-AO-A0JJ" - ], - "type": "string" - }, - "info": { - "$ref": "../common/commonDefinitions.json#/definitions/Info" - }, - "libraryLayout": { - "description": "Ontology value for the library layout e.g \"PAIRED\", \"SINGLE\" #todo add Ontology name?", - "enum": [ - "PAIRED", - "SINGLE" - ], - "type": "string" + ] }, - "librarySelection": { - "description": "Selection method for library preparation, e.g \"RANDOM\", \"RT-PCR\"", + "runDate": { + "description": "Date at which the experiment was performed.", + "type": "string", + "format": "date", "examples": [ - "RANDOM", - "RT-PCR" - ], - "type": "string" + "2021-10-18" + ] }, "librarySource": { - "$ref": "../common/ontologyTerm.json", "description": "Ontology value for the source of the sequencing or hybridization library, e.g \"genomic source\", \"transcriptomic source\"", + "$ref": "../common/ontologyTerm.json", "examples": [ { "id": "GENEPIO:0001966", @@ -58,25 +48,41 @@ } ] }, + "librarySelection": { + "description": "Selection method for library preparation, e.g \"RANDOM\", \"RT-PCR\"", + "type": "string", + "examples": [ + "RANDOM", + "RT-PCR" + ] + }, "libraryStrategy": { "description": "Library strategy, e.g. \"WGS\"", + "type": "string", "examples": [ "WGS" - ], - "type": "string" + ] + }, + "libraryLayout": { + "description": "Ontology value for the library layout e.g \"PAIRED\", \"SINGLE\" #todo add Ontology name?", + "type": "string", + "enum": [ + "PAIRED", + "SINGLE" + ] }, "platform": { "description": "General platform technology label. It SHOULD be a subset of the platformModel and used only for query convenience, e.g. \"return everything sequenced with Illimuna\", where the specific model is not relevant", + "type": "string", "examples": [ "Illumina", "Oxford Nanopore", "Affymetrix" - ], - "type": "string" + ] }, "platformModel": { - "$ref": "../common/ontologyTerm.json", "description": "Ontology value for experimental platform or methodology used. For sequencing platforms the use of \"OBI:0400103 - DNA sequencer\" is suggested.", + "$ref": "../common/ontologyTerm.json", "examples": [ { "id": "OBI:0002048", @@ -92,13 +98,8 @@ } ] }, - "runDate": { - "description": "Date at which the experiment was performed.", - "examples": [ - "2021-10-18" - ], - "format": "date", - "type": "string" + "info": { + "$ref": "../common/commonDefinitions.json#/definitions/Info" } }, "required": [ @@ -106,6 +107,5 @@ "biosampleId", "runDate" ], - "title": "Experimental run", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/runs/endpoints.json b/bycon/schemas/models/json/progenetix-model/runs/endpoints.json index 3f7fd4d7a..528fbbc36 100644 --- a/bycon/schemas/models/json/progenetix-model/runs/endpoints.json +++ b/bycon/schemas/models/json/progenetix-model/runs/endpoints.json @@ -1,114 +1,21 @@ { - "components": { - "parameters": { - "biosampleId": { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - "entryId": { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - "filters": { - "in": "query", - "name": "filters", - "schema": { - "examples": [ - [ - "OBI:0002048" - ] - ], - "items": { - "type": "string" - }, - "type": "array" - } - }, - "includeResultsetResponses": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" - }, - "individualId": { - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - } - }, - "limit": { - "in": "query", - "name": "limit", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" - } - }, - "requestedSchema": { - "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", - "example": "ga4gh-service-info-v1.0", - "in": "query", - "name": "requestedSchema", - "required": false, - "schema": { - "type": "string" - } - }, - "skip": { - "in": "query", - "name": "skip", - "schema": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" - } - } - }, - "responses": { - "ResultsOKResponse": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" - }, - { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" - } - ] - } - } - }, - "description": "Successful operation." - } - } - }, + "openapi": "3.0.2", + "servers": [], "info": { + "version": "2.0.0", + "title": "GA4GH Beacon API Specification - Runs Endpoints", + "description": "TBD", "contact": { "email": "beacon@ga4gh.org" }, - "description": "TBD", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "title": "GA4GH Beacon API Specification - Runs Endpoints", - "version": "2.0.0" + } }, - "openapi": "3.0.2", "paths": { "/runs": { "get": { - "description": "Get a list of sequencing runs", - "operationId": "getRuns", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -126,6 +33,11 @@ "$ref": "#/components/parameters/filters" } ], + "description": "Get a list of sequencing runs", + "operationId": "getRuns", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" @@ -133,14 +45,14 @@ "default": { "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] + } }, "post": { "description": "Get a list of sequencing runs", "operationId": "postRunsRequest", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -156,40 +68,40 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, "/runs/{id}": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { "description": "Get details about one sequencing run, identified by its (unique) 'id'", "operationId": "getOneRun", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { "description": "Get details about one Run, identified by its (unique) 'id'", "operationId": "postOneRun", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -205,19 +117,19 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/runs/{id}/analyses": { + "/runs/{id}/g_variants": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the analysis list from one sequencing run, identified by its (unique) 'id'", - "operationId": "getOneRunAnalysis", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -229,27 +141,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the genomic variants list from one run, identified by its (unique) 'id'", + "operationId": "getOneRunGenomicVariants", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get the analysis list from one sequencing run, identified by its (unique) 'id'", - "operationId": "postOneRunAnalysis", + "description": "Get the genomic variants list from one run, identified by its (unique) 'id'", + "operationId": "potOneRunGenomicVariants", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -265,19 +177,19 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } }, - "/runs/{id}/g_variants": { + "/runs/{id}/analyses": { + "parameters": [ + { + "$ref": "#/components/parameters/entryId" + } + ], "get": { - "description": "Get the genomic variants list from one run, identified by its (unique) 'id'", - "operationId": "getOneRunGenomicVariants", "parameters": [ { "$ref": "#/components/parameters/requestedSchema" @@ -289,27 +201,27 @@ "$ref": "#/components/parameters/limit" } ], + "description": "Get the analysis list from one sequencing run, identified by its (unique) 'id'", + "operationId": "getOneRunAnalysis", + "tags": [ + "GET Endpoints" + ], "responses": { "200": { "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "GET Endpoints" - ] - }, - "parameters": [ - { - "$ref": "#/components/parameters/entryId" } - ], + }, "post": { - "description": "Get the genomic variants list from one run, identified by its (unique) 'id'", - "operationId": "potOneRunGenomicVariants", + "description": "Get the analysis list from one sequencing run, identified by its (unique) 'id'", + "operationId": "postOneRunAnalysis", + "tags": [ + "POST Endpoints" + ], "requestBody": { "content": { "application/json": { @@ -325,15 +237,103 @@ "$ref": "#/components/responses/ResultsOKResponse" }, "default": { - "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json", - "description": "An unsuccessful operation" + "description": "An unsuccessful operation", + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconErrorResponse.json" } - }, - "tags": [ - "POST Endpoints" - ] + } } } }, - "servers": [] + "components": { + "responses": { + "ResultsOKResponse": { + "description": "Successful operation.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconBooleanResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconCountResponse.json" + }, + { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/responses/beaconResultsetsResponse.json" + } + ] + } + } + } + } + }, + "parameters": { + "requestedSchema": { + "name": "requestedSchema", + "description": "Schema to be used to format the `result` field in the response. The response will use Beacon format.", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "example": "ga4gh-service-info-v1.0" + }, + "skip": { + "name": "skip", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Skip" + } + }, + "limit": { + "name": "limit", + "in": "query", + "schema": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/Limit" + } + }, + "includeResultsetResponses": { + "$ref": "https://raw.githubusercontent.com/ga4gh-beacon/beacon-v2/main/framework/json/common/beaconCommonComponents.json#/definitions/IncludeResultsetResponses" + }, + "entryId": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "individualId": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "biosampleId": { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + "filters": { + "name": "filters", + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "OBI:0002048" + ] + ] + } + } + } + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/runs/examples/runs-MAX-example.json b/bycon/schemas/models/json/progenetix-model/runs/examples/runs-MAX-example.json index fd3c5bb22..14b98ad94 100644 --- a/bycon/schemas/models/json/progenetix-model/runs/examples/runs-MAX-example.json +++ b/bycon/schemas/models/json/progenetix-model/runs/examples/runs-MAX-example.json @@ -1,19 +1,19 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "biosampleId": "008dafdd-a3d1-4801-8c0a-8714e2b58e48", "id": "SRR10903401", + "biosampleId": "008dafdd-a3d1-4801-8c0a-8714e2b58e48", "individualId": "TCGA-AO-A0JJ", - "libraryLayout": "PAIRED", - "librarySelection": "RANDOM", + "runDate": "2021-10-18", "librarySource": { "id": "GENEPIO:0001966", "label": "genomic source" }, + "librarySelection": "RANDOM", "libraryStrategy": "WGS", + "libraryLayout": "PAIRED", "platform": "Illumina", "platformModel": { "id": "OBI:0002048", "label": "Illumina HiSeq 3000" - }, - "runDate": "2021-10-18" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-model/runs/examples/runs-MIN-example.json b/bycon/schemas/models/json/progenetix-model/runs/examples/runs-MIN-example.json index 4cade813d..41e66f768 100644 --- a/bycon/schemas/models/json/progenetix-model/runs/examples/runs-MIN-example.json +++ b/bycon/schemas/models/json/progenetix-model/runs/examples/runs-MIN-example.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "biosampleId": "008dafdd-a3d1-4801-8c0a-8714e2b58e48", "id": "SRR10903401", + "biosampleId": "008dafdd-a3d1-4801-8c0a-8714e2b58e48", "runDate": "2021-10-18" } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-service-schemas/Collation.json b/bycon/schemas/models/json/progenetix-service-schemas/Collation.json index d9a231fe0..e06077516 100644 --- a/bycon/schemas/models/json/progenetix-service-schemas/Collation.json +++ b/bycon/schemas/models/json/progenetix-service-schemas/Collation.json @@ -1,128 +1,128 @@ { - "$id": "https://progenetix.org/services/schemas/Collation/v2023-10-04", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, - "definitions": { - "PathItem": { - "properties": { - "depth": { - "type": "integer" - }, - "order": { - "type": "integer" - }, - "path": { - "items": "string", - "type": "array" - } - }, - "type": "object" - } - }, + "$id": "https://progenetix.org/services/schemas/Collation/v2023-10-04", + "title": "Collation", + "type": "object", "description": "A Collation represents information about aggregated occurrences of entities (e.g. all biosamples with a given diagnostic code).\n", "properties": { - "child_terms": { + "id": { + "type": "string", "examples": [ - [ - "PMID:10471496" - ] - ], - "items": "string", - "type": "array" - }, - "cnv_analyses": { - "type": "integer" + "PMID:22824167" + ] }, - "code": { + "label": { + "description": "An informative short text label.\n", + "type": "string", "examples": [ - "PMID:10471496" - ], - "type": "string" + "Peralta R, Baudis M, Vazquez G, Juarez S, Ortiz R, Decanini et al. (2010): Increased expression of cellular retinol-binding protein 1 in laryngeal squamous cell carcinoma.", + "carcinoma, NOS" + ] }, - "code_matches": { - "type": "integer" + "type": { + "type": "string", + "examples": [ + "NCBI PubMed" + ] }, "collation_type": { + "type": "string", "examples": [ "PMID" - ], - "type": "string" + ] }, - "count": { - "type": "integer" + "namespace_prefix": { + "type": "string", + "examples": [ + "PMID" + ] }, - "dataset_id": { + "scope": { + "type": "string", "examples": [ - "cellz" - ], - "type": "string" + "biosamples" + ] }, "db_key": { + "type": "string", "examples": [ "external_references.id" - ], - "type": "string" + ] }, "hierarchy_paths": { + "type": "array", "items": { "$ref": "#/definitions/PathItem" - }, - "type": "array" - }, - "id": { - "examples": [ - "PMID:22824167" - ], - "type": "string" - }, - "label": { - "description": "An informative short text label.\n", - "examples": [ - "Peralta R, Baudis M, Vazquez G, Juarez S, Ortiz R, Decanini et al. (2010): Increased expression of cellular retinol-binding protein 1 in laryngeal squamous cell carcinoma.", - "carcinoma, NOS" - ], - "type": "string" - }, - "namespace_prefix": { - "examples": [ - "PMID" - ], - "type": "string" + } }, "parent_terms": { + "type": "array", + "items": "string", "examples": [ [ "PMID:10471496" ] - ], + ] + }, + "child_terms": { + "type": "array", "items": "string", - "type": "array" + "examples": [ + [ + "PMID:10471496" + ] + ] }, "reference": { + "type": "string", "examples": [ "https://europepmc.org/article/MED/10471496" - ], - "type": "string" + ] }, - "scope": { + "code": { + "type": "string", "examples": [ - "biosamples" - ], - "type": "string" + "PMID:10471496" + ] }, - "type": { + "dataset_id": { + "type": "string", "examples": [ - "NCBI PubMed" - ], - "type": "string" + "cellz" + ] }, "updated": { + "type": "string", "examples": [ "2023-07-03T11:50:00.047225" - ], - "type": "string" + ] + }, + "count": { + "type": "integer" + }, + "cnv_analyses": { + "type": "integer" + }, + "code_matches": { + "type": "integer" } }, - "title": "Collation", - "type": "object" + "definitions": { + "PathItem": { + "type": "object", + "properties": { + "order": { + "type": "integer" + }, + "depth": { + "type": "integer" + }, + "path": { + "type": "array", + "items": "string" + } + } + } + }, + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-service-schemas/IntervalFrequencies.json b/bycon/schemas/models/json/progenetix-service-schemas/IntervalFrequencies.json index 71edad87b..c33ae63c4 100644 --- a/bycon/schemas/models/json/progenetix-service-schemas/IntervalFrequencies.json +++ b/bycon/schemas/models/json/progenetix-service-schemas/IntervalFrequencies.json @@ -1,7 +1,8 @@ { - "$id": "https://progenetix.org/services/schemas/IntervalFrequencies/v2022-02-16", "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "This schema represents genomic event frequencies for binned genome intervals.\n", + "$id": "https://progenetix.org/services/schemas/IntervalFrequencies/v2022-02-16", + "title": "IntervalFrequencies", + "type": "object", "meta": { "contributors": [ { @@ -15,42 +16,41 @@ "id": "https://github.com/progenetix/bycon/" } ], - "sb_status": "community", "used_by": [ { "description": "Progenetix database", "id": "https://github.com/progenetix/" } - ] + ], + "sb_status": "community" }, + "description": "This schema represents genomic event frequencies for binned genome intervals.\n", "properties": { "datasetId": { + "type": "string", "description": "The dataset this ferequency set was derived from.", "examples": [ "progenetix" - ], - "type": "string" + ] }, "groupId": { + "type": "string", "description": "The idemntifier for this frequency set (typically a CURIE).", "examples": [ "NCIT:C3730" - ], - "type": "string" - }, - "intervalFrequencies": { - "description": "Array of frequency objects.\n", - "items": "IntervalFrequencyItem.json/#properties", - "type": "array" + ] }, "sourceCollection": { + "type": "string", "description": "The gatabase collection that was queried to gather the response items.\n", "examples": [ "analyses" - ], - "type": "string" + ] + }, + "intervalFrequencies": { + "type": "array", + "description": "Array of frequency objects.\n", + "items": "IntervalFrequencyItem.json/#properties" } - }, - "title": "IntervalFrequencies", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-service-schemas/IntervalFrequencyItem.json b/bycon/schemas/models/json/progenetix-service-schemas/IntervalFrequencyItem.json index 39b52605d..886d4b5bb 100644 --- a/bycon/schemas/models/json/progenetix-service-schemas/IntervalFrequencyItem.json +++ b/bycon/schemas/models/json/progenetix-service-schemas/IntervalFrequencyItem.json @@ -1,7 +1,8 @@ { - "$id": "https://progenetix.org/services/schemas/IntervalFrequencyItem/v2022-02-16", "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "This schema represents frequency data for a single binned genome interval.\n", + "$id": "https://progenetix.org/services/schemas/IntervalFrequencyItem/v2022-02-16", + "title": "IntervalFrequencyItem", + "type": "object", "meta": { "contributors": [ { @@ -15,66 +16,65 @@ "id": "https://github.com/progenetix/bycon/" } ], - "sb_status": "community", "used_by": [ { "description": "Progenetix database", "id": "https://github.com/progenetix/" } - ] + ], + "sb_status": "community" }, + "description": "This schema represents frequency data for a single binned genome interval.\n", "properties": { + "id": { + "type": "string", + "examples": [ + "1p:14000000-15000000", + "Yq:57000000-57227415" + ] + }, + "false": { + "description": "continuous count of the intervals, from 1pter -> Yqter (in humans)", + "type": "integer" + }, + "referenceName": { + "description": "basically the chromosome", + "type": "string" + }, + "start": { + "description": "start, 0-based", + "type": "integer" + }, "end": { "description": "end, 0-based", "type": "integer" }, + "size": { + "description": "base count (ennd - start)", + "type": "integer" + }, "gainFrequency": { "description": "percent of samples with a gain-type CNV", "type": "number" }, - "gainMean": { + "lossFrequency": { + "description": "percent of samples with a loss-type CNV", "type": "number" }, - "gainMedian": { - "description": "percent of samples with a gain-type CNV", + "gainMean": { "type": "number" }, - "id": { - "examples": [ - "1p:14000000-15000000", - "Yq:57000000-57227415" - ], - "type": "string" - }, - "lossFrequency": { + "lossMean": { "description": "percent of samples with a loss-type CNV", "type": "number" }, - "lossMean": { - "description": "percent of samples with a loss-type CNV", + "gainMedian": { + "description": "percent of samples with a gain-type CNV", "type": "number" }, "lossMedian": { "description": "percent of samples with a loss-type CNV", "type": "number" - }, - "no": { - "description": "continuous count of the intervals, from 1pter -> Yqter (in humans)", - "type": "integer" - }, - "referenceName": { - "description": "basically the chromosome", - "type": "string" - }, - "size": { - "description": "base count (ennd - start)", - "type": "integer" - }, - "start": { - "description": "start, 0-based", - "type": "integer" } - }, - "title": "IntervalFrequencyItem", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-service-schemas/OntologyClass.json b/bycon/schemas/models/json/progenetix-service-schemas/OntologyClass.json index 7816ca5ca..ba226d694 100644 --- a/bycon/schemas/models/json/progenetix-service-schemas/OntologyClass.json +++ b/bycon/schemas/models/json/progenetix-service-schemas/OntologyClass.json @@ -1,8 +1,8 @@ { - "$id": "https://progenetix.org/services/schemas/OntologyClass/v2021-01-12", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, - "description": "The `OntologyClass` object is the main wrapper for identifiers, used for well-formed CURIE representations of ontology classes for biological or technical concepts and knowledge resources, as well as for \"private\" identifiers such as internal classifications. \n", + "$id": "https://progenetix.org/services/schemas/OntologyClass/v2021-01-12", + "title": "OntologyClass", + "type": "object", "meta": { "contributors": [ { @@ -23,35 +23,35 @@ "id": "https://github.com/progenetix/bycon/" } ], - "sb_status": "community", "used_by": [ { "description": "Progenetix database schema (Beacon+ backend)", "id": "https://github.com/progenetix/schemas/" } - ] + ], + "sb_status": "community" }, + "description": "The `OntologyClass` object is the main wrapper for identifiers, used for well-formed CURIE representations of ontology classes for biological or technical concepts and knowledge resources, as well as for \"private\" identifiers such as internal classifications. \n", "properties": { "id": { + "type": "string", "description": "Identifier as string (CURIE highly recommended). \n", "examples": [ "UBERON:0000002", "PMID:9892199", "icdom-85003" - ], - "type": "string" + ] }, "label": { + "type": "string", "examples": [ "neoplastic sample", "Adenocarcinoma, NOS" - ], - "type": "string" + ] } }, "required": [ "id" ], - "title": "OntologyClass", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-service-schemas/OntologyClassGroup.json b/bycon/schemas/models/json/progenetix-service-schemas/OntologyClassGroup.json index 65bc3cb1c..d8f9c246b 100644 --- a/bycon/schemas/models/json/progenetix-service-schemas/OntologyClassGroup.json +++ b/bycon/schemas/models/json/progenetix-service-schemas/OntologyClassGroup.json @@ -1,13 +1,13 @@ { - "$id": "https://progenetix.org/services/schemas/OntologyClassGroup/v2022-02-15", "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://progenetix.org/services/schemas/OntologyClassGroup/v2022-02-15", + "title": "OntologyClassGroup", "properties": { "term_groups": { + "type": "array", "items": { "$ref": "OntologyClass.json#/properties" - }, - "type": "array" + } } - }, - "title": "OntologyClassGroup" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-service-schemas/Progenetix.json b/bycon/schemas/models/json/progenetix-service-schemas/Progenetix.json index 696ddf9ef..35b5b0d40 100644 --- a/bycon/schemas/models/json/progenetix-service-schemas/Progenetix.json +++ b/bycon/schemas/models/json/progenetix-service-schemas/Progenetix.json @@ -1,22 +1,8 @@ { - "$id": "https://progenetix.org/services/schemas/Progenetix/v2021-03-05", "$schema": "https://json-schema.org/draft/2020-12/schema", - "definitions": { - "biosample": { - "$ref": "biosample.json#/properties" - }, - "callset": { - "$ref": "Callset.json#/properties" - }, - "id": "#root", - "individual": { - "$ref": "individual.json#/properties" - }, - "variant": { - "$ref": "variant.json#/properties" - } - }, - "description": "This is the root schema for the Progenetix resource, corresponding to the principle elements of the core data schema.\n", + "$id": "https://progenetix.org/services/schemas/Progenetix/v2021-03-05", + "title": "Progenetix", + "type": "object", "meta": { "contributors": [ { @@ -30,14 +16,28 @@ "id": "https://github.com/progenetix/bycon/" } ], - "sb_status": "community", "used_by": [ { "description": "Progenetix database schema (Beacon+ backend)", "id": "https://github.com/progenetix/schemas/" } - ] + ], + "sb_status": "community" }, - "title": "Progenetix", - "type": "object" + "description": "This is the root schema for the Progenetix resource, corresponding to the principle elements of the core data schema.\n", + "definitions": { + "id": "#root", + "biosample": { + "$ref": "biosample.json#/properties" + }, + "individual": { + "$ref": "individual.json#/properties" + }, + "callset": { + "$ref": "Callset.json#/properties" + }, + "variant": { + "$ref": "variant.json#/properties" + } + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-service-schemas/ProgenetixGene.json b/bycon/schemas/models/json/progenetix-service-schemas/ProgenetixGene.json index a2d0078c0..822e281fc 100644 --- a/bycon/schemas/models/json/progenetix-service-schemas/ProgenetixGene.json +++ b/bycon/schemas/models/json/progenetix-service-schemas/ProgenetixGene.json @@ -1,8 +1,8 @@ { - "$id": "https://progenetix.org/services/schemas/ProgenetixGene/v2022-12-21", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, - "description": "Genomic mapping position of the coding region of a gene.", + "$id": "https://progenetix.org/services/schemas/ProgenetixGene/v2022-12-21", + "title": "ProgenetixGene", + "type": "object", "meta": { "contributors": [ { @@ -22,92 +22,66 @@ ], "sb_status": "community" }, + "description": "Genomic mapping position of the coding region of a gene.", + "required": { + "all_of": [ + "referenceName start end symbol" + ] + }, "properties": { + "symbol": { + "type": "string", + "examples": [ + "TP53" + ] + }, "accessionVersion": { + "type": "string", "examples": [ "NC_000016.10", "NW_003315972.2" - ], - "type": "string" - }, - "cytobands": { - "examples": [ - "17p13.1" - ], - "type": "string" - }, - "end": { - "examples": [ - 7676593 - ], - "type": "integer" - }, - "ensemblGene_Ids": { - "examples": [ - [ - "ENSG00000147889" - ] - ], - "items": "string", - "type": "array" + ] }, "geneId": { + "type": "string", "examples": [ "1029" - ], - "type": "string" - }, - "geneLocusLength": { - "examples": [ - 27572 - ], - "type": "integer" - }, - "geneType": { - "examples": [ - "PROTEIN_CODING" - ], - "type": "string" - }, - "omimIds": { - "examples": [ - [ - "600160" - ] - ], - "items": "string", - "type": "array" + ] }, "referenceName": { + "type": "string", "examples": [ "17", "X" - ], - "type": "string" + ] }, "start": { + "type": "integer", "examples": [ 7669608 - ], - "type": "integer" + ] }, - "swissProtAccessions": { + "end": { + "type": "integer", "examples": [ - [ - "P42771", - "Q8N726" - ] - ], - "items": "string", - "type": "array" + 7676593 + ] }, - "symbol": { + "cytobands": { + "type": "string", "examples": [ - "TP53" - ], - "type": "string" + "17p13.1" + ] + }, + "geneLocusLength": { + "type": "integer", + "examples": [ + 27572 + ] }, "synonyms": { + "type": "array", + "items": "string", "examples": [ [ "ARF", @@ -117,16 +91,42 @@ "P19", "INK4" ] - ], + ] + }, + "swissProtAccessions": { + "type": "array", + "items": "string", + "examples": [ + [ + "P42771", + "Q8N726" + ] + ] + }, + "omimIds": { + "type": "array", + "items": "string", + "examples": [ + [ + "600160" + ] + ] + }, + "ensemblGene_Ids": { + "type": "array", "items": "string", - "type": "array" + "examples": [ + [ + "ENSG00000147889" + ] + ] + }, + "geneType": { + "type": "string", + "examples": [ + "PROTEIN_CODING" + ] } }, - "required": { - "all_of": [ - "referenceName start end symbol" - ] - }, - "title": "ProgenetixGene", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-service-schemas/Provenance.json b/bycon/schemas/models/json/progenetix-service-schemas/Provenance.json index ed3c43208..5ddbcce07 100644 --- a/bycon/schemas/models/json/progenetix-service-schemas/Provenance.json +++ b/bycon/schemas/models/json/progenetix-service-schemas/Provenance.json @@ -1,7 +1,8 @@ { - "$id": "https://progenetix.org/services/schemas/Provenance/v2021-11-05", "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "The Provenance class is the wrapper object for schemas informing about technical, geographic or collection associated origin of a higher oreder object such as an Individual or Biosample.\n", + "$id": "https://progenetix.org/services/schemas/Provenance/v2021-11-05", + "title": "Provenance", + "type": "object", "meta": { "contributors": [ { @@ -15,14 +16,15 @@ "id": "https://github.com/progenetix/bycon/" } ], - "sb_status": "community", "used_by": [ { "description": "Progenetix database schema (Beacon+ backend)", "id": "https://github.com/progenetix/schemas/" } - ] + ], + "sb_status": "community" }, + "description": "The Provenance class is the wrapper object for schemas informing about technical, geographic or collection associated origin of a higher oreder object such as an Individual or Biosample.\n", "properties": { "assay": { "$ref": "OntologyClass.json#/properties", @@ -48,7 +50,5 @@ "geo_location": { "$ref": "../progenetix-model/common/GeoLocation.json#/properties" } - }, - "title": "Provenance", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-service-schemas/Publication.json b/bycon/schemas/models/json/progenetix-service-schemas/Publication.json index aa349de30..17d588d94 100644 --- a/bycon/schemas/models/json/progenetix-service-schemas/Publication.json +++ b/bycon/schemas/models/json/progenetix-service-schemas/Publication.json @@ -1,28 +1,8 @@ { - "$id": "https://progenetix.org/services/schemas/Publication/v2021-10-13", "$schema": "https://json-schema.org/draft/2020-12/schema", - "definitions": { - "Contact": { - "properties": { - "affiliation": { - "type": "string" - }, - "email": { - "type": "string" - }, - "name": { - "description": "Name of contact (e.g. corresponding author).", - "examples": [ - "Rasd-Coduresa Diziet Embless Sma da' Marenhide", - "Ion Tichy" - ], - "type": "string" - } - }, - "type": "object" - } - }, - "description": "A Publication represents basic information about a scientific article used in the Progenetix resource to indicate and annotate sources for genomic screening experiments.\n", + "$id": "https://progenetix.org/services/schemas/Publication/v2021-10-13", + "title": "Publication", + "type": "object", "meta": { "contributors": [ { @@ -36,116 +16,136 @@ "id": "https://github.com/progenetix/bycon/" } ], - "sb_status": "community", "used_by": [ { "description": "Progenetix database schema (Beacon+ backend)", "id": "https://github.com/progenetix/schemas/" } - ] + ], + "sb_status": "community" }, + "description": "A Publication represents basic information about a scientific article used in the Progenetix resource to indicate and annotate sources for genomic screening experiments.\n", "properties": { - "abstract": { - "type": "string" - }, - "authors": { + "id": { + "type": "string", "examples": [ - "Weber RG, Bostrom J, Wolter M, Baudis M, Collins VP, Reifenberger G, Lichter P." - ], - "type": "string" + "PMID:22824167" + ] }, - "contact": { - "$ref": "#/definitions/Contact/properties" + "pubmedid": { + "type": "string", + "examples": [ + "22824167" + ] }, - "counts": { - "$ref": "PublicationSampleCounts.json#/properties" + "pmcid": { + "type": "string", + "description": "Id of article in PMC, if there. TODO: into `external_references`?\n" }, - "id": { - "examples": [ - "PMID:22824167" - ], + "title": { "type": "string" }, - "info": { - "type": "object" + "authors": { + "type": "string", + "examples": [ + "Weber RG, Bostrom J, Wolter M, Baudis M, Collins VP, Reifenberger G, Lichter P." + ] }, "journal": { + "type": "string", "examples": [ "Proc. Natl. Acad. Sci. U.S.A. 94(26), 1997" - ], + ] + }, + "pubYear": { + "type": "string", + "examples": [ + "2021" + ] + }, + "abstract": { "type": "string" }, "label": { "description": "An optional informative shortened concatenation of authors / pubYear / title, to be used for labels etc.\n", + "type": "string", "examples": [ "Peralta R, Baudis M, Vazquez G, Juarez S, Ortiz R, Decanini et al. (2010): Increased expression of cellular retinol-binding protein 1 in laryngeal squamous cell carcinoma." - ], - "type": "string" - }, - "note": { - "type": "string" - }, - "pmcid": { - "description": "Id of article in PMC, if there. TODO: into `external_references`?\n", - "type": "string" + ] }, - "provenance": { - "$ref": "Provenance.json#/properties" - }, - "pubYear": { + "status": { + "description": "The status label is used to * disambiguate between Progenetix collection publications and \"excluded\" ones (i.e. not containing original genotyping data * add some information about reasons for the exclusion, e.g. for later access to currently out off scope articles\n", + "type": "string", "examples": [ - "2021" - ], - "type": "string" + "excluded [non-sensical study of invented disease]", + "excluded [pooled samples]", + "excluded [population study]", + "excluded [review]" + ] }, - "pubmedid": { - "examples": [ - "22824167" - ], - "type": "string" + "counts": { + "$ref": "PublicationSampleCounts.json#/properties" }, "sampleTypes": { "description": "A list of ontology with counts objects, indicating the best approximation of the diagnoses or other features of the analyzed samples.\n", + "type": "array", + "items": { + "$ref": "OntologyClass.json#/properties" + }, "examples": [ [ { - "count": 221, "id": "NCIT:C96963", - "label": "Digestive System Carcinoma" + "label": "Digestive System Carcinoma", + "count": 221 }, { - "count": 68, "id": "NCIT:C3406", - "label": "Thoracic Neoplasm" + "label": "Thoracic Neoplasm", + "count": 68 } ] - ], - "items": { - "$ref": "OntologyClass.json#/properties" - }, - "type": "array" + ] }, - "status": { - "description": "The status label is used to * disambiguate between Progenetix collection publications and \"excluded\" ones (i.e. not containing original genotyping data * add some information about reasons for the exclusion, e.g. for later access to currently out off scope articles\n", - "examples": [ - "excluded [non-sensical study of invented disease]", - "excluded [pooled samples]", - "excluded [population study]", - "excluded [review]" - ], + "note": { "type": "string" }, - "title": { - "type": "string" + "contact": { + "$ref": "#/definitions/Contact/properties" + }, + "provenance": { + "$ref": "Provenance.json#/properties" + }, + "info": { + "type": "object" }, "updated": { + "type": "string", + "format": "date-time", "examples": [ "2020-09-10T17:44:10.170Z" - ], - "format": "date-time", - "type": "string" + ] } }, - "title": "Publication", - "type": "object" + "definitions": { + "Contact": { + "type": "object", + "properties": { + "name": { + "description": "Name of contact (e.g. corresponding author).", + "type": "string", + "examples": [ + "Rasd-Coduresa Diziet Embless Sma da' Marenhide", + "Ion Tichy" + ] + }, + "email": { + "type": "string" + }, + "affiliation": { + "type": "string" + } + } + } + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-service-schemas/PublicationSampleCounts.json b/bycon/schemas/models/json/progenetix-service-schemas/PublicationSampleCounts.json index 91f9f1eb1..6ef204640 100644 --- a/bycon/schemas/models/json/progenetix-service-schemas/PublicationSampleCounts.json +++ b/bycon/schemas/models/json/progenetix-service-schemas/PublicationSampleCounts.json @@ -1,7 +1,8 @@ { - "$id": "https://progenetix.org/services/schemas/PublicationSampleCounts/v2021-04-13", "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "PublicationSampleCounts contains the count data for publication content, used for the Progenetix publications collection.\n", + "$id": "https://progenetix.org/services/schemas/PublicationSampleCounts/v2021-04-13", + "title": "PublicationSampleCounts", + "type": "object", "meta": { "contributors": [ { @@ -15,44 +16,43 @@ "id": "https://github.com/progenetix/bycon/" } ], - "sb_status": "community", "used_by": [ { "description": "Progenetix database schema (Beacon+ backend)", "id": "https://github.com/progenetix/schemas/" } - ] + ], + "sb_status": "community" }, + "description": "PublicationSampleCounts contains the count data for publication content, used for the Progenetix publications collection.\n", "properties": { + "ccgh": { + "description": "The number of samples reported in this publication analyzed by chromosomal Comparative Genomic Hybridization (CGH)\n", + "type": "integer" + }, "acgh": { "description": "The number of samples reported in this publication analyzed by any type of genomic hybridization array\n", "type": "integer" }, - "ccgh": { - "description": "The number of samples reported in this publication analyzed by chromosomal Comparative Genomic Hybridization (CGH)\n", + "wes": { + "description": "The number of samples reported in this publication analyzed by whole exome sequencing (WES)\n", "type": "integer" }, - "genomes": { - "description": "The number of samples reported in this publication analyzed. The number is at least the maximum of ccgh, acgh, wes, wgs.\n", + "wgs": { + "description": "The number of samples reported in this publication analyzed by whole genome sequencing (WGS)\n", "type": "integer" }, "ngs": { "description": "The number of samples reported in this publication analyzed by any of WGS and/or WES. The number is at least the maximum of wes and wgs.\n", "type": "integer" }, - "progenetix": { - "description": "The number of samples from this publication in the Progenetix biosamples collection\n", - "type": "integer" - }, - "wes": { - "description": "The number of samples reported in this publication analyzed by whole exome sequencing (WES)\n", + "genomes": { + "description": "The number of samples reported in this publication analyzed. The number is at least the maximum of ccgh, acgh, wes, wgs.\n", "type": "integer" }, - "wgs": { - "description": "The number of samples reported in this publication analyzed by whole genome sequencing (WGS)\n", + "progenetix": { + "description": "The number of samples from this publication in the Progenetix biosamples collection\n", "type": "integer" } - }, - "title": "PublicationSampleCounts", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-service-schemas/QueryBufferItem.json b/bycon/schemas/models/json/progenetix-service-schemas/QueryBufferItem.json index d6370a235..6167102ff 100644 --- a/bycon/schemas/models/json/progenetix-service-schemas/QueryBufferItem.json +++ b/bycon/schemas/models/json/progenetix-service-schemas/QueryBufferItem.json @@ -1,7 +1,8 @@ { - "$id": "https://progenetix.org/services/schemas/QueryBufferItem/v2020-12-08", "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "This schema represents objects for the temporary storage of Progenetix / bycon\nquery results.\n", + "$id": "https://progenetix.org/services/schemas/QueryBufferItem/v2020-12-08", + "title": "QueryBufferItem", + "type": "object", "meta": { "contributors": [ { @@ -15,67 +16,66 @@ "id": "https://github.com/progenetix/bycon/" } ], - "sb_status": "community", "used_by": [ { "description": "Progenetix database schema (Beacon+ backend)", "id": "https://github.com/progenetix/schemas/" } - ] + ], + "sb_status": "community" }, + "description": "This schema represents objects for the temporary storage of Progenetix / bycon\nquery results.\n", "properties": { "id": { + "type": "string", "description": "The unique identifier of this query result object in string format, e.g.\nas a UUID v4.\n", "examples": [ "37cff434-2c4d-11eb-827a-c21bd2cbdf2b" - ], - "type": "string" - }, - "sourceCollection": { - "description": "The gatabase collection that was queried to gather the response items.\n", - "examples": [ - "analyses" - ], - "type": "string" + ] }, "sourceDb": { + "type": "string", "description": "The name of the database the query belongs to.\n", "examples": [ "progenetix" - ], - "type": "string" + ] + }, + "sourceCollection": { + "type": "string", + "description": "The gatabase collection that was queried to gather the response items.\n", + "examples": [ + "analyses" + ] }, "sourceKey": { - "description": "The key in the sourceCollection that provided the response values stored\nin this QueryBufferItem.\n", - "type": "string" + "type": "string", + "description": "The key in the sourceCollection that provided the response values stored\nin this QueryBufferItem.\n" }, "targetCollection": { + "type": "string", "description": "The database collection that should be queried with the targetValues.\n", "examples": [ "biosamples" - ], - "type": "string" - }, - "targetCount": { - "type": "integer" + ] }, "targetKey": { + "type": "string", "description": "The key in the targetCollection that should be used for creating a query\nagainst, using the targetValues.\n", "examples": [ "_id", "id", "biosample_id" - ], - "type": "string" + ] + }, + "targetCount": { + "type": "integer" }, "targetValues": { + "type": "array", "description": "The identifiers (e.g. biosample_id values or _id ObjectId values) used to retrieve tha data through matching them to the targetKey in the targetCollection. NOTE - While the type here is given as string they may also be internal identifiers such as MongoDB ObjectId entries.", "items": { "type": "string" - }, - "type": "array" + } } - }, - "title": "QueryBufferItem", - "type": "object" + } } \ No newline at end of file diff --git a/bycon/schemas/models/json/progenetix-service-schemas/cytobandMapping.json b/bycon/schemas/models/json/progenetix-service-schemas/cytobandMapping.json index 88ba778e3..3d8a6a362 100644 --- a/bycon/schemas/models/json/progenetix-service-schemas/cytobandMapping.json +++ b/bycon/schemas/models/json/progenetix-service-schemas/cytobandMapping.json @@ -1,7 +1,8 @@ { - "$id": "https://progenetix.org/services/schemas/CytobandMapping/v2023-08-26", "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": true, + "$id": "https://progenetix.org/services/schemas/CytobandMapping/v2023-08-26", + "title": "Cytoband Mapping", + "type": "object", "description": "The cytoband mapping provides information about a genomic range for: * the cytogenetic bands involved, from pter to qter direction * the corresponding start and end base positions", "properties": { "chromosomeLocation": { @@ -11,6 +12,5 @@ "$ref": "https://raw.githubusercontent.com/ga4gh/vrs/1.2/schema/vrs.json#/definitions/SequenceLocation" } }, - "title": "Cytoband Mapping", - "type": "object" + "additionalProperties": true } \ No newline at end of file diff --git a/docs/changes.md b/docs/changes.md index 2c472859b..4b882617a 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -13,6 +13,20 @@ through the Perl based [**PGX** project](http://github.com/progenetix/PGX/). ## Changes Tracker +### 2024-02-07 (v.1.4.2) + +* more consolidation of argument/cgi parsing libraries +* filter flag parameters now properly defined in `argument_definitions.yaml` +* use of a common `db_config` object for database configuration parameters +* piecemeal move of placeholder parameters from `config.yaml` (either + through removal & fallbacks in methods, or through definition in + `argument_definitions`) +* working on error responses... +* removed generic pre-processing methods for error & general responses +* fixed a bug which allowed non-matching filters to pass +* fixed examples in `tests` +* fixed `POST` processing (wrong `filters` nesting as in examples ...) + ### 2024-02-02 (v.1.4.1) * new `ChroNames` class for accessing chromosome and refseq ID mappings (still utilising diff --git a/setup.py b/setup.py index c2bc129fe..1d1b48b38 100755 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( name="bycon", - version="1.4.1", + version="1.4.2", description="A Python-based environment for the Beacon v2 genomics API", long_description=long_description, long_description_content_type="text/markdown",