-
Notifications
You must be signed in to change notification settings - Fork 3
/
default_neurobagel_query.rq
76 lines (67 loc) · 2.95 KB
/
default_neurobagel_query.rq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
PREFIX cogatlas: <https://www.cognitiveatlas.org/task/id/>
PREFIX nb: <http://neurobagel.org/vocab/>
PREFIX nbg: <http://neurobagel.org/graph/>
PREFIX ncit: <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#>
PREFIX nidm: <http://purl.org/nidash/nidm#>
PREFIX snomed: <http://purl.bioontology.org/ontology/SNOMEDCT/>
PREFIX np: <https://github.com/nipoppy/pipeline-catalog/tree/main/processing/>
SELECT DISTINCT ?dataset_uuid ?dataset_name ?dataset_portal_uri ?sub_id ?age ?sex
?diagnosis ?subject_group ?num_matching_phenotypic_sessions ?num_matching_imaging_sessions
?session_id ?session_type ?assessment ?image_modal ?session_file_path ?pipeline_name ?pipeline_version
WHERE {
?dataset_uuid a nb:Dataset;
nb:hasLabel ?dataset_name;
nb:hasSamples ?subject.
?subject a nb:Subject;
nb:hasLabel ?sub_id;
nb:hasSession ?session.
VALUES ?session_type {nb:ImagingSession nb:PhenotypicSession}
?session a ?session_type;
nb:hasLabel ?session_id.
OPTIONAL {
?session nb:hasAcquisition/nb:hasContrastType ?image_modal.
OPTIONAL {?session nb:hasFilePath ?session_file_path.}
}
OPTIONAL {?dataset_uuid nb:hasPortalURI ?dataset_portal_uri.}
OPTIONAL {?session nb:hasAge ?age.}
OPTIONAL {?session nb:hasSex ?sex.}
OPTIONAL {?session nb:hasDiagnosis ?diagnosis.}
OPTIONAL {?session nb:isSubjectGroup ?subject_group.}
OPTIONAL {?session nb:hasAssessment ?assessment.}
{
SELECT ?subject (count(distinct ?phenotypic_session) as ?num_matching_phenotypic_sessions)
WHERE {
?subject nb:hasSession ?phenotypic_session.
?phenotypic_session a nb:PhenotypicSession.
OPTIONAL {?phenotypic_session nb:hasAge ?age.}
OPTIONAL {?phenotypic_session nb:hasSex ?sex.}
OPTIONAL {?phenotypic_session nb:hasDiagnosis ?diagnosis.}
OPTIONAL {?phenotypic_session nb:isSubjectGroup ?subject_group.}
OPTIONAL {?phenotypic_session nb:hasAssessment ?assessment.}
} GROUP BY ?subject
}
OPTIONAL {
?session nb:hasCompletedPipeline ?pipeline.
?pipeline nb:hasPipelineVersion ?pipeline_version.
?pipeline nb:hasPipelineName ?pipeline_name.
}
{
SELECT ?subject (count(distinct ?imaging_session) as ?num_matching_imaging_sessions)
WHERE {
?subject a nb:Subject.
OPTIONAL {
?subject nb:hasSession ?imaging_session.
?imaging_session a nb:ImagingSession.
OPTIONAL {
?imaging_session nb:hasAcquisition ?acquisition.
?acquisition nb:hasContrastType ?image_modal.
}
OPTIONAL {
?imaging_session nb:hasCompletedPipeline ?pipeline.
?pipeline nb:hasPipelineName ?pipeline_name;
nb:hasPipelineVersion ?pipeline_version.
}
}
} GROUP BY ?subject
}
}