aboutsummaryrefslogtreecommitdiff
path: root/gn3/db/datasets.py
AgeCommit message (Expand)Author
2022-11-02Re-implement RDF related code to use monads in its own module...* gn3/api/general.py: Replace gn3.db.datasets import with gn3.db.rdf. (dataset_metadata) <jsonify>: Replace datasets.dataset_metadata with rdf.get_dataset_metadata. * gn3/db/datasets.py: Remove unused imports. (sparql_query, dataset_metadata): Delete. * gn3/db/rdf.py: (sparql_query, get_dataset_metadata): New functions. Munyoki Kilyungi
2022-06-21db: datasets.py: Ignore results from sparql.queryAndConvert...ATM, it's very difficult to work the correct type that is returned. Ignore this for now and fix this later. BonfaceKilz
2022-02-21Fix a myriad of linter issues...* Use `with` in place of plain `open` * Use f-strings in place of `str.format()` * Remove string interpolation from queries - provide data as query parameters * other minor fixes Frederick Muriuki Muriithi
2022-02-18Remove code trying to query non-existent `TempFreeze` table...The code was migrated from GN1 with a faulty assumption that all trait types have a corresponding `*Freeze` table in the database. This assumption is not true for the `Temp` traits. This commit removes the buggy code. Frederick Muriuki Muriithi
2021-12-23db: Assist mypy with explicit type declaration....* gn3/db/datasets.py (dataset_metadata): Assist mypy by explicitly declaring type of return dictionary. Arun Isaac
2021-12-23db: Fix sparql_query return type....* gn3/db/datasets.py: Import List from typing. (sparql_query): Set return type to List[Dict[str, Any]]. Arun Isaac
2021-12-23db: Fix wrong continued indentation....* gn3/db/datasets.py (dataset_metadata): Fix wrong continued indentation. Arun Isaac
2021-12-09Prevent error on no result. Fix indexing...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * If the dataset name is not found, don't cause an exception, instead, return the provided search name. * Use the correct inner object Frederick Muriuki Muriithi
2021-12-02Implement dataset metadata API endpoint....* guix.scm: Import (gnu packages rdf). (genenetwork3)[propagated-inputs]: Add python-sparqlwrapper. * gn3/settings.py (SPARQL_ENDPOINT): New variable. * gn3/api/general.py: Import datasets from gn3.db. (dataset_metadata): New API endpoint. * gn3/db/datasets.py: Import re, Template from string, Dict and Optional from typing, JSON and SPARQLWrapper from SPARQLWrapper, SPARQL_ENDPOINT from gn3.settings. (sparql_query, dataset_metadata): New functions. Arun Isaac
2021-09-27Update terminology: `riset` to `group`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Update terminology to use the appropriate domain terminology according to Zachary's direction at https://github.com/genenetwork/genenetwork3/pull/37#issuecomment-926041744 Frederick Muriuki Muriithi
2021-08-17Fix errors: add in missing parenthesis...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Call the `cursor.fetchone()` function to get results. Without the parenthesis, the code was trying to use the function itself as the results, which was a bug, and would lead to failure. Muriithi Frederick Muriuki
2021-08-09Fix linting errors...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Add module, class and function docstrings * Deactivate some irrelevant pylint errors * Fix indentations and line-lengths Muriithi Frederick Muriuki
2021-08-05Reorganise the database code...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Reorganise the code to separate the datasets from the traits, and to more closely conform to the same flow as that in GN1 Muriithi Frederick Muriuki