forked from JMante1/jet-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPreceding_Percent_Query.txt
More file actions
49 lines (48 loc) · 1.83 KB
/
Preceding_Percent_Query.txt
File metadata and controls
49 lines (48 loc) · 1.83 KB
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
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX sbh: <http://wiki.synbiohub.org/wiki/Terms/synbiohub#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX sbol: <http://sbols.org/v2#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX purl: <http://purl.obolibrary.org/obo/>
select
#?s
?def2
(COUNT(?def2) AS ?count)
?role
?title
?displayId
(AVG(xsd:integer(?preceeding)) AS ?average_preceeding) # 1 means all preceeding, 0 means all following, is percentage preceeding
#?preceeding #if negative then component ends before start of queried component
#?start
#?end
#?startb
#?endb
#?def
where {
?s sbol:component ?comp .
?s sbol:component ?comp2 .
?comp sbol:definition ?def .
?comp2 sbol:definition ?def2 .
?s sbol:sequenceAnnotation ?sa .
?sa sbol:component ?comp2 .
?sa sbol:location ?loc .
#?loc sbol:start ?start .
?loc sbol:end ?end .
?s sbol:sequenceAnnotation ?sb .
?sb sbol:component ?comp .
?sb sbol:location ?locb .
?locb sbol:start ?startb .
#?locb sbol:end ?endb .
OPTIONAL {?def2 sbol:role ?role} .
OPTIONAL {?def2 dcterms:title ?title} .
OPTIONAL {?def2 sbol:displayId ?displayId} .
BIND(if(xsd:integer(?end)-xsd:integer(?startb) < 0, "0", "1") AS ?preceeding) .
filter(?def = <https://synbiohub.org/public/igem/BBa_E0040/1>) .
filter(?def2 != <https://synbiohub.org/public/igem/BBa_E0040/1>) .
filter (regex(?role, 'http://identifiers.org/so/SO:')) .
#filter (?role = <http://identifiers.org/so/SO:0000167> || (?role = <http://identifiers.org/so/SO:0000139>)|| (?role = <http://identifiers.org/so/SO:0000316>)|| (?role = <http://identifiers.org/so/SO:0000141>)) .
}
ORDER BY DESC(?count)