aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-06-08 14:01:54 +0300
committerBonfaceKilz2023-06-12 15:35:40 +0300
commit96bb0d6f2eb76de8481e0ff1c2afd08ccf7e64fa (patch)
tree49df8617e107523197b94a4240afd522020bf72f
parent5a457e89159c453734eb433e9989df384dfa66ed (diff)
downloadgenenetwork3-96bb0d6f2eb76de8481e0ff1c2afd08ccf7e64fa.tar.gz
Delete unused get_trait_metadata function
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rw-r--r--gn3/db/rdf.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/gn3/db/rdf.py b/gn3/db/rdf.py
index c559774..e92ccdb 100644
--- a/gn3/db/rdf.py
+++ b/gn3/db/rdf.py
@@ -184,7 +184,6 @@ CONSTRUCT {
}
"""
response: MonadicDict = MonadicDict()
-
for key, value in sparql_query(
sparql_conn,
Template(__metadata_query)
@@ -199,29 +198,12 @@ CONSTRUCT {
return response
-def get_trait_metadata(
- sparql_conn: SPARQLWrapper,
- trait_name: str,
- dataset_name: str
):
- """Return metadata about a given trait"""
__metadata_query = """
-PREFIX gn: <http://genenetwork.org/>
-SELECT strafter((str(?key)), "http://genenetwork.org/sampledata:") as ?key
- ?value WHERE {
- gn:sampledata_$trait_name gn:sampledata:dataset "$dataset_name" .
- gn:sampledata_$trait_name ?key ?value .
}
"""
result: MonadicDict = MonadicDict()
- for _r in sparql_query(
sparql_conn,
Template(__metadata_query)
- .substitute(trait_name=trait_name,
- dataset_name=dataset_name)
- ):
- _key = _r["key"].bind(lambda x: x["value"]) # type:ignore
- if _key:
- result[_key] = _r["value"].bind(lambda x: Just(x["value"])) # type:ignore
return result