-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path12_05_patentByCompound.ttl
158 lines (146 loc) · 6.28 KB
/
12_05_patentByCompound.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
@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 api: <http://purl.org/linked-data/api/vocab#> .
@prefix schembl: <http://rdf.ebi.ac.uk/terms/surechembl#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix ops: <http://www.openphacts.org/api#> .
@prefix void: <http://rdfs.org/ns/void#> .
<#patent> a api:API ;
rdfs:label "Patent"@en ;
api:sparqlEndpoint <http://alpha.openphacts.org:8890/sparql/> ;
api:contentNegotiation api:parameterBased ;
api:variable <#input> ;
api:variable schembl:SCCO_000028 ;
api:variable schembl:SCCO_000038 ;
api:variable _:class ;
api:variable _:title ;
api:variable _:abstract ;
api:variable _:description ;
api:variable _:claims ;
api:variable _:image ;
api:variable _:cwu ;
api:description "An API configuration to return information about patents" ;
api:endpoint [
a api:ListEndpoint ;
api:name "Patents for Compound: List" ;
api:description "A list of patents which mention the Compound specified";
api:uriTemplate "/patent/byCompound?uri={uri}" ;
api:exampleRequestPath "/patent/byCompound?uri=http%3A%2F%2Frdf.ebi.ac.uk%2Fresource%2Fsurechembl%2Fmolecule%2FSCHEMBL1325" ;
api:selector <#patentByCompoundViewer> ;
api:viewer <#patentByCompoundViewer> ;
api:defaultViewer <#patentByCompoundViewer> .
] .
<#input> api:name "uri" ;
api:label "uri";
api:value "A compound URI. e.g.: http://rdf.ebi.ac.uk/resource/surechembl/molecule/SCHEMBL1325" ;
rdfs:range rdfs:Resource .
schembl:SCCO_000028 api:name "score" ;
api:label "score" ;
api:filterVariable "?assoc" ;
api:value "Only return patents in which the compound occurs with a relevance score equal to this number. An integer between 0 and 3." ;
a rdf:Property .
schembl:SCCO_000038 api:name "frequency" ;
api:label "frequency" ;
api:filterVariable "?assoc" ;
api:value "Only return patents in which the number of times the compound is mentioned is equal to this number. A positive integer." ;
a rdf:Property .
_:class api:name "classification" ;
api:label "classification" ;
api:filterVariable "?class_code" ;
api:value "Only return patents that have been classified with this classification code. The CPC, IPC and IPCR classification schemes are currently supported." ;
rdfs:subPropertyOf api:graphFilter ;
a rdf:Property .
_:title api:name "title" ;
api:label "title" ;
api:filterVariable "?title_occ" ;
api:value "If set to 'true' the method returns only entities mentioned in the title of the patent." ;
rdfs:subPropertyOf api:graphFilter ;
a rdf:Property .
_:abstract api:name "abstract" ;
api:label "abstract" ;
api:filterVariable "?abstract_occ" ;
api:value "If set to 'true' the method returns only entities mentioned in the abstract of the patent." ;
rdfs:subPropertyOf api:graphFilter ;
a rdf:Property .
_:description api:name "description" ;
api:label "description" ;
api:filterVariable "?desc_occ" ;
api:value "If set to 'true' the method returns only entities mentioned in the description section of the patent." ;
rdfs:subPropertyOf api:graphFilter ;
a rdf:Property .
_:claims api:name "claims" ;
api:label "claims" ;
api:filterVariable "?claims_occ" ;
api:value "If set to 'true' the method returns only entities mentioned in the claims section of the patent." ;
rdfs:subPropertyOf api:graphFilter ;
a rdf:Property .
_:image api:name "image" ;
api:label "image" ;
api:filterVariable "?image_occ" ;
api:value "If set to 'true' the method returns only entities in an image in the patent." ;
rdfs:subPropertyOf api:graphFilter ;
a rdf:Property .
_:cwu api:name "cwu" ;
api:label "cwu" ;
api:filterVariable "?cwu_occ" ;
api:value "If set to 'true' the method returns only entities mentioned in a CWU of the patent." ;
rdfs:subPropertyOf api:graphFilter ;
a rdf:Property .
<#patentByCompoundViewer> a api:Viewer ;
api:name "patentByCompoundViewer" ;
api:template
"
?item dct:title ?title ;
ops:datePublished ?date ;
ops:mentions ?schembl_compound_uri ;
ops:relevanceScore ?rel_score ;
ops:frequency ?freq ;
ops:occursInPatentTitle ?title_occ;
ops:occursInPatentAbstract ?abstract_occ ;
ops:occursInPatentDescription ?desc_occ ;
ops:occursInPatentClaims ?claims_occ ;
ops:occursInPatentImage ?image_occ ;
ops:occursInPatentCWU ?cwu_occ ;
void:inDataset <http://www.ebi.ac.uk/surechembl> .
?schembl_compound_uri a schembl:SCCO_000035 ;
ops:smiles ?compound_smiles ;
void:inDataset <http://www.ebi.ac.uk/surechembl> .
schembl:SCCO_000035 skos:prefLabel 'Compound' ;
void:inDataset <http://www.ebi.ac.uk/surechembl> .
";
api:where
"
GRAPH <http://www.ebi.ac.uk/surechembl> {
?item a schembl:SCCO_000002 ;
schembl:SCCO_000007 ?date .
?assoc schembl:SCCO_000020 ?item ;
schembl:SCCO_000021 ?schembl_compound_uri ;
schembl:SCCO_000028 ?rel_score ;
schembl:SCCO_000038 ?freq .
?schembl_compound_uri a schembl:SCCO_000010 .
OPTIONAL {
?item schembl:SCCO_000005 ?title_res .
?title_res schembl:SCCO_000030 ?title ;
schembl:SCCO_000031 'EN' .
}
OPTIONAL {
?item schembl:SCCO_000009 ?class_res .
?class_res schembl:SCCO_000033 ?class_code ;
schembl:SCCO_000034 ?class_sys .
}
OPTIONAL { ?assoc schembl:SCCO_000022 ?desc_occ_tmp }
OPTIONAL { ?assoc schembl:SCCO_000023 ?title_occ_tmp }
OPTIONAL { ?assoc schembl:SCCO_000024 ?claims_occ_tmp }
OPTIONAL { ?assoc schembl:SCCO_000025 ?abstract_occ_tmp }
OPTIONAL { ?assoc schembl:SCCO_000026 ?image_occ_tmp }
OPTIONAL { ?assoc schembl:SCCO_000027 ?cwu_occ_tmp }
OPTIONAL { ?schembl_compound_uri schembl:SCCO_000017 ?compound_smiles }
BIND ( IF( ?desc_occ_tmp = true, true, false ) AS ?desc_occ )
BIND ( IF( ?title_occ_tmp = true, true, false ) AS ?title_occ )
BIND ( IF( ?claims_occ_tmp = true, true, false ) AS ?claims_occ )
BIND ( IF( ?abstract_occ_tmp = true, true, false ) AS ?abstract_occ )
BIND ( IF( ?image_occ_tmp = true, true, false ) AS ?image_occ )
BIND ( IF( ?cwu_occ_tmp = true, true, false ) AS ?cwu_occ )
}
" .