Skip to content

Commit

Permalink
Add anatomical disease SPARQL queries for FMHA development
Browse files Browse the repository at this point in the history
- musculoskeletal system disease
- urinary system disease / reproductive system disease, including
gonadal disease (child of endocrine system disease)
  • Loading branch information
allenbaron committed Nov 5, 2024
1 parent 843b2a8 commit 8db90c5
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/sparql/extra/collaboration/fmha-musculoskeletal.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Return all classes that are part of the musculoskeletal system with
# their respective parents and the anatomical system/subsystems they belong to.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
PREFIX DOID: <http://purl.obolibrary.org/obo/DOID_>

SELECT ?id ?label ?anat_system ?anat_subsystem ?parent
WHERE {
?class oboInOwl:id ?id ;
rdfs:label ?label ;
rdfs:subClassOf ?parent ;
rdfs:subClassOf* ?anat_subsystem_uri .

?anat_subsystem_uri rdfs:label ?anat_subsystem ;
rdfs:subClassOf ?anat_system_uri .

?anat_system_uri rdfs:label ?anat_system ;
rdfs:subClassOf DOID:7 .

FILTER( !isBlank( ?parent ) )
# DOID:17 is 'musculoskeletal system disease'
FILTER( ?anat_system_uri = DOID:17 )
FILTER NOT EXISTS { ?class owl:deprecated ?any . }
}
26 changes: 26 additions & 0 deletions src/sparql/extra/collaboration/fmha-urinary_repro.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Return all classes that are part of the urinary or reproductive system with
# their respective parents and the anatomical system/subsystems they belong to.
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
PREFIX DOID: <http://purl.obolibrary.org/obo/DOID_>

SELECT ?id ?label ?anat_system ?anat_subsystem ?parent
WHERE {
?class oboInOwl:id ?id ;
rdfs:label ?label ;
rdfs:subClassOf ?parent ;
rdfs:subClassOf* ?anat_subsystem_uri .

?anat_subsystem_uri rdfs:label ?anat_subsystem ;
rdfs:subClassOf ?anat_system_uri .

?anat_system_uri rdfs:label ?anat_system ;
rdfs:subClassOf DOID:7 .

FILTER( !isBlank( ?parent ) )
# DOID:15 is 'reproductive system disease', DOID:18 is 'urinary system disease'
# DOID:2277 is 'gonadal disease' and is currently outside these systems as an 'endocrine system disease'
FILTER( ?anat_system_uri IN ( DOID:15, DOID:18 ) || ?anat_subsystem_uri = DOID:2277 )
FILTER NOT EXISTS { ?class owl:deprecated ?any . }
}

0 comments on commit 8db90c5

Please sign in to comment.