diff options
author | Alexander_Kabui | 2024-01-08 22:09:59 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-01-08 22:09:59 +0300 |
commit | 2c576f65dc9d3a2b5ac573443fb88b36ea57f90f (patch) | |
tree | 89afdae239fe107bd08768bd6629034c976bd019 /gn3/api | |
parent | 6a88b6802737b8989666e1f72f4366fe55406d0d (diff) | |
parent | 6af08eac91a8b0d79e0cd7054e2a57e3e34c902a (diff) | |
download | genenetwork3-2c576f65dc9d3a2b5ac573443fb88b36ea57f90f.tar.gz |
merge for latest commits
Diffstat (limited to 'gn3/api')
-rw-r--r-- | gn3/api/metadata.py | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/gn3/api/metadata.py b/gn3/api/metadata.py index b3caa11..913d16a 100644 --- a/gn3/api/metadata.py +++ b/gn3/api/metadata.py @@ -896,7 +896,8 @@ CONSTRUCT { @metadata.route("/probesets/<name>", methods=["GET"]) -def probesets(name): +@metadata.route("/probesets/<dataset>/<name>", methods=["GET"]) +def probesets(name, dataset=""): """Fetch a probeset's metadata given it's name""" try: _query = Template(""" @@ -905,8 +906,12 @@ $prefix CONSTRUCT { ?probeset ?predicate ?object ; dct:references ?probesetResource ; - dct:references ?resource . - ?resource rdfs:label ?resourceLabel ; + dct:references ?resource ; + gnt:belongsToSpecies ?speciesShortName ; + gnt:belongsToGroup ?groupName ; + gnt:hasTissue ?tissueName ; + gnt:belongsToDataset ?datasetFullName . + ?resource rdfs:label ?resourceLabel ; rdfs:comments ?resourceComments . ?probesetResource rdfs:label ?probesetResourceLabel ; rdfs:comments ?probesetResourceComments . @@ -936,6 +941,22 @@ CONSTRUCT { ?probesetResourceLink rdfs:label ?probesetResourceLabel ; rdfs:comments ?probesetResourceComments . } . + OPTIONAL { + ?dataset rdf:type dcat:Dataset ; + (rdfs:label|dct:identifier|skos:prefLabel) "HC_M2_0606_P" ; + (skos:altLabel|skos:prefLabel) ?datasetFullName . + } . + OPTIONAL { + ?dataset gnt:hasTissue ?tissue . + ?tissue rdfs:label ?tissueName . + } . + OPTIONAL { + ?inbredSet ^skos:member gnc:Set ; + ^gnt:belongsToGroup ?dataset ; + rdfs:label ?groupName ; + xkos:generalizes ?species . + ?species gnt:shortName ?speciesShortName . + } . } """).substitute(prefix=RDF_PREFIXES, name=name) _context = { @@ -953,6 +974,9 @@ CONSTRUCT { "dct": "http://purl.org/dc/terms/", "description": "dct:description", "geneID": "gnt:hasGeneId", + "group": "gnt:belongsToGroup", + "dataset": "gnt:belongsToDataset", + "tissue": "gnt:hasTissue", "kgID": "gnt:hasKgID", "location": "gnt:location", "mb": "gnt:mb", |