From 8076bc0821e4f203f9d5e2e58a85ef7c91167ced Mon Sep 17 00:00:00 2001 From: David Osumi-Sutherland Date: Sat, 16 Dec 2023 09:39:34 +0000 Subject: [PATCH 1/2] Update cell_by_location.rq Updating to be more generic --- sparql/cell_by_location.rq | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sparql/cell_by_location.rq b/sparql/cell_by_location.rq index 89081f4..972df2e 100644 --- a/sparql/cell_by_location.rq +++ b/sparql/cell_by_location.rq @@ -1,8 +1,9 @@ -#+ summary: Find cells by location -#+ description: Enter an anatomical location, get back a list of cell type IRIs and labels +#+ summary: Find cells by type and location +#+ description: Args: cell: the iri or a cell type; location: the iri of an anatomical location. All args are optional. With no args returns all cells with an anatomical location. Returns: a 2 column table: cell (type) IRIs and cell (type) labels. #+ defaults: -#+ - location: http://purl.obolibrary.org/obo/UBERON_0002113 +#+ - location: http://purl.obolibrary.org/obo/UBERON_0001062 # Anatomical Entity +#+ - cell: http://purl.obolibrary.org/obo/CL_0000000 # Cell PREFIX rdfs: PREFIX owl: @@ -12,7 +13,7 @@ PREFIX cell: SELECT DISTINCT ?cell_iri (STR(?qlabel) as ?cell_label) WHERE { ?cell_iri overlaps: ?_location_iri . - ?cell_iri rdfs:subClassOf cell: . + ?cell_iri rdfs:subClassOf ?_cell_iri . ?cell_iri rdfs:label ?qlabel . } From ba3f96ca388fbdf6ab888f7e4ebe7264811cda79 Mon Sep 17 00:00:00 2001 From: David Osumi-Sutherland Date: Thu, 21 Dec 2023 13:52:53 +0000 Subject: [PATCH 2/2] Update cell_by_location.rq switched to union of part_of and has_soma_location --- sparql/cell_by_location.rq | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sparql/cell_by_location.rq b/sparql/cell_by_location.rq index 972df2e..0cfa663 100644 --- a/sparql/cell_by_location.rq +++ b/sparql/cell_by_location.rq @@ -1,5 +1,5 @@ #+ summary: Find cells by type and location -#+ description: Args: cell: the iri or a cell type; location: the iri of an anatomical location. All args are optional. With no args returns all cells with an anatomical location. Returns: a 2 column table: cell (type) IRIs and cell (type) labels. +#+ description: Args: cell: the iri or a cell type; location: the iri of an anatomical location. All args are optional. With no args returns all cells with an anatomical location. Location is a union of part_of (suitable for location of most cells) and has_soma_location (used for neurons). This pattern is designed for safe grouping of cell annotations. Returns: a 2 column table: cell (type) IRIs and cell (type) labels. #+ defaults: #+ - location: http://purl.obolibrary.org/obo/UBERON_0001062 # Anatomical Entity @@ -7,14 +7,18 @@ PREFIX rdfs: PREFIX owl: -PREFIX overlaps: +PREFIX part_of: PREFIX cell: +PREFIX has_soma_location: SELECT DISTINCT ?cell_iri (STR(?qlabel) as ?cell_label) WHERE { - ?cell_iri overlaps: ?_location_iri . - ?cell_iri rdfs:subClassOf ?_cell_iri . - ?cell_iri rdfs:label ?qlabel . + { + ?cell_iri part_of: ?_location_iri . + } UNION { + ?cell_iri has_soma_location: ?someValue . } - + ?cell_iri rdfs:subClassOf ?_cell_iri . + ?cell_iri rdfs:label ?qlabel . +}