-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path12_08_patentByDisease_Count.ttl
More file actions
118 lines (108 loc) · 4.51 KB
/
12_08_patentByDisease_Count.ttl
File metadata and controls
118 lines (108 loc) · 4.51 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
@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:ItemEndpoint ;
api:name "Patents for Disease: Count" ;
api:description "The total number of patents which mention the Disease specified";
api:uriTemplate "/patent/byDisease/count?uri={uri}" ;
api:itemTemplate "{uri}" ;
api:exampleRequestPath "/patent/byDisease/count?uri=http%3A%2F%2Frdf.ebi.ac.uk%2Fresource%2Fsurechembl%2Findication%2FD002561" ;
api:viewer <#patentByDiseaseCountViewer> ;
api:defaultViewer <#patentByDiseaseCountViewer> .
] .
<#input> api:name "uri" ;
api:label "uri";
api:value "A disease URI. e.g.: http://rdf.ebi.ac.uk/resource/surechembl/indication/D002561" ;
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 .
<#patentByDiseaseCountViewer> a api:Viewer ;
api:name "patentByDiseaseViewer" ;
api:template
"
?ops_item ops:patent_count ?count ;
void:inDataset <http://www.ebi.ac.uk/surechembl> .
";
api:where
"
{ SELECT ( COUNT ( DISTINCT ?item ) AS ?count ) WHERE {
GRAPH <http://www.ebi.ac.uk/surechembl> {
?item a schembl:SCCO_000002 .
?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_000009 ?class_res .
?class_res schembl:SCCO_000033 ?class_code ;
schembl:SCCO_000034 ?class_sys .
}
OPTIONAL { ?assoc schembl:SCCO_000022 ?desc_occ }
OPTIONAL { ?assoc schembl:SCCO_000023 ?title_occ }
OPTIONAL { ?assoc schembl:SCCO_000024 ?claims_occ }
OPTIONAL { ?assoc schembl:SCCO_000025 ?abstract_occ }
OPTIONAL { ?assoc schembl:SCCO_000026 ?image_occ }
OPTIONAL { ?assoc schembl:SCCO_000027 ?cwu_occ }
}
} }
".