-
Notifications
You must be signed in to change notification settings - Fork 7
/
12_04_patentByCompound_Count.ttl
132 lines (120 loc) · 5.05 KB
/
12_04_patentByCompound_Count.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
@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 Compound: Count" ;
api:description "The total number of patents which mention the Compound specified";
api:uriTemplate "/patent/byCompound/count?uri={uri}" ;
api:itemTemplate "{uri}" ;
api:exampleRequestPath "/patent/byCompound/count?uri=http%3A%2F%2Frdf.ebi.ac.uk%2Fresource%2Fsurechembl%2Fmolecule%2FSCHEMBL1325" ;
api:viewer <#patentByCompoundCountViewer> ;
api:defaultViewer <#patentByCompoundCountViewer> .
] .
<#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 .
<#patentByCompoundCountViewer> a api:Viewer ;
api:name "patentByCompoundViewer" ;
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_compound_uri ;
schembl:SCCO_000028 ?rel_score ;
schembl:SCCO_000038 ?freq .
?schembl_compound_uri a schembl:SCCO_000010 .
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 }
}
} }
".