-
Notifications
You must be signed in to change notification settings - Fork 0
/
QUERIES.txt
123 lines (112 loc) · 2.61 KB
/
QUERIES.txt
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Given a root UID this query gets the UID, kmer, and genome edges. By nesting
with the genome edge we can ge the next genome on the path along with its edges.
{
complete(func: uid(0x305847)){
uid
kmer
genome_3e3b8156bf92d835217c959bf07d0c8d1d7abe54{
uid
kmer
genome_3e3b8156bf92d835217c959bf07d0c8d1d7abe54{
uid
kmer
genome_3e3b8156bf92d835217c959bf07d0c8d1d7abe54{
uid
kmer
genome_3e3b8156bf92d835217c959bf07d0c8d1d7abe54{
kmer
}
}
}
}
}
}
This query is similar to the first but uses expand to get the names of the connected
edges.
{
expanded(func: uid(0x305847)){
kmer
uid
genome_3e3b8156bf92d835217c959bf07d0c8d1d7abe54{
uid
expand(_all_){
expand(_all_){
expand(_all_)
}
}
}
}
}
This query has not been tested but I thought could be useful in the future. The idea is that
given a UID we can look to see what possible paths there are. Expanding the cycle_paths edge
could show which directions are possible maybe by storing UIDs as strings and then using that
string as a variable for which node to look at next.
{
metadata(func: uid(0x305847)){
cycle_paths{
expand(_all_)
}
}
}
Searches for a kmer which is given a a string. Then shows the adjacent node and its
relevant information etc.
{
kmer_search(func: allofterms(kmer, "AATTAAAACGT")){
uid
genome_3e3b8156bf92d835217c959bf07d0c8d1d7abe54{
uid
kmer
genome_3e3b8156bf92d835217c959bf07d0c8d1d7abe54{
uid
kmer
}
}
}
}
Searching for a kmer given as a string then returning all predicates. All edge names
are returned by predicate.
{
kmer_predicate_search(func: allofterms(kmer, "AATTAAAACGT")){
_predicate_
}
}
The same as the other expand query but without all the clutter.
{
expanded2(func: uid(0x305847)){
expand(_all_){
expand(_all_){
expand(_all_){
expand(_all_)
}
}
}
}
}
#start
{
var(func:allofterms(kmer, "AATTAAAACGT")) {
pred as _predicate_
}
q(func: has(kmer), first: 4) {
uid
expand(val(pred)) { expand(_all_) }
}
}
#stop
{
q_search(func: allofterms(kmer, "AATTAAAACGT")){
uid
_path_
}
}
THE PATHING QUERY FROM NODE TO NODE. Given a start and stop UID this query will find
the shortest path between those two UIDs. Must know what the start and stop UIDs are
beforehand. This query is utlilized in the path_query function
{
path as shortest(from: 0x305847, to: 0x305906){
genome_3e3b8156bf92d835217c959bf07d0c8d1d7abe54
}
path(func: uid(path)){
kmer
}
}