-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path04_14_pathwayGetInteractions.ttl
More file actions
182 lines (177 loc) · 7.75 KB
/
04_14_pathwayGetInteractions.ttl
File metadata and controls
182 lines (177 loc) · 7.75 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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
@base <http://www.openphacts.org/api> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix api: <http://purl.org/linked-data/api/vocab#> .
@prefix rel: <http://vocab.org/relationship/> .
@prefix void: <http://rdfs.org/ns/void#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix drugbank: <http://bio2rdf.org/drugbank_vocabulary:> .
@prefix sio: <http://semanticscience.org/resource/>
@prefix obo: <http://purl.obolibrary.org/obo/> .
@prefix cheminf: <http://semanticscience.org/resource/> .
@prefix qudt: <http://qudt.org/1.1/schema/qudt#> .
@prefix ops: <http://www.openphacts.org/api#> .
@prefix cito: <http://purl.org/spar/cito/> .
@prefix wp: <http://vocabularies.wikipathways.org/wp#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix sioc: <http://sioc-project.org/ontology#> .
<#pathway> a api:API ;
rdfs:label "Pathway"@en ;
api:sparqlEndpoint <http://alpha.openphacts.org:8890/sparql/> ;
api:contentNegotiation api:parameterBased ;
api:variable <#input> ;
api:dataset <http://www.wikipathways.org> ;
api:vocabulary <http://vocabularies.wikipathways.org/wp#> ;
api:vocabulary <http://xmlns.com/foaf/0.1/> ;
api:vocabulary <http://purl.org/dc/elements/1.1/> ;
api:vocabulary <http://purl.org/dc/terms/> ;
api:description "An API configuration to return information about pathways." ;
api:endpoint [
a api:ItemEndpoint ;
api:name "Pathway Information: Get Interactions" ;
api:description "A list of interactions that are part of the pathway specified.";
api:uriTemplate "/pathway/getInteractions?uri={uri}" ;
api:itemTemplate "{uri}" ;
api:exampleRequestPath "/pathway/getInteractions?uri=http%3A%2F%2Fidentifiers.org%2Fwikipathways%2FWP1008" ;
api:viewer <#pathwayInteractionsViewer> ;
api:defaultViewer <#pathwayInteractionsViewer> . ] .
<http://www.wikipathways.org> api:label "WikiPathways" .
<http://vocabularies.wikipathways.org/wp#> api:label "wikipathways" .
<http://xmlns.com/foaf/0.1/> api:label "foaf" .
<http://purl.org/dc/elements/1.1/> api:label "dc" .
<http://purl.org/dc/terms/> api:label "dcterms" .
<#input> api:name "uri" ;
api:label "uri";
api:value "A Pathway URI. e.g.: http://identifiers.org/wikipathways/WP1008" ;
rdfs:range rdfs:Resource .
<#pathwayInteractionsViewer> a api:Viewer ;
api:name "pathwayInteractionsViewer" ;
api:template
"
?ops_item skos:exactMatch ?pw_uri .
?pw_uri sioc:latest_version ?rev .
?rev dc:title ?title ;
dcterms:hasPart ?interaction ;
dcterms:hasPart ?dir_interaction ;
void:inDataset <http://www.wikipathways.org> .
?interaction a wp:Interaction ;
wp:participants ?participants ;
void:inDataset <http://www.wikipathways.org> .
?participants a ?part_type ;
wp:participants ?c_part ;
wp:source ?part_source ;
wp:target ?part_target ;
void:inDataset <http://www.wikipathways.org> .
?dir_interaction a wp:DirectedInteraction ;
wp:source ?source ;
wp:target ?target ;
void:inDataset <http://www.wikipathways.org> .
?source a ?source_type ;
wp:participants ?s_dir_c_part ;
wp:source ?source_source ;
wp:target ?source_target ;
void:inDataset <http://www.wikipathways.org> .
?target a ?target_type ;
wp:participants ?t_dir_c_part ;
wp:source ?target_source ;
wp:target ?target_target ;
void:inDataset <http://www.wikipathways.org> .
?c_part a ?c_part_type ;
void:inDataset <http://www.wikipathways.org> .
?s_dir_c_part a ?s_dir_c_part_type ;
void:inDataset <http://www.wikipathways.org> .
?t_dir_c_part a ?t_dir_c_part_type ;
void:inDataset <http://www.wikipathways.org> .
?part_source a ?part_source_type ;
void:inDataset <http://www.wikipathways.org> .
?part_target a ?part_target_type ;
void:inDataset <http://www.wikipathways.org> .
?source_source a ?source_source_type ;
void:inDataset <http://www.wikipathways.org> .
?source_target a ?source_target_type ;
void:inDataset <http://www.wikipathways.org> .
?target_source a ?target_source_type ;
void:inDataset <http://www.wikipathways.org> .
?target_target a ?target_target_type ;
void:inDataset <http://www.wikipathways.org> .
";
api:where
"
GRAPH <http://www.wikipathways.org> {
?rev dc:identifier ?pw_uri .
?rev dc:title ?title .
OPTIONAL {
?interaction dcterms:isPartOf ?rev ;
a wp:Interaction ;
wp:participants ?participants .
MINUS { ?interaction a wp:DirectedInteraction }
MINUS { ?interaction a wp:ComplexBinding }
MINUS { [] wp:participants|wp:source|wp:target ?interaction }
?participants a ?part_type_tmp .
FILTER ( ?part_type_tmp != wp:DataNode || STRSTARTS( STR( ?part_type_tmp ), 'http://identifiers.org/wikipathways/WP' ) )
OPTIONAL {
?participants wp:participants ?c_part .
MINUS { ?participants wp:source [] }
?c_part a ?c_part_type .
FILTER ( ?c_part_type != wp:DataNode || STRSTARTS( STR( ?c_part_type ), 'http://identifiers.org/wikipathways/WP' ) )
}
OPTIONAL {
?participants wp:source ?part_source .
?participants wp:target ?part_target .
?part_source a ?part_source_type .
?part_target a ?part_target_type .
FILTER ( ?part_source_type != wp:DataNode || STRSTARTS( STR( ?part_source_type ), 'http://identifiers.org/wikipathways/WP' ) )
FILTER ( ?part_target_type != wp:DataNode || STRSTARTS( STR( ?part_target_type ), 'http://identifiers.org/wikipathways/WP' ) )
BIND ( true AS ?part_directed )
}
}
OPTIONAL {
?dir_interaction dcterms:isPartOf ?rev ;
a wp:DirectedInteraction ;
wp:source ?source ;
wp:target ?target .
MINUS { [] wp:participants|wp:source|wp:target ?dir_interaction }
?source a ?source_type_tmp .
?target a ?target_type_tmp .
FILTER ( ?source_type_tmp != wp:DataNode || STRSTARTS( STR( ?source ), 'http://identifiers.org/wikipathways/WP' ) )
FILTER ( ?target_type_tmp != wp:DataNode || STRSTARTS( STR( ?target ), 'http://identifiers.org/wikipathways/WP' ) )
OPTIONAL {
?source wp:participants ?s_dir_c_part .
MINUS { ?source wp:source [] }
?s_dir_c_part a ?s_dir_c_part_type .
FILTER ( ?s_dir_c_part_type != wp:DataNode || STRSTARTS( STR( ?s_dir_c_part ), 'http://identifiers.org/wikipathways/WP' ) )
}
OPTIONAL {
?target wp:participants ?t_dir_c_part .
MINUS { ?target wp:source [] }
?t_dir_c_part a ?t_dir_c_part_type .
FILTER ( ?t_dir_c_part_type != wp:DataNode || STRSTARTS( STR( ?t_dir_c_part ), 'http://identifiers.org/wikipathways/WP' ) )
}
OPTIONAL {
?source wp:source ?source_source .
?source wp:target ?source_target .
?source_source a ?source_source_type .
?source_target a ?source_target_type .
FILTER ( ?source_source_type != wp:DataNode || STRSTARTS( STR( ?source_source ), 'http://identifiers.org/wikipathways/WP' ) )
FILTER ( ?source_target_type != wp:DataNode || STRSTARTS( STR( ?source_target ), 'http://identifiers.org/wikipathways/WP' ) )
BIND ( true AS ?source_directed )
}
OPTIONAL {
?target wp:source ?target_source .
?target wp:target ?target_target .
?target_source a ?target_source_type .
?target_target a ?target_target_type .
FILTER ( ?target_source_type != wp:DataNode || STRSTARTS( STR( ?target_source ), 'http://identifiers.org/wikipathways/WP' ) )
FILTER ( ?target_target_type != wp:DataNode || STRSTARTS( STR( ?target_target ), 'http://identifiers.org/wikipathways/WP' ) )
BIND ( true AS ?target_directed )
}
}
BIND ( IF ( ?part_directed, wp:DirectedInteraction, ?part_type_tmp ) AS ?part_type )
BIND ( IF ( ?source_directed, wp:DirectedInteraction, ?source_type_tmp ) AS ?source_type )
BIND ( IF ( ?target_directed, wp:DirectedInteraction, ?target_type_tmp ) AS ?target_type )
}
" .