aboutsummaryrefslogtreecommitdiff
path: root/gn3/db
AgeCommit message (Collapse)Author
2024-02-25Construct genofile_path using pathlib module.Munyoki Kilyungi
* gn3/db/datasets.py: Remove os import. (retrieve_sample_list): Replace os.path with Path. 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-13Fetch extra metadata from text-files when fetching datasets.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-02-13Retrieve metadata from text files given a path.Munyoki Kilyungi
* gn3/db/datasets.py (retrieve_trait_dataset): New file. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Fix pylint error.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Add functions that wrap around the common jsonld patterns.Munyoki Kilyungi
* gn3/db/rdf.py: Import jsonld. (query_frame_and_compact, query_and_compact, query_and_frame): New functions. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Break up long line.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Ignore construct result for mypy complianceMunyoki Kilyungi
This commit addresses the mypy issue below by ignoring the construct result. ``` error: Item "None" of "bytes | str | dict[Any, Any] | Graph | Document | None" has no attribute "serialize" [union-attr] ```
2023-10-27Abstract out (sparql) CONSTRUCT into a function.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Delete gn3.db.rdf.sparql_query.Munyoki Kilyungi
* gn3/api/metadata.py: Remove sparql_query import. * gn3/db/rdf.py: Remove unused imports. (sparql_query): Delete. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Delete db.rdf.get_url_local_name.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Implement "GET /metadata/phenotypes/:name".Munyoki Kilyungi
* gn3/api/metadata.py: Delete gn3.db.rdf.get_phenotype_metadata. (phenotype): Rename this to ... (phenotypes): ... this and implement update logic. * gn3/db/rdf.py (get_phenotype_metadata): Delete. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Delete get_dataset_metadata.Munyoki Kilyungi
* gn3/db/rdf.py (get_dataset_metadata): Delete. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Implement "GET /metadata/publications/:name".Munyoki Kilyungi
* gn3/api/metadata.py: Delete gn3.db.rdf.get_publication_metadata. (publication): Rename this ... (publications): ... to this. Return a json-ld result. * gn3/db/rdf.py (get_publication_metadata): Delete. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Add fabio: and prism: to PREFIXES.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Implement "GET /metadata/datasets/:name".Munyoki Kilyungi
* gn3/api/metadata.py: Import json, SPARQLWrapper.{JSON, JSONLD}. (dataset): Rename this to ... (datasets): ... this. Return a well formatted JSONLD result from a dataset. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Add missing dcat: prefix.Munyoki Kilyungi
2023-10-27Derive RDF_PREFIXES string from PREFIXES.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Remove get_url_local_name when processing result keys.Munyoki Kilyungi
* gn3/db/rdf.py (sparql_query): Delete "get_url_local_name". Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Simplify CONSTRUCT query when fetching a dataset's metadata.Munyoki Kilyungi
* gn3/api/metadata.py (dataset): Update docstring. * gn3/db/rdf.py (get_dataset_metadata): Simplify CONSTRUCT query. Also, now you can fetch metadata using either an accession_id or the dataset's name. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-27Update RDF prefixes.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-10-06Make argument mandatoryFrederick Muriuki Muriithi
Make the `base_dir` argument mandatory to force it to be passed in from the point the function is called.
2023-09-21Fix query in update_cross_referencezsloan
2023-09-05Delete un-used importMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-09-05Fix C3001: Lambda expression assigned to a variableMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-09-05Remove un-necessary string concatenationMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-09-05Replace "escape_string" with safe-query parametersMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-09-05Remove type annotations for "none_case_attrs" variablesMunyoki Kilyungi
* gn3/db/sample_data.py (update_sample_data, delete_sample_data, insert_sample_data): Remove type hints for "none_case_attrs". Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-08-24Change get_pheno_csv_sample_data to use group ID instead of phenotype IDzsloan
2023-08-17Fix query for fetching DataId when inserting ProbeSet datazsloan
2023-08-17Fix a couple remaining issues with function parameterszsloan
2023-08-17Combine pheno/mrna update functions + some other fixeszsloan
2023-08-17Fix queries for fetching group nameszsloan
2023-08-17Fix fetch_trait query for phenotypeszsloan
2023-08-17Fix a few misnamed tables in mrna delete/insert functionszsloan
2023-08-17Implement ProbeSet sample data editingzsloan
Currently there's a lot of duplicated code, so I need to ask how best to simplify it later
2023-08-17Fix probeset sample data and CSV sample data functionszsloan
2023-08-17Fix query for retrieving mrna dataset group namezsloan
2023-08-17Fix get_mrna_sample_data queryzsloan
2023-08-17Fix mrna group name queryzsloan
2023-08-17Remove Id select from probeset metadata query, since it's included in colszsloan
2023-08-17Add function for retrieving mRNA Assay group namezsloan
2023-08-17Make several sample_data fetching functions specific to phenotype or mrna ↵zsloan
assay resources, and change their naming accordingly
2023-08-04Remove the ORM-dependent `update` function.Frederick Muriuki Muriithi
2023-08-02Add deprecation notice to ORM-dependent `update` functionFrederick Muriuki Muriithi
Add a deprecation notice to discourage other devs from using the deprecated `update` function.
2023-08-02Remove ORM-dependent `insert` functionFrederick Muriuki Muriithi
Remove the object-relation-mapping dependent `insert` function to prevent it being used in the code down the line.
2023-08-02Remove ORM-dependent `fetchall` and `fetchone` functionsFrederick Muriuki Muriithi
Remove Object-Relational Mapping dependent function, `fetchall` and `fetchone` so as to prevent theirs use in the code moving forward.
2023-07-26Fix variable name.Frederick Muriuki Muriithi
2023-07-26Remove debug statement.Frederick Muriuki Muriithi
2023-07-26Fetch `metadata_audit` trail with direct query functions.Frederick Muriuki Muriithi