Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cell_by_location.rq #135

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions sparql/cell_by_location.rq
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
#+ 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. 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#+ 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.
#+ description: Args: cell: the iri of 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_0002113
#+ - location: http://purl.obolibrary.org/obo/UBERON_0001062 # Anatomical Entity
#+ - cell: http://purl.obolibrary.org/obo/CL_0000000 # Cell

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX overlaps: <http://purl.obolibrary.org/obo/RO_0002131>
PREFIX part_of: <http://purl.obolibrary.org/obo/BFO_0000050>
PREFIX cell: <http://purl.obolibrary.org/obo/CL_0000000>
PREFIX has_soma_location: <http://purl.obolibrary.org/obo/RO_0002100>

SELECT DISTINCT ?cell_iri (STR(?qlabel) as ?cell_label)
WHERE {
?cell_iri overlaps: ?_location_iri .
?cell_iri rdfs:subClassOf cell: .
?cell_iri rdfs:label ?qlabel .
{
?cell_iri part_of: ?_location_iri .
} UNION {
?cell_iri has_soma_location: ?someValue .
}
Comment on lines +16 to 20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{
?cell_iri part_of: ?_location_iri .
} UNION {
?cell_iri has_soma_location: ?someValue .
}
?cell_iri part_of:|has_soma_location: ?_location_iri .


?cell_iri rdfs:subClassOf ?_cell_iri .
?cell_iri rdfs:label ?qlabel .
}