-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path0120_2union.sparql
More file actions
33 lines (30 loc) · 869 Bytes
/
0120_2union.sparql
File metadata and controls
33 lines (30 loc) · 869 Bytes
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
# [unions] 2 unions, no nesting
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/>
SELECT ?pname ?ename ?cname ?rtype
{
{ ?e a bk:Enzyme;
^bk:is_a ?p;
bk:ac_by|bk:in_by ?c.
?p a bk:Protein.
?c a bk:Comp.
BIND ( "is_a" AS ?rtype )
}
UNION
{ ?e a bk:Enzyme;
bk:ac_by ?p;
bk:ac_by|bk:in_by ?c.
?p a bk:Protein.
?c a bk:Comp
BIND ( "ac_by" AS ?rtype )
}
OPTIONAL { ?p bk:prefName ?pname }
OPTIONAL { ?e bk:prefName ?ename }
OPTIONAL { ?c bk:prefName ?cname }
}
# Random order ensures that sometimes one or the other path is selected
# ORDER BY RAND()
LIMIT 100