-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path12_09_patentByDisease.ttl
More file actions
144 lines (134 loc) · 5.73 KB
/
12_09_patentByDisease.ttl
File metadata and controls
144 lines (134 loc) · 5.73 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
@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 Disease: List" ;
api:description "A list of patents which mention the Disease specified";
api:uriTemplate "/patent/byDisease?uri={uri}" ;
api:exampleRequestPath "/patent/byDisease?uri=http%3A%2F%2Frdf.ebi.ac.uk%2Fresource%2Fsurechembl%2Fdisease%2FHMGCS1" ;
api:selector <#patentByDiseaseViewer> ;
api:viewer <#patentByDiseaseViewer> ;
api:defaultViewer <#patentByDiseaseViewer> .
] .
<#input> api:name "uri" ;
api:label "uri";
api:value "A disease URI. e.g.: http://rdf.ebi.ac.uk/resource/surechembl/disease/HMGCS1" ;
rdfs:range rdfs:Resource .
schembl:SCCO_000028 api:name "score" ;
api:label "score" ;
api:filterVariable "?assoc" ;
api:value "Only return patents in which the disease 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 disease 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 .
<#patentByDiseaseViewer> a api:Viewer ;
api:name "patentByDiseaseViewer" ;
api:template
"
?item dct:title ?title ;
ops:datePublished ?date ;
ops:mentions ?schembl_disease_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_disease_uri a schembl:SCCO_000035 ;
skos:prefLabel ?disease_name ;
void:inDataset <http://www.ebi.ac.uk/surechembl> .
schembl:SCCO_000035 skos:prefLabel 'Disease' ;
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_disease_uri ;
schembl:SCCO_000028 ?rel_score ;
schembl:SCCO_000038 ?freq .
?schembl_disease_uri a schembl:SCCO_000036 .
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_disease_uri schembl:SCCO_000037 ?disease_name }
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 )
}
" .