-
Notifications
You must be signed in to change notification settings - Fork 0
/
queries.sparql
74 lines (51 loc) · 1.67 KB
/
queries.sparql
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
PREFIX ns1: <file:/uploaded/generated/relationship/>
PREFIX cptsno: <file:/uploaded/generated/concept/snomed/>
PREFIX cpticd: <file:/uploaded/generated/concept/icd10/>
# CONSTRUCT GRAPH OF ANCESTORS OF ANXIETY!!!!!
CONSTRUCT {?sno_kid ns1:isSubclassOf ?sno_parent.} where {
cpticd:F41.9 ns1:map ?sno_kid .
?sno_kid ns1:isChildOf* ?sno_parent .
?sno_parent ns1:label ?label .
} limit 100
PREFIX ns1: <file:/uploaded/generated/relationship/>
PREFIX cptsno: <file:/uploaded/generated/concept/snomed/>
PREFIX cpticd: <file:/uploaded/generated/concept/icd10/>
# SELECT ALL ANCESTORS OF ANXIETY!!!!!
select * where {
cpticd:F41.9 ns1:map ?o .
?o ns1:isChildOf* ?o2 .
?o2 ns1:label ?lab .
} limit 100
PREFIX ns1: <file:/uploaded/generated/relationship/>
PREFIX cptsno: <file:/uploaded/generated/concept/snomed/>
PREFIX cpticd: <file:/uploaded/generated/concept/icd10/>
# SELECT ANXIETY MAPS
select * where {
cpticd:F41.9 ns1:map ?o .
?o ns1:label ?lab .
} limit 100
# SELECT neoplasm concepts
PREFIX ns1: <file:/uploaded/generated/relationship/>
PREFIX cpticd: <file:/uploaded/generated/concept/icd10/>
select ?s ?o where {
?s ns1:label ?o .
FILTER REGEX(?o, "neoplasm")
}
# RANDOM SELECTION OF iSChildOf and map CODES IN DB
# Yields labels only
PREFIX ns1: <file:/uploaded/generated/relationship/>
select ?s ?p ?o where {
?s ?p ?o .
FILTER (?p IN (ns1:map, ns1:isChildOf))
}
ORDER BY RAND() limit 100
# RANDOM SELECTION OF ISA CODES IN DB
# Yields labels only
select * where {
?s ns1:isChildOf ?o .
} ORDER BY RAND() limit 100
# RANDOM SELECTION OF THINGS IN DB
# Yeilds labels only
select * where {
?s ?p ?o .
} ORDER BY RAND() limit 100