-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path04_16_pathwayInteractionsByEntity.ttl
298 lines (287 loc) · 13.3 KB
/
04_16_pathwayInteractionsByEntity.ttl
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
@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:variable wp:organism ;
api:variable _:direction ;
api:variable _:interaction_type ;
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:ListEndpoint ;
api:name "Pathway Interactions for Entity: List" ;
api:description "A list of interactions that the entity specified is a part of.";
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_7165> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_3702> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_1423> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_9913> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_6239> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_9615> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_7955> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_7227> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_9796> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_9031> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_5518> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_9606> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_10090> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_1773> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_4530> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_9598> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_10116> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_4932> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_4577> ;
api:variable <http://purl.obolibrary.org/obo/NCBITaxon_562> ;
api:variable wp:source ;
api:variable wp:target ;
api:variable wp:DirectedInteraction ;
api:variable wp:UndirectedInteraction ;
api:uriTemplate "/pathways/interactions/byEntity?uri={uri}" ;
api:itemTemplate "{uri}" ;
api:exampleRequestPath "/pathways/interactions/byEntity?uri=http%3A%2F%2Fidentifiers.org%2Fensembl%2FENSBTAG00000004037" ;
api:selector [
api:where "
GRAPH <http://www.wikipathways.org> {
?entity dc:identifier|wp:bdbUniprot ?pw_entity_uri ;
dcterms:isPartOf ?rev .
?rev dc:identifier ?pathway ;
dc:title ?title ;
wp:organism ?organism_uri ;
wp:organismName ?organism .
OPTIONAL {
?entity dcterms:isPartOf ?item .
?item a wp:Interaction ;
dcterms:isPartOf ?rev .
MINUS { ?item a wp:DirectedInteraction }
MINUS { ?item a wp:ComplexBinding }
BIND ( wp:UndirectedInteraction AS ?dir_interaction_type)
}
OPTIONAL {
?entity dcterms:isPartOf ?item .
?item a wp:DirectedInteraction,
?dir_interaction_type ;
?rel ?pw_entity_uri ;
dcterms:isPartOf ?rev .
}
FILTER ( BOUND( ?item ) )
}
"
];
api:viewer <#pathwayInteractionsByEntityViewer> ;
api:defaultViewer <#pathwayInteractionsByEntityViewer> . ] .
<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" .
<http://purl.obolibrary.org/obo/NCBITaxon_7165> api:name "Anopheles gambiae" .
<http://purl.obolibrary.org/obo/NCBITaxon_3702> api:name "Arabidopsis thaliana" .
<http://purl.obolibrary.org/obo/NCBITaxon_1423> api:name "Bacillus subtilis" .
<http://purl.obolibrary.org/obo/NCBITaxon_9913> api:name "Bos taurus" .
<http://purl.obolibrary.org/obo/NCBITaxon_6239> api:name "Caenorhabditis elegans" .
<http://purl.obolibrary.org/obo/NCBITaxon_9615> api:name "Canis familiaris" .
<http://purl.obolibrary.org/obo/NCBITaxon_7955> api:name "Danio rerio" .
<http://purl.obolibrary.org/obo/NCBITaxon_7227> api:name "Drosophila melanogaster" .
<http://purl.obolibrary.org/obo/NCBITaxon_9796> api:name "Equus caballus" .
<http://purl.obolibrary.org/obo/NCBITaxon_9031> api:name "Gallus gallus" .
<http://purl.obolibrary.org/obo/NCBITaxon_5518> api:name "Gibberella zeae" .
<http://purl.obolibrary.org/obo/NCBITaxon_9606> api:name "Homo sapiens" .
<http://purl.obolibrary.org/obo/NCBITaxon_10090> api:name "Mus musculus" .
<http://purl.obolibrary.org/obo/NCBITaxon_1773> api:name "Mycobacterium tuberculosis" .
<http://purl.obolibrary.org/obo/NCBITaxon_4530> api:name "Oryza sativa" .
<http://purl.obolibrary.org/obo/NCBITaxon_9598> api:name "Pan troglodytes" .
<http://purl.obolibrary.org/obo/NCBITaxon_10116> api:name "Rattus norvegicus" .
<http://purl.obolibrary.org/obo/NCBITaxon_4932> api:name "Saccharomyces cerevisiae" .
<http://purl.obolibrary.org/obo/NCBITaxon_4577> api:name "Zea mays" .
<http://purl.obolibrary.org/obo/NCBITaxon_562> api:name "Escherichia coli" .
wp:source api:name "down" .
wp:target api:name "up" .
wp:DirectedInteraction api:name "directed" .
wp:UndirectedInteraction api:name "undirected" .
wp:organism api:name "pathway_organism" ;
api:label "pathway_organism" ;
api:value "The rdfs:label for the pathway organism (URL encode). e.g.: Homo sapiens." ;
api:filterVariable "?rev";
a rdf:Property .
_:direction api:name "direction" ;
api:label "direction" ;
api:value "One of: 'up', 'down'. 'up' returns only Interactions where the specifies entity is the target, and 'down' returns only Interactions where the specified entity is the source." ;
api:filterVariable "?rel" ;
a rdf:Property ;
rdfs:subPropertyOf api:graphFilter .
_:interaction_type api:name "interaction_type" ;
api:label "interaction_type" ;
api:value "The type of interaction to return. One of: 'directed', 'undirected'" ;
api:filterVariable "?dir_interaction_type" ;
a rdf:Property ;
rdfs:subPropertyOf api:graphFilter .
<#input> api:name "uri" ;
api:label "uri";
api:value "An Entity URI. e.g.: http://identifiers.org/ensembl/ENSBTAG00000004037" ;
rdfs:range rdfs:Resource .
<#pathwayInteractionsByEntityViewer> a api:Viewer ;
api:name "pathwayInteractionsByEntityViewer" ;
api:template
"
?pathway sioc:latest_version ?rev ;
wp:organism ?organism_uri ;
dc:title ?title ;
void:inDataset <http://www.wikipathways.org> .
?organism_uri rdfs:label ?organism ;
void:inDataset <http://www.wikipathways.org> .
?interaction a wp:Interaction ;
a ?interaction_types ;
wp:participants ?participants ;
dcterms:isPartOf ?pathway ;
void:inDataset <http://www.wikipathways.org> .
?participants a ?part_type ;
wp:participants ?c_part ;
ops:source ?part_source ;
ops:target ?part_target ;
void:inDataset <http://www.wikipathways.org> .
?dir_interaction a wp:DirectedInteraction ;
a ?dir_interaction_types ;
wp:participants ?participants ;
ops:source ?source ;
ops:target ?target ;
dcterms:isPartOf ?pathway ;
void:inDataset <http://www.wikipathways.org> .
?source a ?source_type ;
wp:participants ?s_dir_c_part ;
ops:source ?source_source ;
ops:target ?source_target ;
void:inDataset <http://www.wikipathways.org> .
?target a ?target_type ;
wp:participants ?t_dir_c_part ;
ops:source ?target_source ;
ops: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 ?pathway ;
dc:title ?title ;
wp:organism ?organism_uri ;
wp:organismName ?organism .
?item dcterms:isPartOf ?rev .
OPTIONAL {
?item a wp:Interaction ;
wp:participants ?participants .
MINUS { ?item a wp:DirectedInteraction }
MINUS { ?item a wp:ComplexBinding }
?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 .
OPTIONAL {
?item a ?interaction_types .
FILTER ( ?interaction_types != wp:Interaction && ?interaction_types != wp:DirectedInteraction )
}
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 )
}
BIND ( ?item AS ?interaction )
}
OPTIONAL {
?item a wp:DirectedInteraction ;
wp:source ?source ;
wp:target ?target .
?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 )
}
OPTIONAL {
?item a ?dir_interaction_types .
FILTER ( ?dir_interaction_types != wp:Interaction && ?dir_interaction_types != wp:DirectedInteraction )
}
BIND ( ?item AS ?dir_interaction )
}
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 )
}
" .