From b3e71cf48ce8710b64270a1afdf74a545331474c Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Fri, 30 Sep 2022 17:37:11 +0200 Subject: [PATCH 01/20] added document endpoint --- pom.xml | 2 +- schemas/top-api.yml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 407f581..130c1bc 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ care.smith.top top-api - 0.5.0 + 0.5.1-SNAPSHOT TOP API REST API of the TOP framework diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 912cf46..6f4abff 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: TOP API - version: 0.5.0 + version: 0.5.1 description: API to manage phenotypes, repositories, ontologies and organisations servers: @@ -56,6 +56,8 @@ paths: $ref: "#/components/responses/UnexpectedError" /document: + parameters: + - $ref: "#/components/parameters/include" get: summary: Searches for documents operationId: getDocuments @@ -63,8 +65,8 @@ paths: - document parameters: - name: id + description: Filter document by id. in: query - description: Filter documents by their id. schema: type: string responses: From 668c474336fed5b9454ee1989fba672c5c5088dd Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Tue, 4 Oct 2022 17:32:19 +0200 Subject: [PATCH 02/20] document frontend has now access to phrases of documents as well and not only text; restructured nlp specific classes in the backend --- schemas/top-api.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 6f4abff..8ad25f0 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -69,6 +69,16 @@ paths: in: query schema: type: string + - name: page + description: Get specific Page of a Pageable + in: query + schema: + type: integer + - name: pageSize + description: Specify number of elements of a Page of a Pageable + in: query + schema: + type: integer responses: 200: description: List of documents @@ -1953,6 +1963,10 @@ components: type: string text: type: string + phrases: + type: array + items: + type: string securitySchemes: BearerAuth: From 45045fd728e41b590059911c7d376a275b8fdc39 Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Wed, 5 Oct 2022 21:36:05 +0200 Subject: [PATCH 03/20] added support for concept and phrase retrieval --- schemas/top-api.yml | 53 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 8ad25f0..5804b21 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -93,6 +93,39 @@ paths: default: $ref: "#/components/responses/UnexpectedError" + /phrase: + parameters: + - $ref: "#/components/parameters/include" + get: + summary: Searches for phrases + operationId: getPhrases + tags: + - phrase + parameters: + - name: id + description: Search phrase by id. + in: query + schema: + type: string + - name: text + description: Search phrase by text + in: query + schema: + type: string + responses: + 200: + description: List of phrases + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Phrase" + 401: + $ref: "#/components/responses/Unauthorized" + default: + $ref: "#/components/responses/UnexpectedError" + /organisation: parameters: - $ref: "#/components/parameters/include" @@ -1953,6 +1986,10 @@ components: description: Number of phenotypes type: integer format: int64 + documents: + description: Number of documents + type: integer + format: int64 Document: type: object @@ -1968,6 +2005,22 @@ components: items: type: string + Phrase: + type: object + required: + - id + properties: + id: + type: string + text: + type: string + isExemplar: + type: boolean + attributes: + type: array + items: + type: string + securitySchemes: BearerAuth: type: http From 56877ede0a667ff1efcceeaa9c21903aafd79c1a Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Thu, 6 Oct 2022 13:57:05 +0200 Subject: [PATCH 04/20] concepts are now displayed on frontend; corrected display of phrases in document table --- schemas/top-api.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 5804b21..20e6770 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -126,6 +126,39 @@ paths: default: $ref: "#/components/responses/UnexpectedError" + /concept: + parameters: + - $ref: "#/components/parameters/include" + get: + summary: Searches for concepts + operationId: getConcepts + tags: + - concept + parameters: + - name: id + description: Search concept by id. + in: query + schema: + type: string + - name: phrase + description: Search concept by phrase + in: query + schema: + type: string + responses: + 200: + description: List of concepts + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Concept" + 401: + $ref: "#/components/responses/Unauthorized" + default: + $ref: "#/components/responses/UnexpectedError" + /organisation: parameters: - $ref: "#/components/parameters/include" @@ -2021,6 +2054,16 @@ components: items: type: string + Concept: + type: object + required: + - id + properties: + id: + type: string + text: + type: string + securitySchemes: BearerAuth: type: http From 330cc55678bffb66dc346bde6c2a5a8ba93aa31e Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Thu, 6 Oct 2022 21:27:33 +0200 Subject: [PATCH 05/20] started implementing click actions --- schemas/top-api.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 20e6770..edf4b06 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -112,6 +112,11 @@ paths: in: query schema: type: string + - name: concept + description: Search phrase by concept + in: query + schema: + type: string responses: 200: description: List of phrases From 6d836732f8e93b9a41abef403297801aaf03140e Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Fri, 7 Oct 2022 17:15:26 +0200 Subject: [PATCH 06/20] restructured db a bit - now Concepts are their own Nodes; needed to adapt CYPHER DSL calls accordingly --- schemas/top-api.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index edf4b06..2e014f3 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -2066,7 +2066,7 @@ components: properties: id: type: string - text: + labels: type: string securitySchemes: From bf5f2ac11cdf94739c0f44d5fcf6a4b934378c45 Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Fri, 30 Sep 2022 17:37:11 +0200 Subject: [PATCH 07/20] added document endpoint --- pom.xml | 2 +- schemas/top-api.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e79da86..834b1aa 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ care.smith.top top-api - 0.5.1 + 0.5.1-SNAPSHOT TOP API REST API of the TOP framework diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 1709a5b..1753ff4 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -56,6 +56,8 @@ paths: $ref: "#/components/responses/UnexpectedError" /document: + parameters: + - $ref: "#/components/parameters/include" get: summary: Searches for documents operationId: getDocuments @@ -63,8 +65,8 @@ paths: - document parameters: - name: id + description: Filter document by id. in: query - description: Filter documents by their id. schema: type: string responses: From 5b5cdf5890dbb0fbc2f82bd7148fcd05b3368efa Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Tue, 4 Oct 2022 17:32:19 +0200 Subject: [PATCH 08/20] document frontend has now access to phrases of documents as well and not only text; restructured nlp specific classes in the backend --- schemas/top-api.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 1753ff4..abdf090 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -69,6 +69,16 @@ paths: in: query schema: type: string + - name: page + description: Get specific Page of a Pageable + in: query + schema: + type: integer + - name: pageSize + description: Specify number of elements of a Page of a Pageable + in: query + schema: + type: integer responses: 200: description: List of documents @@ -1980,6 +1990,10 @@ components: type: string text: type: string + phrases: + type: array + items: + type: string securitySchemes: BearerAuth: From 9fe065c5b2e2cea8fe12bb08bc9d6a19cb4704c4 Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Wed, 5 Oct 2022 21:36:05 +0200 Subject: [PATCH 09/20] added support for concept and phrase retrieval --- schemas/top-api.yml | 53 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index abdf090..58413e6 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -93,6 +93,39 @@ paths: default: $ref: "#/components/responses/UnexpectedError" + /phrase: + parameters: + - $ref: "#/components/parameters/include" + get: + summary: Searches for phrases + operationId: getPhrases + tags: + - phrase + parameters: + - name: id + description: Search phrase by id. + in: query + schema: + type: string + - name: text + description: Search phrase by text + in: query + schema: + type: string + responses: + 200: + description: List of phrases + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Phrase" + 401: + $ref: "#/components/responses/Unauthorized" + default: + $ref: "#/components/responses/UnexpectedError" + /organisation: parameters: - $ref: "#/components/parameters/include" @@ -1980,6 +2013,10 @@ components: description: Number of phenotypes type: integer format: int64 + documents: + description: Number of documents + type: integer + format: int64 Document: type: object @@ -1995,6 +2032,22 @@ components: items: type: string + Phrase: + type: object + required: + - id + properties: + id: + type: string + text: + type: string + isExemplar: + type: boolean + attributes: + type: array + items: + type: string + securitySchemes: BearerAuth: type: http From c11d58d23f3c6f32a916b20ca0ae7422da265881 Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Thu, 6 Oct 2022 13:57:05 +0200 Subject: [PATCH 10/20] concepts are now displayed on frontend; corrected display of phrases in document table --- schemas/top-api.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 58413e6..6ba6198 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -126,6 +126,39 @@ paths: default: $ref: "#/components/responses/UnexpectedError" + /concept: + parameters: + - $ref: "#/components/parameters/include" + get: + summary: Searches for concepts + operationId: getConcepts + tags: + - concept + parameters: + - name: id + description: Search concept by id. + in: query + schema: + type: string + - name: phrase + description: Search concept by phrase + in: query + schema: + type: string + responses: + 200: + description: List of concepts + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Concept" + 401: + $ref: "#/components/responses/Unauthorized" + default: + $ref: "#/components/responses/UnexpectedError" + /organisation: parameters: - $ref: "#/components/parameters/include" @@ -2048,6 +2081,16 @@ components: items: type: string + Concept: + type: object + required: + - id + properties: + id: + type: string + text: + type: string + securitySchemes: BearerAuth: type: http From 1e406274df64de614d9d6dd2e6350102e9149df1 Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Thu, 6 Oct 2022 21:27:33 +0200 Subject: [PATCH 11/20] started implementing click actions --- schemas/top-api.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 6ba6198..1cbcdbc 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -112,6 +112,11 @@ paths: in: query schema: type: string + - name: concept + description: Search phrase by concept + in: query + schema: + type: string responses: 200: description: List of phrases From c367150e70e5ab3155522ccd29084cef678ef74e Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Fri, 7 Oct 2022 17:15:26 +0200 Subject: [PATCH 12/20] restructured db a bit - now Concepts are their own Nodes; needed to adapt CYPHER DSL calls accordingly --- schemas/top-api.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 1cbcdbc..baccc3b 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -2093,7 +2093,7 @@ components: properties: id: type: string - text: + labels: type: string securitySchemes: From 1b35ca30a91451f2df653133a99cd47c3dbbb230 Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Tue, 18 Oct 2022 14:55:18 +0200 Subject: [PATCH 13/20] additions and restructuring for more intelligent and better access of documents, phrase & concepts --- schemas/top-api.yml | 337 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 314 insertions(+), 23 deletions(-) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index baccc3b..a941d2e 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -64,21 +64,26 @@ paths: tags: - document parameters: - - name: id - description: Filter document by id. + - name: phraseText + description: Filter document by containing phrase. in: query schema: type: string - - name: page - description: Get specific Page of a Pageable + - name: conceptText + description: Filter document by containing concept. in: query schema: - type: integer - - name: pageSize - description: Specify number of elements of a Page of a Pageable + type: string + - name: phraseId + description: Filter document by containing phrase id. + in: query + schema: + type: string + - name: conceptId + description: Filter document by containing concept id. in: query schema: - type: integer + type: string responses: 200: description: List of documents @@ -93,30 +98,157 @@ paths: default: $ref: "#/components/responses/UnexpectedError" - /phrase: + /{conceptId}/document: + parameters: + - name: conceptId + in: path + required: true + schema: + type: string + - $ref: "#/components/parameters/include" + get: + summary: Searches for documents from a specific concept cluster. Use the query parameters to filter the result. + operationId: getDocumentByConceptId + tags: + - document + parameters: + - name: name + description: Filter documents by name. + in: query + schema: + type: string + - $ref: "#/components/parameters/page" + responses: + 200: + description: List of documents + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Document" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + default: + $ref: "#/components/responses/UnexpectedError" + + /{phraseId}/document: + parameters: + - name: phraseId + in: path + required: true + schema: + type: string + - $ref: "#/components/parameters/include" + get: + summary: Searches for documents that contain a specific phrase. Use the query parameters to filter the result. + operationId: getDocumentByPhraseId + tags: + - document + parameters: + - name: name + description: Filter documents by name. + in: query + schema: + type: string + - $ref: "#/components/parameters/page" + responses: + 200: + description: List of documents + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Document" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + default: + $ref: "#/components/responses/UnexpectedError" + + /{documentId}: + summary: Represents a document parameters: + - name: documentId + in: path + required: true + schema: + type: string - $ref: "#/components/parameters/include" + get: + summary: Returns a particular document + operationId: getDocumentById + tags: + - document + responses: + 200: + description: Details of the Document + content: + application/json: + schema: + $ref: "#/components/schemas/Document" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + default: + $ref: "#/components/responses/UnexpectedError" + + /phrase: get: summary: Searches for phrases operationId: getPhrases tags: - phrase parameters: - - name: id - description: Search phrase by id. + - name: text + description: Search phrase by text in: query schema: type: string - - name: text - description: Search phrase by text + - name: conceptText + description: Search phrase by concept text in: query schema: type: string - - name: concept - description: Search phrase by concept + responses: + 200: + description: List of phrases + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Phrase" + 401: + $ref: "#/components/responses/Unauthorized" + default: + $ref: "#/components/responses/UnexpectedError" + + /{conceptId}/phrase: + parameters: + - name: conceptId + in: path + required: true + schema: + type: string + - $ref: "#/components/parameters/include" + get: + summary: Searches for phrases that are contained in a specific concept. Use the query parameters to filter the result. + operationId: getPhraseByConceptId + tags: + - phrase + parameters: + - name: name + description: Filter phrases by name. in: query schema: type: string + - $ref: "#/components/parameters/page" responses: 200: description: List of phrases @@ -128,24 +260,83 @@ paths: $ref: "#/components/schemas/Phrase" 401: $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" default: $ref: "#/components/responses/UnexpectedError" - /concept: + /{documentId}/phrase: + parameters: + - name: documentId + in: path + required: true + schema: + type: string + - $ref: "#/components/parameters/include" + get: + summary: Searches for phrases that are contained in a specific document. Use the query parameters to filter the result. + operationId: getPhraseByDocumentId + tags: + - phrase parameters: - - $ref: "#/components/parameters/include" + - name: name + description: Filter phrases by name. + in: query + schema: + type: string + - $ref: "#/components/parameters/page" + responses: + 200: + description: List of phrases + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Phrase" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + default: + $ref: "#/components/responses/UnexpectedError" + + /{phraseId}: + summary: Represents a Phrase + parameters: + - name: phraseId + in: path + required: true + schema: + type: string + - $ref: "#/components/parameters/include" + get: + summary: Returns a particular Phrase + operationId: getPhraseById + tags: + - phrase + responses: + 200: + description: Details of the Phrase + content: + application/json: + schema: + $ref: "#/components/schemas/Phrase" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + default: + $ref: "#/components/responses/UnexpectedError" + + /concept: get: summary: Searches for concepts operationId: getConcepts tags: - concept parameters: - - name: id - description: Search concept by id. - in: query - schema: - type: string - - name: phrase + - name: phraseText description: Search concept by phrase in: query schema: @@ -164,6 +355,106 @@ paths: default: $ref: "#/components/responses/UnexpectedError" + /{phraseId}/concept: + parameters: + - name: phraseId + in: path + required: true + schema: + type: string + - $ref: "#/components/parameters/include" + get: + summary: Searches for concepts that contain a specific phrase. Use the query parameters to filter the result. + operationId: getConceptByPhraseId + tags: + - concept + parameters: + - name: name + description: Filter concepts by name. + in: query + schema: + type: string + - $ref: "#/components/parameters/page" + responses: + 200: + description: List of concepts + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Concept" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + default: + $ref: "#/components/responses/UnexpectedError" + + /{documentId}/concept: + parameters: + - name: documentId + in: path + required: true + schema: + type: string + - $ref: "#/components/parameters/include" + get: + summary: Searches for concepts that are contained in a specific document. Use the query parameters to filter the result. + operationId: getConceptByDocumentId + tags: + - concept + parameters: + - name: name + description: Filter concepts by name. + in: query + schema: + type: string + - $ref: "#/components/parameters/page" + responses: + 200: + description: List of concepts + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Concept" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + default: + $ref: "#/components/responses/UnexpectedError" + + /{conceptId}: + summary: Represents a concept + parameters: + - name: conceptId + in: path + required: true + schema: + type: string + - $ref: "#/components/parameters/include" + get: + summary: Returns a particular concept + operationId: getConceptById + tags: + - concept + responses: + 200: + description: Details of the Concept + content: + application/json: + schema: + $ref: "#/components/schemas/Concept" + 401: + $ref: "#/components/responses/Unauthorized" + 404: + $ref: "#/components/responses/NotFound" + default: + $ref: "#/components/responses/UnexpectedError" + /organisation: parameters: - $ref: "#/components/parameters/include" From 6a4b860d1f133fd4fc620166cf8230e04a81cbfe Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Thu, 20 Oct 2022 15:10:11 +0200 Subject: [PATCH 14/20] further work on DocumentSearch and backend access --- schemas/top-api.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index a941d2e..63e08c8 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -98,7 +98,7 @@ paths: default: $ref: "#/components/responses/UnexpectedError" - /{conceptId}/document: + /document/concept/{conceptId}: parameters: - name: conceptId in: path @@ -134,7 +134,7 @@ paths: default: $ref: "#/components/responses/UnexpectedError" - /{phraseId}/document: + /document/phrase/{phraseId}: parameters: - name: phraseId in: path @@ -170,7 +170,7 @@ paths: default: $ref: "#/components/responses/UnexpectedError" - /{documentId}: + /document/{documentId}: summary: Represents a document parameters: - name: documentId @@ -229,7 +229,7 @@ paths: default: $ref: "#/components/responses/UnexpectedError" - /{conceptId}/phrase: + /phrase/concept/{conceptId}: parameters: - name: conceptId in: path @@ -265,7 +265,7 @@ paths: default: $ref: "#/components/responses/UnexpectedError" - /{documentId}/phrase: + /phrase/document/{documentId}: parameters: - name: documentId in: path @@ -301,7 +301,7 @@ paths: default: $ref: "#/components/responses/UnexpectedError" - /{phraseId}: + /phrase/{phraseId}: summary: Represents a Phrase parameters: - name: phraseId @@ -355,7 +355,7 @@ paths: default: $ref: "#/components/responses/UnexpectedError" - /{phraseId}/concept: + /concept/phrase/{phraseId}: parameters: - name: phraseId in: path @@ -391,7 +391,7 @@ paths: default: $ref: "#/components/responses/UnexpectedError" - /{documentId}/concept: + /concept/document/{documentId}: parameters: - name: documentId in: path @@ -427,7 +427,7 @@ paths: default: $ref: "#/components/responses/UnexpectedError" - /{conceptId}: + /concept/{conceptId}: summary: Represents a concept parameters: - name: conceptId From bbfef5df607bea525c33c846c7f5f30cbea5c032 Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Sun, 30 Oct 2022 21:00:21 +0100 Subject: [PATCH 15/20] color!!! --- schemas/top-api.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 63e08c8..61964b9 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -105,10 +105,15 @@ paths: required: true schema: type: string + - name: idOnly + in: query + schema: + type: boolean + default: true - $ref: "#/components/parameters/include" get: summary: Searches for documents from a specific concept cluster. Use the query parameters to filter the result. - operationId: getDocumentByConceptId + operationId: getDocumentsByConceptId tags: - document parameters: From 6c9490154eb567b81c642f81c8abe52543a1e4d8 Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Thu, 3 Nov 2022 17:34:50 +0100 Subject: [PATCH 16/20] concept selection union and stuff --- schemas/top-api.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 61964b9..45b5462 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -104,7 +104,9 @@ paths: in: path required: true schema: - type: string + type: array + items: + type: string - name: idOnly in: query schema: @@ -112,8 +114,8 @@ paths: default: true - $ref: "#/components/parameters/include" get: - summary: Searches for documents from a specific concept cluster. Use the query parameters to filter the result. - operationId: getDocumentsByConceptId + summary: Searches for documents from specific concept clusters. Use the query parameters to filter the result. + operationId: getDocumentsByConceptIds tags: - document parameters: From 15aa863174f395d9bdfe84af558ab7f68082e6ae Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Fri, 4 Nov 2022 12:28:35 +0100 Subject: [PATCH 17/20] concept selection now with mode selection: union, intersection or exclusive --- schemas/top-api.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index 45b5462..a3295bd 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -107,24 +107,27 @@ paths: type: array items: type: string - - name: idOnly - in: query - schema: - type: boolean - default: true - - $ref: "#/components/parameters/include" get: summary: Searches for documents from specific concept clusters. Use the query parameters to filter the result. operationId: getDocumentsByConceptIds tags: - document parameters: + - name: idOnly + in: query + schema: + type: boolean + default: true + - name: gatheringMode + in: query + schema: + type: string + default: exclusive - name: name description: Filter documents by name. in: query schema: type: string - - $ref: "#/components/parameters/page" responses: 200: description: List of documents From 9c7ec4d38b584566c8ba84eaa9de46019e045c66 Mon Sep 17 00:00:00 2001 From: Christoph Beger Date: Mon, 14 Nov 2022 15:03:24 +0100 Subject: [PATCH 18/20] Add repository type property --- pom.xml | 2 +- schemas/top-api.yml | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 834b1aa..f8fdd21 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ care.smith.top top-api - 0.5.1-SNAPSHOT + 0.6.0 TOP API REST API of the TOP framework diff --git a/schemas/top-api.yml b/schemas/top-api.yml index a3295bd..e8075dc 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: TOP API - version: 0.5.1 + version: 0.6.0 description: API to manage phenotypes, repositories, ontologies and organisations servers: @@ -623,6 +623,11 @@ paths: in: query schema: type: boolean + - name: type + description: Filter repositories by type. + in: query + schema: + $ref: "#/components/schemas/RepositoryType" - $ref: "#/components/parameters/page" responses: 200: @@ -727,6 +732,11 @@ paths: in: query schema: type: string + - name: type + description: Filter repositories by type. + in: query + schema: + $ref: "#/components/schemas/RepositoryType" - $ref: "#/components/parameters/page" responses: 200: @@ -1676,6 +1686,16 @@ components: format: date-time organisation: $ref: "#/components/schemas/Organisation" + repositoryType: + $ref: "#/components/schemas/RepositoryType" + + RepositoryType: + type: string + description: > + The type of a repository. It determines the content a repository can hold. + enum: + - phenotype_repository + - concept_repository Ontology: type: object From ba2251cb0ad2089783c5b4d4fe0a32d6d126f541 Mon Sep 17 00:00:00 2001 From: Franz Matthies Date: Wed, 14 Dec 2022 15:11:47 +0100 Subject: [PATCH 19/20] Merge branch 'main' into nlp-additions # Conflicts: # pom.xml # schemas/top-api.yml --- schemas/top-api.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index b5c83dd..e56b322 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -80,6 +80,8 @@ paths: in: query schema: type: string + tags: + - document responses: 200: description: List of documents @@ -613,12 +615,12 @@ paths: description: Filter repositories by primary state. schema: type: boolean - - $ref: '#/components/parameters/page' - name: type description: Filter repositories by type. in: query schema: $ref: "#/components/schemas/RepositoryType" + - $ref: '#/components/parameters/page' responses: '200': description: List of repositories. @@ -720,12 +722,12 @@ paths: description: Filter repositories by name. schema: type: string - - $ref: '#/components/parameters/page' - name: type description: Filter repositories by type. in: query schema: $ref: "#/components/schemas/RepositoryType" + - $ref: '#/components/parameters/page' responses: '200': description: List of repositories. From 52ce6c2a34f9cc3d8589304cbde492befdc4ab6d Mon Sep 17 00:00:00 2001 From: Christoph Beger Date: Wed, 14 Dec 2022 15:50:14 +0100 Subject: [PATCH 20/20] Reformat schema --- schemas/top-api.yml | 361 +++++++++++++++++++++----------------------- 1 file changed, 172 insertions(+), 189 deletions(-) diff --git a/schemas/top-api.yml b/schemas/top-api.yml index e56b322..ec97f75 100644 --- a/schemas/top-api.yml +++ b/schemas/top-api.yml @@ -55,48 +55,47 @@ paths: - BasicAuth: [] /document: parameters: - - $ref: "#/components/parameters/include" + - $ref: '#/components/parameters/include' get: operationId: getDocuments summary: Searches for documents. parameters: - name: phraseText - description: Filter document by containing phrase. in: query + description: Filter document by containing phrase. schema: type: string - name: conceptText - description: Filter document by containing concept. in: query + description: Filter document by containing concept. schema: type: string - name: phraseId - description: Filter document by containing phrase id. in: query + description: Filter document by containing phrase id. schema: type: string - name: conceptId - description: Filter document by containing concept id. in: query + description: Filter document by containing concept id. schema: type: string - tags: - - document responses: - 200: + '200': description: List of documents content: application/json: schema: type: array items: - $ref: "#/components/schemas/Document" - 401: - $ref: "#/components/responses/Unauthorized" + $ref: '#/components/schemas/Document' + '401': + $ref: '#/components/responses/Unauthorized' default: - $ref: "#/components/responses/UnexpectedError" - - /document/concept/{conceptId}: + $ref: '#/components/responses/UnexpectedError' + tags: + - document + '/document/concept/{conceptId}': parameters: - name: conceptId in: path @@ -106,10 +105,8 @@ paths: items: type: string get: - summary: Searches for documents from specific concept clusters. Use the query parameters to filter the result. operationId: getDocumentsByConceptIds - tags: - - document + summary: Searches for documents from specific concept clusters. Use the query parameters to filter the result. parameters: - name: idOnly in: query @@ -122,8 +119,8 @@ paths: type: string default: exclusive - name: name - description: Filter documents by name. in: query + description: Filter documents by name. schema: type: string responses: @@ -135,50 +132,50 @@ paths: type: array items: $ref: '#/components/schemas/Document' - 401: - $ref: "#/components/responses/Unauthorized" - 404: - $ref: "#/components/responses/NotFound" + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' default: - $ref: "#/components/responses/UnexpectedError" - - /document/phrase/{phraseId}: + $ref: '#/components/responses/UnexpectedError' + tags: + - document + '/document/phrase/{phraseId}': parameters: - name: phraseId in: path required: true schema: type: string - - $ref: "#/components/parameters/include" + - $ref: '#/components/parameters/include' get: - summary: Searches for documents that contain a specific phrase. Use the query parameters to filter the result. operationId: getDocumentByPhraseId - tags: - - document + summary: Searches for documents that contain a specific phrase. Use the query parameters to filter the result. parameters: - name: name - description: Filter documents by name. in: query + description: Filter documents by name. schema: type: string - - $ref: "#/components/parameters/page" + - $ref: '#/components/parameters/page' responses: - 200: + '200': description: List of documents content: application/json: schema: type: array items: - $ref: "#/components/schemas/Document" - 401: - $ref: "#/components/responses/Unauthorized" - 404: - $ref: "#/components/responses/NotFound" + $ref: '#/components/schemas/Document' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' default: - $ref: "#/components/responses/UnexpectedError" - - /document/{documentId}: + $ref: '#/components/responses/UnexpectedError' + tags: + - document + '/document/{documentId}': summary: Represents a document parameters: - name: documentId @@ -186,130 +183,126 @@ paths: required: true schema: type: string - - $ref: "#/components/parameters/include" + - $ref: '#/components/parameters/include' get: - summary: Returns a particular document operationId: getDocumentById - tags: - - document + summary: Returns a particular document responses: - 200: + '200': description: Details of the Document content: application/json: schema: - $ref: "#/components/schemas/Document" - 401: - $ref: "#/components/responses/Unauthorized" - 404: - $ref: "#/components/responses/NotFound" + $ref: '#/components/schemas/Document' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' default: - $ref: "#/components/responses/UnexpectedError" - + $ref: '#/components/responses/UnexpectedError' + tags: + - document /phrase: get: - summary: Searches for phrases operationId: getPhrases - tags: - - phrase + summary: Searches for phrases parameters: - name: text - description: Search phrase by text in: query + description: Search phrase by text schema: type: string - name: conceptText - description: Search phrase by concept text in: query + description: Search phrase by concept text schema: type: string responses: - 200: + '200': description: List of phrases content: application/json: schema: type: array items: - $ref: "#/components/schemas/Phrase" - 401: - $ref: "#/components/responses/Unauthorized" + $ref: '#/components/schemas/Phrase' + '401': + $ref: '#/components/responses/Unauthorized' default: - $ref: "#/components/responses/UnexpectedError" - - /phrase/concept/{conceptId}: + $ref: '#/components/responses/UnexpectedError' + tags: + - phrase + '/phrase/concept/{conceptId}': parameters: - name: conceptId in: path required: true schema: type: string - - $ref: "#/components/parameters/include" + - $ref: '#/components/parameters/include' get: - summary: Searches for phrases that are contained in a specific concept. Use the query parameters to filter the result. operationId: getPhraseByConceptId - tags: - - phrase + summary: Searches for phrases that are contained in a specific concept. Use the query parameters to filter the result. parameters: - name: name - description: Filter phrases by name. in: query + description: Filter phrases by name. schema: type: string - - $ref: "#/components/parameters/page" + - $ref: '#/components/parameters/page' responses: - 200: + '200': description: List of phrases content: application/json: schema: type: array items: - $ref: "#/components/schemas/Phrase" - 401: - $ref: "#/components/responses/Unauthorized" - 404: - $ref: "#/components/responses/NotFound" + $ref: '#/components/schemas/Phrase' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' default: - $ref: "#/components/responses/UnexpectedError" - - /phrase/document/{documentId}: + $ref: '#/components/responses/UnexpectedError' + tags: + - phrase + '/phrase/document/{documentId}': parameters: - name: documentId in: path required: true schema: type: string - - $ref: "#/components/parameters/include" + - $ref: '#/components/parameters/include' get: - summary: Searches for phrases that are contained in a specific document. Use the query parameters to filter the result. operationId: getPhraseByDocumentId - tags: - - phrase + summary: Searches for phrases that are contained in a specific document. Use the query parameters to filter the result. parameters: - name: name - description: Filter phrases by name. in: query + description: Filter phrases by name. schema: type: string - - $ref: "#/components/parameters/page" + - $ref: '#/components/parameters/page' responses: - 200: + '200': description: List of phrases content: application/json: schema: type: array items: - $ref: "#/components/schemas/Phrase" - 401: - $ref: "#/components/responses/Unauthorized" - 404: - $ref: "#/components/responses/NotFound" + $ref: '#/components/schemas/Phrase' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' default: - $ref: "#/components/responses/UnexpectedError" - - /phrase/{phraseId}: + $ref: '#/components/responses/UnexpectedError' + tags: + - phrase + '/phrase/{phraseId}': summary: Represents a Phrase parameters: - name: phraseId @@ -317,125 +310,121 @@ paths: required: true schema: type: string - - $ref: "#/components/parameters/include" + - $ref: '#/components/parameters/include' get: - summary: Returns a particular Phrase operationId: getPhraseById - tags: - - phrase + summary: Returns a particular Phrase responses: - 200: + '200': description: Details of the Phrase content: application/json: schema: - $ref: "#/components/schemas/Phrase" - 401: - $ref: "#/components/responses/Unauthorized" - 404: - $ref: "#/components/responses/NotFound" + $ref: '#/components/schemas/Phrase' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' default: - $ref: "#/components/responses/UnexpectedError" - + $ref: '#/components/responses/UnexpectedError' + tags: + - phrase /concept: - get: - summary: Searches for concepts - operationId: getConcepts - tags: - - concept - parameters: - - name: phraseText - description: Search concept by phrase - in: query - schema: - type: string - responses: - 200: - description: List of concepts - content: - application/json: - schema: - type: array - items: - $ref: "#/components/schemas/Concept" - 401: - $ref: "#/components/responses/Unauthorized" - default: - $ref: "#/components/responses/UnexpectedError" - - /concept/phrase/{phraseId}: + get: + operationId: getConcepts + summary: Searches for concepts + parameters: + - name: phraseText + in: query + description: Search concept by phrase + schema: + type: string + responses: + '200': + description: List of concepts + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Concept' + '401': + $ref: '#/components/responses/Unauthorized' + default: + $ref: '#/components/responses/UnexpectedError' + tags: + - concept + '/concept/phrase/{phraseId}': parameters: - name: phraseId in: path required: true schema: type: string - - $ref: "#/components/parameters/include" + - $ref: '#/components/parameters/include' get: - summary: Searches for concepts that contain a specific phrase. Use the query parameters to filter the result. operationId: getConceptByPhraseId - tags: - - concept + summary: Searches for concepts that contain a specific phrase. Use the query parameters to filter the result. parameters: - name: name - description: Filter concepts by name. in: query + description: Filter concepts by name. schema: type: string - - $ref: "#/components/parameters/page" + - $ref: '#/components/parameters/page' responses: - 200: + '200': description: List of concepts content: application/json: schema: type: array items: - $ref: "#/components/schemas/Concept" - 401: - $ref: "#/components/responses/Unauthorized" - 404: - $ref: "#/components/responses/NotFound" + $ref: '#/components/schemas/Concept' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' default: - $ref: "#/components/responses/UnexpectedError" - - /concept/document/{documentId}: + $ref: '#/components/responses/UnexpectedError' + tags: + - concept + '/concept/document/{documentId}': parameters: - name: documentId in: path required: true schema: type: string - - $ref: "#/components/parameters/include" + - $ref: '#/components/parameters/include' get: - summary: Searches for concepts that are contained in a specific document. Use the query parameters to filter the result. operationId: getConceptByDocumentId - tags: - - concept + summary: Searches for concepts that are contained in a specific document. Use the query parameters to filter the result. parameters: - name: name - description: Filter concepts by name. in: query + description: Filter concepts by name. schema: type: string - - $ref: "#/components/parameters/page" + - $ref: '#/components/parameters/page' responses: - 200: + '200': description: List of concepts content: application/json: schema: type: array items: - $ref: "#/components/schemas/Concept" - 401: - $ref: "#/components/responses/Unauthorized" - 404: - $ref: "#/components/responses/NotFound" + $ref: '#/components/schemas/Concept' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' default: - $ref: "#/components/responses/UnexpectedError" - - /concept/{conceptId}: + $ref: '#/components/responses/UnexpectedError' + tags: + - concept + '/concept/{conceptId}': summary: Represents a concept parameters: - name: conceptId @@ -443,25 +432,25 @@ paths: required: true schema: type: string - - $ref: "#/components/parameters/include" + - $ref: '#/components/parameters/include' get: - summary: Returns a particular concept operationId: getConceptById - tags: - - concept + summary: Returns a particular concept responses: - 200: + '200': description: Details of the Concept content: application/json: schema: - $ref: "#/components/schemas/Concept" - 401: - $ref: "#/components/responses/Unauthorized" - 404: - $ref: "#/components/responses/NotFound" + $ref: '#/components/schemas/Concept' + '401': + $ref: '#/components/responses/Unauthorized' + '404': + $ref: '#/components/responses/NotFound' default: $ref: '#/components/responses/UnexpectedError' + tags: + - concept /organisation: parameters: - $ref: '#/components/parameters/include' @@ -616,10 +605,10 @@ paths: schema: type: boolean - name: type - description: Filter repositories by type. in: query + description: Filter repositories by type. schema: - $ref: "#/components/schemas/RepositoryType" + $ref: '#/components/schemas/RepositoryType' - $ref: '#/components/parameters/page' responses: '200': @@ -723,10 +712,10 @@ paths: schema: type: string - name: type - description: Filter repositories by type. in: query + description: Filter repositories by type. schema: - $ref: "#/components/schemas/RepositoryType" + $ref: '#/components/schemas/RepositoryType' - $ref: '#/components/parameters/page' responses: '200': @@ -1669,18 +1658,16 @@ components: organisation: $ref: '#/components/schemas/Organisation' repositoryType: - $ref: "#/components/schemas/RepositoryType" + $ref: '#/components/schemas/RepositoryType' required: - id - RepositoryType: - type: string - description: > + description: | The type of a repository. It determines the content a repository can hold. + type: string enum: - phenotype_repository - concept_repository - Ontology: type: object properties: @@ -2298,7 +2285,6 @@ components: description: Number of documents type: integer format: int64 - Document: type: object properties: @@ -2312,8 +2298,6 @@ components: type: string Phrase: type: object - required: - - id properties: id: type: string @@ -2325,16 +2309,17 @@ components: type: array items: type: string - - Concept: - type: object required: - id + Concept: + type: object properties: id: type: string labels: type: string + required: + - id responses: NotFound: description: The specified resource was not found. @@ -2348,14 +2333,12 @@ components: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - UnexpectedError: description: Unexpected error. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - securitySchemes: BearerAuth: type: http