-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path03_04_targetMembers.ttl
149 lines (142 loc) · 5.73 KB
/
03_04_targetMembers.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
@base <http://www.openphacts.org/api#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix uniprot: <http://purl.uniprot.org/core/> .
@prefix api: <http://purl.org/linked-data/api/vocab#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix ops: <http://www.openphacts.org/api#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix chembl: <http://rdf.ebi.ac.uk/terms/chembl#> .
@prefix obo: <http://www.semantic-systems-biology.org/ontology/rdf/OBO#> .
@prefix goa: <http://www.semantic-systems-biology.org/ontology/rdf/GOA#> .
<#target> a api:API ;
rdfs:label "Target"@en ;
api:sparqlEndpoint <http://alpha.openphacts.org:8890/sparql/> ;
api:contentNegotiation api:parameterBased ;
api:variable <#input> ;
api:variable chembl:organismName ;
api:variable uniprot:organism ;
api:dataset <http://www.ebi.ac.uk/chembl> ;
api:dataset <http://purl.uniprot.org/enzyme/> ;
api:dataset <http://www.geneontology.org> ;
api:vocabulary rdfs: ;
api:vocabulary skos: ;
api:vocabulary uniprot: ;
api:vocabulary dcterms: ;
api:description "An API configuration to return information about targets." ;
api:endpoint [
a api:IntermediateExpansionEndpoint ;
api:name "Target Class Members: List" ;
api:description "A list of targets classified with the given class in the supported hierarchies. Currently supported hierarchies are the Enzyme Classification, the ChEMBL Target Tree and the Gene Ontology." ;
api:itemTemplate "{uri}" ;
api:variable <http://purl.uniprot.org/enzyme> ;
api:variable <http://www.ebi.ac.uk/chembl/target> ;
api:variable <http://www.geneontology.org> ;
api:uriTemplate "/target/members/pages?uri={uri}" ;
api:exampleRequestPath "/target/members/pages?uri=http%3A%2F%2Fpurl.uniprot.org%2Fenzyme%2F6.2.-.-";
api:exampleRequestPath "/target/members/pages?uri=http%3A%2F%2Fpurl.uniprot.org%2Fenzyme%2F6.2.-.-&target_organism=Homo%20sapiens";
api:selector [
api:where
"VALUES ?g { <http://purl.uniprot.org/enzyme/inference> <http://www.ebi.ac.uk/chembl/target/inference> <http://www.geneontology.org/inference> }
GRAPH ?g {
?child_node rdfs:subClassOf ?node_uri.
FILTER ( isURI(?child_node) )
}
{ ?item obo:C ?child_node .
?item uniprot:reviewed true }
UNION { ?item obo:F ?child_node .
?item uniprot:reviewed true }
UNION { ?item obo:P ?child_node .
?item uniprot:reviewed true }
UNION { ?item uniprot:enzyme|uniprot:domain/uniprot:enzyme|chembl:hasProteinClassification ?child_node }
VALUES ?g2 {<http://purl.uniprot.org> <http://www.ebi.ac.uk/chembl> <http://www.openphacts.org/goa> }
GRAPH ?g2 {
?item [] []
}
{ ?item dcterms:title ?chembl_name
FILTER (?chembl_name != '') }
UNION { ?item goa:description ?uniprot_name
FILTER (?uniprot_name != '') }
OPTIONAL {
{?mapping skos:relatedMatch/skos:exactMatch ?item }
UNION { ?item skos:relatedMatch/skos:exactMatch ?mapping }
MINUS { ?mapping a chembl:ProteinComplexGroup }
{ ?mapping goa:description ?mapping_name }
UNION { ?mapping dcterms:title ?mapping_name }
FILTER ( ?mapping_name != '' )
{ ?mapping uniprot:organism ?mapping_org_uri }
UNION { ?mapping chembl:organismName ?mapping_org
GRAPH <http://www.ebi.ac.uk/chembl> {
?mapping a ?mapping_type
FILTER ( ?mapping_type != chembl:UniprotRef )
}
}
BIND(IF(BOUND(?mapping_org), <http://www.ebi.ac.uk/chembl>, <http://purl.uniprot.org>) AS ?mapping_dataset)
}
OPTIONAL { ?item uniprot:organism ?uniprot_organism
BIND (?item AS ?uniprot_target) }
OPTIONAL {
GRAPH <http://www.ebi.ac.uk/chembl> {
?item a ?target_type
}
}
OPTIONAL { ?item chembl:organismName ?chembl_organism
BIND (?item AS ?chembl_target) }
"] ;
api:expansionVariable "item" ;
api:viewer <#targetMemberViewer> ;
api:defaultViewer <#targetMemberViewer> ] .
<http://www.ebi.ac.uk/chembl> api:label "ChEMBL - RDF" .
<http://purl.uniprot.org/enzyme/> api:label "Enzyme Classification" .
<http://www.geneontology.org> api:name "Gene Ontology" .
<http://www.ebi.ac.uk/chembl/target> api:name "chembl" .
<http://purl.uniprot.org/enzyme> api:name "enzyme" .
<http://www.geneontology.org> api:name "go" .
chembl:organismName api:name "target_organism" ;
api:label "target_organism" ;
api:value "A literal organism in ChEMBL." ;
api:filterVariable "?item";
a rdf:Property .
uniprot:organism api:name "target_organism_uri" ;
api:label "target_organism_uri" ;
api:value "An organism URI from Uniprot. e.g. http://purl.uniprot.org/taxonomy/386043" ;
api:filterVariable "?item";
a rdf:Property .
<#input> api:name "uri" ;
api:label "uri";
api:value "A class URI from one of the supported hierarchies. e.g.: http://purl.uniprot.org/enzyme/6.2.-.-" ;
rdfs:range rdfs:Resource .
<#targetMemberViewer> a api:Viewer ;
api:name "targetMemberViewer";
api:template
"?ims_uniprot_target_uri skos:prefLabel ?uniprot_name ;
uniprot:organism ?uniprot_organism ;
void:inDataset <http://purl.uniprot.org> .
?ims_chembl_target_uri skos:prefLabel ?chembl_name ;
chembl:organismName ?chembl_organism ;
rdf:type ?target_type ;
void:inDataset <http://www.ebi.ac.uk/chembl> .
?item skos:exactMatch ?mapping .
?mapping skos:prefLabel ?mapping_name ;
uniprot:organism ?mapping_org_uri ;
chembl:organismName ?mapping_org ;
a ?mapping_type ;
void:inDataset ?mapping_dataset .
ops:no_mappings_found rdfs:label 'No mappings found' .
";
api:where
"
{ GRAPH <http://www.openphacts.org/goa> {
?ims_uniprot_target_uri goa:description ?uniprot_name
GRAPH <http://purl.uniprot.org> {
?ims_uniprot_target_uri uniprot:organism ?uniprot_organism
}
}
} UNION {
GRAPH <http://www.ebi.ac.uk/chembl> {
?ims_chembl_target_uri dcterms:title ?chembl_name
OPTIONAL { ?ims_chembl_target_uri a ?target_type }
OPTIONAL { ?ims_chembl_target_uri chembl:organismName ?chembl_organism }
}
}
FILTER (?uniprot_name != '')
" .