diff options
author | Munyoki Kilyungi | 2023-12-22 12:00:19 +0300 |
---|---|---|
committer | BonfaceKilz | 2024-01-06 14:15:26 +0300 |
commit | 52bfc164eb2ee3b1f0e7b831af4123d17f399c5e (patch) | |
tree | 8c565e25a7895206c767cd82acf89b73f75a887a /gn3 | |
parent | 251987489eb02ff0b781e4e9d419fcf34a7c8eca (diff) | |
download | genenetwork3-52bfc164eb2ee3b1f0e7b831af4123d17f399c5e.tar.gz |
Refactor gene symbol handling and add references to probeset.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/api/metadata.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/gn3/api/metadata.py b/gn3/api/metadata.py index 45b731e..cb61227 100644 --- a/gn3/api/metadata.py +++ b/gn3/api/metadata.py @@ -904,30 +904,39 @@ $prefix CONSTRUCT { ?probeset ?predicate ?object ; - gnt:geneSymbol ?symbol . - ?symbol ?symbolPred ?symbolObj . + gnt:geneSymbol ?gene ; + dct:references ?probesetResource . + ?gene ?genePred ?geneObj . ?resource rdfs:label ?resourceLabel ; rdfs:comments ?resourceComments . + ?probesetResource rdfs:label ?probesetResourceLabel ; + rdfs:comments ?probesetResourceComments . ?chip rdfs:label ?chipName . } WHERE { ?probeset rdf:type gnc:Probeset ; rdfs:label "$name" ; ?predicate ?object . - FILTER (!regex(str(?predicate), '(geneSymbol)', 'i')) . OPTIONAL { ?probeset gnt:geneSymbol ?symbolName . - ?symbol gnt:geneSymbol ?symbolName ; - rdf:type gnc:Gene ; - ?symbolPred ?symbolObj . - ?resource ^dct:references ?symbol ; + ?gene gnt:geneSymbol ?symbolName ; + rdf:type gnc:Gene ; + ?genePred ?geneObj . + ?resource ^dct:references ?gene ; a ?resourceLink . - ?resourceLink rdfs:label ?resourceLabel ; + ?resourceLink rdfs:Class gnc:ResourceLink ; + rdfs:label ?resourceLabel ; rdfs:comments ?resourceComments . } . - OPTIONAL{ + OPTIONAL { ?probeset gnt:hasChip ?chip . ?chip rdfs:label ?chipName . } . + OPTIONAL { + ?probesetResource ^dct:references ?probeset ; + a ?probesetResourceLink . + ?probesetResourceLink rdfs:label ?probesetResourceLabel ; + rdfs:comments ?probesetResourceComments . + } . } """).substitute(prefix=RDF_PREFIXES, name=name) _context = { |