diff options
author | Munyoki Kilyungi | 2023-11-30 16:20:19 +0300 |
---|---|---|
committer | BonfaceKilz | 2023-11-30 16:23:02 +0300 |
commit | 133917dc57c99012e7ec9f887aa3109461db89e5 (patch) | |
tree | 4f143f6ddb4e72f66de659d13f1b08d0a01db46f /gn3/api | |
parent | a73080bcc5e05a0997ded4debafef3b0a34a6b67 (diff) | |
download | genenetwork3-133917dc57c99012e7ec9f887aa3109461db89e5.tar.gz |
Add a phenotype's chromosome location to the Phenotype fetch.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'gn3/api')
-rw-r--r-- | gn3/api/metadata.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gn3/api/metadata.py b/gn3/api/metadata.py index d67fcbd..86112f6 100644 --- a/gn3/api/metadata.py +++ b/gn3/api/metadata.py @@ -121,6 +121,9 @@ PHENOTYPE_CONTEXT = BASE_CONTEXT | PUBLICATION_CONTEXT | { "sequence": "gnt:sequence", "prefLabel": "skos:prefLabel", "identifier": "dct:identifier", + "chromosome": "gnt:chr", + "mb": "gnt:mb", + "peakLocation": "gnt:locus", "species": "gnt:belongsToSpecies", "group": "gnt:belongsToGroup", } @@ -430,11 +433,15 @@ CONSTRUCT { ?phenotype ?predicate ?object ; gnt:belongsToSpecies ?speciesName ; dcat:Distribution ?dataset ; - gnt:belongsToGroup ?inbredSetName . + gnt:belongsToGroup ?inbredSetName ; + gnt:locus ?geno . ?dataset skos:prefLabel ?datasetName ; dct:identifier ?datasetLabel ; rdf:type dcat:Dataset . ?publication ?pubPredicate ?pubObject . + ?geno rdfs:label ?locus ; + gnt:chr ?chr ; + gnt:mb ?mb . } WHERE { ?phenotype skos:altLabel "$name" ; xkos:classifiedUnder ?inbredSet ; @@ -450,6 +457,13 @@ CONSTRUCT { ?pubPredicate ?pubObject . FILTER (!regex(str(?pubPredicate), '(hasPubMedId|type)', 'i')) . } . + OPTIONAL { + ?geno ^gnt:locus ?phenotype ; + rdf:type gnc:Genotype ; + rdfs:label ?locus ; + gnt:chr ?chr ; + gnt:mb ?mb . + } . OPTIONAL { ?dataset rdf:type dcat:Dataset ; xkos:classifiedUnder ?inbredSet ; |