-
Notifications
You must be signed in to change notification settings - Fork 2
/
prefixcommons-swagger-api-definition.yaml
274 lines (253 loc) · 6.98 KB
/
prefixcommons-swagger-api-definition.yaml
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
swagger: '2.0'
info:
title: PrefixCommons API
description: Prefixcommons API
version: "0.1.0"
contact:
name: Michel Dumontier
url: http://dumontierlab.stanford.edu
email: michel.dumontier@stanford.edu
license:
name: Creative Commons By Attribution 4.0
url: https://creativecommons.org/licenses/by/4.0
host: api.prefixcommons.org
schemes:
- http
- https
basePath: /v1
produces:
- application/json
paths:
/resources:
get:
summary: Resources
description: |
Get a list of all the resources in the repository.
The response includes the identifier and display name for each resource
tags:
- Resources
responses:
200:
description: An array of resources
schema:
type: array
items:
$ref: '#/definitions/Resource'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/resource:
get:
summary: Resource
description: |
Return resources based on ID
parameters:
- name: id
in: query
description: Resource identifier
required: true
type: array
items:
type: string
collectionFormat: csv
tags:
- Resources
responses:
200:
description: An array of price estimates by product
schema:
type: object
items:
$ref: '#/definitions/Resource'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/resource/prefix:
get:
summary: Resource
description: Get one or more resources that match a prefix
responses:
200:
description: An array of resources
schema:
type: array
items:
$ref: '#/definitions/Resource'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/organizations:
get:
summary: Get a list of all organizations that provide a resource
tags:
- Providers
responses:
200:
description: A list of the organizations
schema:
type: array
items:
$ref: '#/definitions/Organization'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
definitions:
Organization:
type: object
properties:
id:
type: string
description: A unique identifier for the organization
name:
type: string
description: A preferred name of the organization
website:
type: string
description: The website for the organization
Resource:
type: object
properties:
id:
type: string
description: Unique identifier representing a specific resource.
title:
type: string
description: The title of the resource.
description:
type: string
description: Description of resource.
abbreviation:
type: string
description: Common abbreviation for the resource.
responsibleOrganization:
# organization that is responsible for the resource.
$ref: '#/definitions/Organization'
license:
type: string
description: An online document that specifies licensing information for the resource.
documentation:
type: string
description: An online document that provides documentation for the resource.
publications:
type: array
description: Publications that describe the resource.
items:
$ref: '#/definitions/Publication'
curie_example:
type: string
description: An example CURIE for the resource where the resource prefix is separated from the local identifier using a colon character ':'
local_identifier_regex:
type: string
description: A regular expression for the local part of a CURIE
local_identifier_example:
type: string
description: An examplar local identifier that matches the regex
prefix_example:
type: string
description: An example prefix
keywords:
type: array
items:
$ref: '#/definitions/Keyword'
alternative_identifier:
type: array
items:
type: string
prefixes:
type: array
items:
$ref: '#/definitions/Prefix'
URI_Pattern:
type: array
description: A list of URI patterns for the resource
items:
$ref: '#/definitions/URIPattern'
URL_Resolver:
type: array
description: A list of content-type resolvers for a particular resource item
items:
$ref: '#/definitions/Resolver'
URIPattern:
type: object
properties:
uripattern:
type: string
description: The URI pattern.
source:
# description: The organization responsible for the pattern
$ref: '#/definitions/Organization'
role:
type: string
description: The role of the source in relation to the URI pattern
Resolver:
type: object
properties:
name:
type: string
description: The name of the resolver for the resource
url:
type: string
description: A URL for the resolver
url_pattern:
type: string
description: A pattern to specify a resolving URL for the resource
content_type:
type: string
description: The content type that can be requested from the resolver
enum:
- text/html
- rdf/xml
- text/csv
- text/tab-separated-values
- application/json
- application/json+ld
- text/plain
- text/turtle
default: text/html
Prefix:
type: object
properties:
label:
type: string
description: The prefix value
source:
type: object
description: The source of the prefix
source_role:
type: string
description: The role of the source in providing this prefix
enum:
- authority
- resolver
- referrer
default: referrer
used_by:
type: array
description: A list of the organizations for which this is a primary prefix
items:
$ref: '#/definitions/Organization'
Keyword:
type: object
properties:
label:
type: string
description: The keyword
uri:
type: string
description: A concept definition for the keyword
Publication:
type: object
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string