From 133917dc57c99012e7ec9f887aa3109461db89e5 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Thu, 30 Nov 2023 16:20:19 +0300 Subject: Add a phenotype's chromosome location to the Phenotype fetch. Signed-off-by: Munyoki Kilyungi --- gn3/api/metadata.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'gn3/api') 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 ; -- cgit v1.2.3