-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspending.ttl
282 lines (235 loc) · 7.87 KB
/
spending.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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@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 gc: <http://puelia-php.googlecode.com/svn/trunk/documents/config.ttl#> .
@prefix rel: <http://vocab.org/relationship/> .
@prefix spec: <http://www.epimorphics.com/examples/specSchools#> .
@prefix climb: <http://climb.dataincubator.org/vocabs/climb/> .
@prefix space: <http://purl.org/net/schemas/space/> .
@prefix payment: <http://reference.data.gov.uk/def/payment#> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix administrative-geography: <http://statistics.data.gov.uk/def/administrative-geography/> .
@prefix admingeo: <http://data.ordnancesurvey.co.uk/ontology/admingeo/> .
@prefix interval: <http://reference.data.gov.uk/def/intervals/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix spec: <http://dev.local/puelia/api-config#> .
spec:SpendingAPI
a
api:API ;
rdfs:label
"Local Authority Spending Data"@en ;
api:maxPageSize
"500";
api:defaultPageSize
"100" ;
api:endpoint
spec:councilList ,
spec:councilPaymentsList ,
spec:councilPaymentsYearList ,
spec:councilPaymentsMonthList ,
spec:paymentYearList ,
spec:paymentYearMonthList ;
api:sparqlEndpoint
<http://api.talis.com/stores/lga-aggregate/services/sparql> ;
api:defaultViewer
api:describeViewer ;
api:viewer
spec:minimalViewer ,
spec:labelViewer ,
spec:payerViewer ,
spec:paymentViewer ;
api:defaultFormatter
api:JsonFormatter ;
api:contentNegotiation
api:suffixBased
.
##########################################
# List Endpoints
##########################################
# all councils with payments
#
# /councils
spec:councilList a api:ListEndpoint ;
api:uriTemplate "/councils" ;
api:defaultViewer api:describeViewer ;
api:defaultFormatter api:JsonFormatter ;
api:viewer
spec:labelViewer ,
spec:minimalViewer ,
spec:payerViewer ;
api:selector [
api:where "{ ?p payment:payer ?item }" ;
] .
# payments from a council
#
# /councils/{snac}
spec:councilPaymentsList a api:ListEndpoint ;
api:uriTemplate "/councils/{snac}" ;
api:variable [
a api:Variable ;
api:name "snacVar" ;
api:value "{snac}" ;
api:type administrative-geography:StandardCode ;
] ;
api:defaultViewer api:describeViewer ;
api:defaultFormatter api:JsonFormatter ;
api:viewer
spec:labelViewer ,
spec:minimalViewer ,
spec:payerViewer ;
api:selector [
api:where "{ ?item payment:payer ?payer . ?payer skos:notation ?snacVar }" ;
] .
# payments from a council in a year
#
# /councils/{snac}/{year}
spec:councilPaymentsYearList a api:ListEndpoint ;
api:uriTemplate "/councils/{snac}/{year}" ;
api:variable [
a api:Variable ;
api:name "snacVar" ;
api:value "{snac}" ;
api:type administrative-geography:StandardCode ;
] ;
api:variable [
a api:Variable ;
api:name "yearVar" ;
api:value "{year}" ;
api:type xsd:integer ;
] ;
api:defaultViewer api:describeViewer ;
api:viewer
spec:labelViewer ,
spec:minimalViewer ,
spec:paymentViewer ;
api:defaultFormatter api:JsonFormatter ;
api:selector [
api:where " { ?item a payment:Payment ; payment:date ?date . ?date interval:ordinalYear ?yearVar . ?item payment:payer ?payer . ?payer skos:notation ?snacVar }"
] .
# payments from a council in a month of a year
#
# /councils/{snac}/{year}/{month}
spec:councilPaymentsMonthList a api:ListEndpoint ;
api:uriTemplate "/councils/{snac}/{year}/{month}" ;
api:variable [
a api:Variable ;
api:name "snacVar" ;
api:value "{snac}" ;
api:type administrative-geography:StandardCode ;
] ;
api:variable [
a api:Variable ;
api:name "yearVar" ;
api:value "{year}" ;
api:type xsd:integer ;
] ;
api:variable [
a api:Variable ;
api:name "monthVar" ;
api:value "{month}" ;
api:type xsd:integer ;
] ;
api:defaultViewer api:describeViewer ;
api:viewer
spec:labelViewer ,
spec:minimalViewer ,
spec:paymentViewer ;
api:defaultFormatter api:JsonFormatter ;
api:selector [
api:where " { ?item a payment:Payment ; payment:date ?date . ?date interval:ordinalYear ?yearVar ; interval:ordinalMonthOfYear ?monthVar . ?item payment:payer ?payer . ?payer skos:notation ?snacVar }"
] .
# payments of all councils in a year
#
# /payments/{year}
spec:paymentYearList a api:ListEndpoint ;
api:uriTemplate "/payments/{year}" ;
api:variable [
a api:Variable ;
api:name "yearVar" ;
api:value "{year}" ;
api:type xsd:integer ;
] ;
api:defaultViewer api:describeViewer ;
api:viewer
spec:labelViewer ,
spec:minimalViewer ,
spec:paymentViewer ;
api:defaultFormatter api:JsonFormatter ;
api:selector [
api:where "{ ?item a payment:Payment ; payment:date ?date . ?date interval:ordinalYear ?yearVar } "
] .
# payments of all councils in a month of a year
#
# /payments/{year}/{month}
spec:paymentYearMonthList a api:ListEndpoint ;
api:uriTemplate "/payments/{year}/{month}" ;
api:variable [
a api:Variable ;
api:name "yearVar" ;
api:value "{year}" ;
api:type xsd:integer ;
] ;
api:variable [
a api:Variable ;
api:name "monthVar" ;
api:value "{month}" ;
api:type xsd:integer ;
] ;
api:defaultViewer api:describeViewer ;
api:viewer
spec:labelViewer ,
spec:minimalViewer ,
spec:paymentViewer ;
api:defaultFormatter api:JsonFormatter ;
api:selector [
api:where "{ ?item a payment:Payment ; payment:date ?date . ?date interval:ordinalYear ?yearVar ; interval:ordinalMonthOfYear ?monthVar }"
] .
##########################################
# Item Endpoints
##########################################
##########################################
# Viewers
##########################################
spec:labelViewer
a api:Viewer ;
api:name "labelViewer" ;
api:properties "label" .
spec:minimalViewer
a api:Viewer ;
api:name "minimalViewer" ;
api:properties "label,prefLabel,altLabel,type" .
spec:payerViewer
a api:Viewer ;
api:name "payerViewer";
api:properties "label,prefLabel,notation" .
spec:paymentViewer
a api:Viewer ;
api:name "paymentViewer";
api:properties "payer.label,payer.notation,payee.label,date.ordinalYear,date.ordinalMonthOfYear,date.ordinalDayOfMonth,totalNetAmount" .
##########################################
# Formatters
##########################################
##########################################
# Vocabs
##########################################
rdf:type api:label "type" ; api:multiValued true .
rdfs:label api:label "label" ; api:multiValued true .
skos:prefLabel api:label "prefLabel" .
skos:altLabel api:label "altLabel" ; api:multiValued true .
skos:notation api:label "notation" .
payment:payer a rdfs:Property ; api:label "payer" .
payment:payee a rdfs:Property ; api:label "payee" .
payment:date a rdfs:Property ; api:label "date" .
payment:totalNetAmount a rdfs:Property ; api:label "totalNetAmount" .
payment:Payment a rdf:Class ; api:label "payment" .
admingeo:LocalAuthority a rdf:Class ; api:label "localAuthority" .
interval:ordinalYear a rdfs:Property ; api:label "ordinalYear" .
interval:ordinalMonthOfYear a rdfs:Property ; api:label "ordinalMonthOfYear" .
interval:ordinalDayOfMonth a rdfs:Property ; api:label "ordinalDayOfMonth" .