-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path01_02_compoundInfo_Batch.ttl
175 lines (168 loc) · 7.36 KB
/
01_02_compoundInfo_Batch.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
@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 aers: <http://aers.data2semantics.org/vocab/> .
@prefix scco: <http://rdf.ebi.ac.uk/terms/surechembl#> .
<#compound> a api:API ;
rdfs:label "Compound"@en ;
api:sparqlEndpoint <http://alpha.openphacts.org:8890/sparql/> ;
api:contentNegotiation api:parameterBased ;
api:variable <#input> ;
api:dataset <http://www.conceptwiki.org> ;
api:dataset <http://www.ebi.ac.uk/chembl>;
api:dataset <http://www.openphacts.org/bio2rdf/drugbank> ;
api:vocabulary <http://semanticscience.org/resource/> ;
api:vocabulary <http://bio2rdf.org/drugbank_vocabulary:> ;
api:vocabulary <http://www.w3.org/2004/02/skos/core#> ;
api:description "An API configuration to return information about compounds" ;
api:endpoint [
a api:BatchEndpoint ;
api:name "Compound Information: Batch" ;
api:description "Information about compounds provided in a list sperated by '|'.";
api:uriTemplate "/compound/batch?uri_list={uri_list}" ;
api:exampleRequestPath "/compound/batch?uri_list=http%3A%2F%2Fwww.conceptwiki.org%2Fconcept%2F38932552-111f-4a4e-a46a-4ed1d7bdf9d5|http%3A%2F%2Fwww.conceptwiki.org%2Fconcept%2Fdd758846-1dac-4f0d-a329-06af9a7fa413";
api:viewer <#compoundBatchViewer> ;
api:defaultViewer <#compoundBatchViewer> ] .
<http://www.conceptwiki.org> api:label "ConceptWiki" .
<http://www.ebi.ac.uk/chembl> api:label "ChEMBL - RDF" .
<http://www.openphacts.org/bio2rdf/drugbank> api:label "DrugBank" .
<http://semanticscience.org/resource/> api:label "sio" .
<http://bio2rdf.org/drugbank_vocabulary:> api:label "drugbank" .
<http://www.w3.org/2004/02/skos/core#> api:label "skos" .
<#input> api:name "uri_list" ;
api:label "uri_list";
api:value "A list of compound URIs. e.g.: http://www.conceptwiki.org/concept/38932552-111f-4a4e-a46a-4ed1d7bdf9d5|http://www.conceptwiki.org/concept/dd758846-1dac-4f0d-a329-06af9a7fa413" ;
rdfs:range rdfs:Resource .
<#compoundBatchViewer> a api:Viewer ;
api:name "compoundBatchViewer" ;
api:template
"""?ims_cw_compound_uri skos:prefLabel ?compound_name ;
void:inDataset <http://www.conceptwiki.org> .
?ims_ocrs_compound_uri ops:smiles ?smiles ;
ops:inchi ?inchi ;
ops:inchikey ?inchiKey ;
ops:logp ?alogp ;
ops:hba ?hba ;
ops:hbd ?hbd ;
ops:ro5_violations ?num_ro5_violations ;
ops:psa ?psa;
ops:rtb ?rtb;
ops:molweight ?molweight ;
ops:molformula ?molformula ;
void:inDataset <http://chemistry.openphacts.org> .
?ims_chembl_compound_uri ?bNode1 ?mw_freebase ;
a ?mol_type;
void:inDataset <http://www.ebi.ac.uk/chembl>.
?ims_db_compound_uri drugbank:biotransformation ?biotransformation ;
drugbank:description ?description ;
drugbank:proteinBinding ?proteinBinding ;
drugbank:toxicity ?toxicity ;
drugbank:meltingPoint ?meltingPoint ;
ops:drugInteraction ?interaction ;
void:inDataset <http://www.openphacts.org/bio2rdf/drugbank> .
?interaction ops:interactingDrug ?interacting_drug ;
drugbank:text ?interaction_text ;
void:inDataset <http://www.openphacts.org/bio2rdf/drugbank> .
?ims_schembl_compound_uri ops:smiles ?s_smiles ;
ops:inchi ?s_inchi ;
ops:inchiKey ?s_inchiKey ;
ops:logp ?s_logp ;
ops:molweight ?s_molweight ;
ops:hbd ?s_hbd ;
ops:hba ?s_hba ;
ops:rings ?s_rings ;
ops:rotable_bonds ?s_rotable_bonds ;
void:inDataset <http://rdf.ebi.ac.uk/dataset/surechembl/1.1/void.ttl#surechembl_rdf_molecule_dataset> .
""";
api:where
"""{ GRAPH <http://chemistry.openphacts.org> {
?ims_ocrs_compound_uri cheminf:CHEMINF_000018 ?smiles.
?ims_ocrs_compound_uri cheminf:CHEMINF_000396 ?inchi.
?ims_ocrs_compound_uri cheminf:CHEMINF_000399 ?inchiKey.
{ ?ims_ocrs_compound_uri cheminf:CHEMINF_000490 ?molformula . }
UNION { [] obo:IAO_0000136 ?ims_ocrs_compound_uri ;
a cheminf:CHEMINF_000484 ;
qudt:numericValue ?molweight . }
UNION { [] obo:IAO_0000136 ?ims_ocrs_compound_uri ;
a cheminf:CHEMINF_000348 ;
qudt:numericValue ?rtb . }
UNION { [] obo:IAO_0000136 ?ims_ocrs_compound_uri ;
a cheminf:CHEMINF_000321;
qudt:numericValue ?alogp . }
UNION { [] obo:IAO_0000136 ?ims_ocrs_compound_uri ;
a cheminf:CHEMINF_000345;
qudt:numericValue ?hba . }
UNION { [] obo:IAO_0000136 ?ims_ocrs_compound_uri ;
a cheminf:CHEMINF_000346;
qudt:numericValue ?hbd . }
UNION { [] obo:IAO_0000136 ?ims_ocrs_compound_uri ;
a cheminf:CHEMINF_000367;
qudt:numericValue ?num_ro5_violations . }
UNION { [] obo:IAO_0000136 ?ims_ocrs_compound_uri ;
a cheminf:CHEMINF_000349;
qudt:numericValue ?psa . }
} }
UNION {
GRAPH <http://www.conceptwiki.org> {
?ims_cw_compound_uri skos:prefLabel ?compound_name.
}
}
UNION {
GRAPH <http://www.ebi.ac.uk/chembl> {
?ims_chembl_compound_uri a ?mol_type .
OPTIONAL { ?ims_chembl_compound_uri sio:SIO_000008 ?bNode1 .
?bNode1 a sio:CHEMINF_000350 ;
sio:SIO_000300 ?mw_freebase. }
}
}
UNION {
GRAPH <http://www.openphacts.org/bio2rdf/drugbank> {
{ ?ims_db_compound_uri drugbank:affected-organism/dcterms:title ?affectedOrganism . }
UNION { ?ims_db_compound_uri drugbank:metabolism/dcterms:description ?metabolism . }
UNION { ?ims_db_compound_uri dcterms:description ?description . }
UNION { ?ims_db_compound_uri drugbank:indication/dcterms:description ?indication . }
UNION { ?ims_db_compound_uri drugbank:protein-binding/dcterms:description ?proteinBinding . }
UNION { ?ims_db_compound_uri drugbank:toxicity/dcterms:description ?toxicity . }
UNION { ?ims_db_compound_uri drugbank:experimental-properties ?mp_prop .
?mp_prop a drugbank:Melting-Point ;
drugbank:value ?meltingPoint }
UNION { ?ims_db_compound_uri dcterms:title ?drug_name }
UNION { ?ims_db_compound_uri drugbank:drug-group/dcterms:title ?drugType . }
UNION { ?ims_db_compound_uri drugbank:ddi-interactor-in ?interaction .
?interacting_drug drugbank:ddi-interactor-in ?interaction .
?interaction dcterms:title ?interaction_text .
FILTER (?ims_db_compound_uri != ?interacting_drug) }
}
}
UNION {
GRAPH <http://www.ebi.ac.uk/surechembl> {
{
?ims_schembl_compound_uri a scco:SCCO_000010 ;
scco:SCCO_000017 ?s_smiles ;
scco:SCCO_000018 ?s_inchi ;
scco:SCCO_000019 ?s_inchiKey ;
scco:SCCO_000011 ?s_molweight ;
scco:SCCO_000012 ?s_logp
}
OPTIONAL { ?ims_schembl_compound_uri scco:SCCO_000013 ?s_hbd }
OPTIONAL { ?ims_schembl_compound_uri scco:SCCO_000014 ?s_hba }
OPTIONAL { ?ims_schembl_compound_uri scco:SCCO_000015 ?s_rings }
OPTIONAL { ?ims_schembl_compound_uri scco:SCCO_000016 ?s_rotable_bonds }
}
}
""" .