aboutsummaryrefslogtreecommitdiff
path: root/gn3/api/metadata.py
AgeCommit message (Collapse)Author
2024-09-05Restructure RDF module.Munyoki Kilyungi
* gn3/api/metadata.py: Import constants from gn3.db.rdf * gn3/api/metadata_api/wiki.py: Ditto. Import "get_wiki_entries_by_symbol" from gn3.db.rdf.wiki. * gn3/db/constants.py: Delete file and move all constants ... * gn3/db/rdf.py: ... and functions ... * gn3/db/rdf/__init__.py: ... here. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-08-26Move "GET /wiki/<symbol>" end-point to gn3.api.metadata.wiki.Munyoki Kilyungi
* gn3/api/metadata.py (get_wiki_entries): Move this... * gn3/api/metadata_api/wiki.py (edit_wiki): ... here. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-08-26Fix pylint errors.Munyoki Kilyungi
* gn3/api/metadata.py: Remove duplicate imports. * gn3/db/constants.py: Add docstring. * gn3/db/rdf.py (get_wiki_entries_by_symbol): Remove duplicate dictionary key. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-08-26If there's no data, return a 404.Munyoki Kilyungi
* gn3/api/metadata.py (get_wiki_entries): Return an empty {} when there's no data. * gn3/db/rdf.py (query_frame_and_compact): Delete check for empty results. Instead just return the context as is. (query_and_compact): Ditto. (query_and_frame): Ditto. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-08-26Set correct content-header & status code for ld+json/json response.Munyoki Kilyungi
* gn3/api/metadata.py: Import jsonify, make_response. (get_wiki_entries): Set a 404 status code when a response is empty. Set correct Content-Type header for ld+json. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-08-26Fetch all the wiki entries by symbol.Munyoki Kilyungi
* gn3/api/metadata.py: Import "get_wiki_entries_by_symbol". (get_gn_genewiki_entries): Rename this to... (get_wiki_entries): this; and update the URL endpoint. * gn3/db/rdf.py: Import constants.BASE_CONTEXT. (get_wiki_entries_by_symbol): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-08-26Move constants to their own file.Munyoki Kilyungi
* gn3/api/metadata.py: Move constants from here... * gn3/db/rdf.py: ... and here, to... * gn3/db/constants.py: ... here. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-08-26Run autopep8 against file.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-08-26refactor: split out utlities into their modules and change api to use metadataJohn Nduli
2024-05-20Delete search endpoints for datasets/publications.Munyoki Kilyungi
* gn3/api/metadata.py: Delete "query_and_frame" import. (search_datasets): Delete. (search_publications): Ditto. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-04-30Add docstring to view_history function.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-04-30Use JWT tokens from gn-auth.Munyoki Kilyungi
* gn3/api/metadata.py: Import time, jwt, AUthorisationError. (edit_dataset): Use JWT tokens from gn-auth and validate them. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-04-30Add an endpoint to query a dataset's git history from it's id.Munyoki Kilyungi
* gn3/api/metadata.py: Import get_history. (view_history): New endpoint. * gn3/db/datasets.py (get_history): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-04-30Rename retrieve_dataset_metadata to retrieve_metadata.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-02-15Use correct names for dataset entries in json result.Munyoki Kilyungi
Since we are appending to an already flattened json-ld file, we don't need to add the prefixes. * gn3/api/metadata.py (DATASET_CONTEXT): Add missing "experimentType" key. * gn3/db/datasets.py (retrieve_dataset_metadata): Match the __subject dict with entries from DATASET_CONTEXT. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-02-14Remove try ... except clauses around RDF endpoints.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-02-14Stem the dataset's id before constructing the path.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-02-13Use correct path for dataset metadata files.Munyoki Kilyungi
* gn3/api/metadata.py (datasets): Use "gn-docs/general/datasets". Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-02-13Update "dataset/<name>" API endpoint to fetch metadata from files.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-01-10Optionally fetch dataset metadata if provided during genotype fetch.Munyoki Kilyungi
* gn3/api/metadata.py (genotypes): If a dataset name is provided fetch the group it belongs to and the dataset's full and short name. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-01-10Switch to gnt:belongsToSpecies in genotype queries.Munyoki Kilyungi
* gn3/api/metadata.py (genotypes): Use gnt:belongsToSpecies instead of xkos:classifiedUnder when querying for species. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-01-10Remove hard-coded dataset name.Munyoki Kilyungi
* gn3/api/metadata.py (probesets): Remove hard-coded "HC_M2_0606_P" in probeset RDF query. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-01-08Optionally fetch dataset metadata if provided during probeset fetch.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-01-06Remove extra gene metadata from query as it's un-necessary.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-01-06Add extra keys to the Probeset's json-ld context.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-01-06Refactor gene symbol handling and add references to probeset.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-01-06Use gnt:geneSymbol property to fetch genes in Probeset RDF query.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-12-15Update RDF ProbeSet query.Munyoki Kilyungi
* gn3/api/metadata.py (probesets): Update RDF query. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-12-15First frame and then compact probeset results.Munyoki Kilyungi
* gn3/api/metadata.py: Reshape the data in a nice way by first framing and compacting the json-ld result. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-12-15Update ProbeSet's context.Munyoki Kilyungi
* gn3/api/metadata.py (probesets): Update context. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-12-15Update BASE_CONTEXT entries.Munyoki Kilyungi
* gn3/api/metadata.py: (PHENOTYPE_CONTEXT): Move "rdfs", "gnt", "gnc"... (BASE_CONTEXT): ... here. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-12-07Fix typo in GoTree prefix.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-12-07Add optional property for platform info in dataset representation.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-12-07Fetch normalization metadata correctly.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-12-07Fix typo in platform prefix.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-12-07Refactor metadata mappings for improved dataset representation.Munyoki Kilyungi
* gn3/api/metadata.py: (DATASET_CONTEXT): Remove "ex:" prefixes. Add new prefixes for citation, platform, GoTree, tissueInfo, contactWebUrl and contactName. (datasets): Update query. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-12-07Update phenotype queries to use gnt:belongsToGroup.Munyoki Kilyungi
* gn3/api/metadata.py (phenotypes): Use gnt:belongsToGroup instead of xkos:classifiedUnder. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-30Add a phenotype's chromosome location to the Phenotype fetch.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-30Place publication details on a sub-graph of its own.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-30Replace LRS with lodScore.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-27Remove unused variable "args".Munyoki Kilyungi
* gn3/api/metadata.py (phenotypes): Delete "args". Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-27Attach phenotype endpoints to one function.Munyoki Kilyungi
* gn3/api/metadata.py (phenotypes): Add "/phenotypes/<group>/<name>" to this endpoint. (fetch_phenotype_by_group): Delete. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-27Use "dcat:Dataset" when framing when fetching phenotypes.Munyoki Kilyungi
* gn3/api/metadata.py (phenotypes): Filter for "dcat:Dataset" in json-ld context. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-27Construct a more semantic graph for phenotypes.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-27Remove unused argument during template substitution.Munyoki Kilyungi
* gn3/api/metadata.py (phenotypes): Delete "name" from template substitution. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-27Replace "ex:" prefix with a semantic prefix when fetching phenotype.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-27Add "gnt:abbreviation" and "ex:inbredSet" to PHENOTYPE_CONTEXT.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-27Add "ex:species" to phenotypes json-ld context.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-27Return distinct results after a dataset search.Munyoki Kilyungi
* gn3/api/metadata.py (search_datasets): Return distinct search results. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-11-27Add ex:pages and ex:hits to the search context.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>