-
Notifications
You must be signed in to change notification settings - Fork 4
/
0140_pway.sparql
51 lines (41 loc) · 1.19 KB
/
0140_pway.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
# [unions] Complex union of paths over pathways
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bk: <http://knetminer.org/data/rdf/terms/biokno/>
PREFIX bkr: <http://knetminer.org/data/rdf/resources/>
PREFIX bka: <http://knetminer.org/data/rdf/terms/biokno/attributes/>
PREFIX bkg: <http://knetminer.org/data/rdf/resources/graphs/>
SELECT ?protName ?pwName ?branch
{
?prot a bk:Protein.
{
?prot bk:is_a|^bk:ac_by ?enz.
?enz a bk:Enzyme.
{
BIND ( "enz/cmp/trn" AS ?branch ) # starting from prot
?enz bk:ac_by|bk:in_by ?cmp.
?cmp a bk:Comp.
?cmp bk:cs_by|bk:pd_by ?trn.
}
UNION {
BIND ( "enz/trn" AS ?branch ) # another branch starting from prot
?enz ^bk:ca_by ?trn.
}
# trn -> pathway
?trn a bk:Transport.
?trn bk:part_of ?pw
}
UNION
{
# prot -> react -> pathway
BIND ( "react" AS ?branch )
?prot bk:pd_by|bk:cs_by ?react.
?react a bk:Reaction.
?react bk:part_of ?pw.
}
?pw a bk:Path
OPTIONAL { ?prot bk:prefName ?protName }
OPTIONAL { ?pw bk:prefName ?pwName }
}
# ORDER BY RAND()
LIMIT 100