-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.faker.graphql
266 lines (216 loc) · 6.8 KB
/
schema.faker.graphql
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
# Scalars
scalar Uri
scalar Url
scalar Key #FIXME: ID?
scalar Email
scalar Markdown
schema {
query: QueryType
mutation: RootMutation
}
type RootMutation {
setViewComponents(input: ViewComponentsInput): Boolean
setFacets(input: FacetsInput): Boolean
}
# -------- Components (mutation inputs)
input ViewComponentsInput {
components: [ComponentInput]
query: String! #graphql syntax like string
}
input ComponentInput {
type: ComponentType # depending on this type, you can expect an x amount of fields => this can be traced back in the GUI, which is in charge of the view configuration
value: ComponentValueInput
key: ComponentValueInput
title: ComponentValueInput
url: ComponentValueInput
alt: ComponentValueInput
values: [ ComponentInput ]
}
input ComponentValueInput {
field: String # Can hold either a field or a fields object. Inputs do not get along with unions, that's why this is not more typesafe
fields: String
}
type QueryType {
#the datasets that are supposed to get extra attention
promotedDataSets: [DataSetMetadata!]!
dataSets: DataSets
#all mimetypes that you can use when downloading data from a dataSet
availableExportMimetypes: [MimeType!]!
#information about the logged in user, or null of no user is logged in
aboutMe: AboutMe
}
type DataSets {
jauco_leaders: Jauco_Leaders
}
type MimeType {
value: String! @examples(values: ["application/json", "application/ld+json", "application/xml", "text/csv"])
en: MimeTypeDescription
}
type MimeTypeDescription {
name: String! @examples(values: ["json", "JSON-LD", "Gephi", "CSV"])
description: String! @fake(type: lorem)
}
type AboutMe {
#datasets that this user has some specific permissions on
dataSets: [DataSetMetadata!]!
#The unique identifier of this user
id: ID! @examples(values: ["1234"])
#a human readable name (or empty string if not available)
name: String! @fake(type: fullName)
#a url to a page with personal information on this user
personalInfo: Url! @fake(type: url)
#This user may create a new dataset on this timbuctoo instance
canCreateDataSet: Boolean!
}
type DataSetMetadata {
dataSetId: ID! @examples(values: ["jauco_leaders"])
title: String! @fake(type:county)
description: String @fake(type:lorem)
imageUrl: Url @fake(type:imageUrl options: {imageCategory: cats, randomizeImageUrl: true})
owner: ContactInfo!
contact: ContactInfo!
provenanceInfo: ProvenanceInfo!
contributors: [RoleWithMembers!]!
licence: Licence!
roles: [DataSetPermission!]!
collections(count: Int = 20, cursor: ID = ""): CollectionMetadataList
}
type Licence {
uri: Url @fake(type: url)
}
type CollectionMetadataList {
prevCursor: ID
nextCursor: ID
items: [CollectionMetadata!]!
}
type CollectionMetadata {
collectionId: ID! @examples(values:["Leaders"])
collectionListId: ID! @examples(values:["LeadersList"])
uri: Uri! @fake(type: url)
title: String! @fake(type: productName)
components(count: Int = 20, cursor: ID = ""): ComponentList!
#facetconfig?
properties(count: Int = 20, cursor: ID = ""): PropertyList!
archeType: String
#estimatedTotal: String!
}
type RoleWithMembers {
name: String
members: [MemberInfo!]!
}
type ComponentList {
prevCursor: ID
nextCursor: ID
items: [Component!]!
}
type PropertyList {
prevCursor: ID
nextCursor: ID
items: [Property!]!
}
type Property {
name: String @fake(type: colorName)
density: Int @fake(type: money, options: {minMoney:0, maxMoney: 100})
referenceTypes(count: Int = 20, cursor: ID = ""): TypeList
valueTypes(count: Int = 20, cursor: ID = ""): TypeList
}
type TypeList {
prevCursor: ID @fake(type:uuid)
nextCursor: ID @fake(type:uuid)
items: [Uri!]! @fake(type:url)
}
type Jauco_Leaders {
metadata: DataSetMetadata
LeadersList(count: Int = 20, query: String, cursor: ID = ""): Jauco_Leaders_LeaderCollection
Leaders(uri: String): Jauco_Leaders_Leader
}
type Jauco_Leaders_LeaderCollection {
prevCursor: ID!, @fake(type:uuid)
nextCursor: ID!, @fake(type:uuid)
facets: [Facet!]!,
size: Int,
items: [Jauco_Leaders_Leader!]!
}
type Jauco_Leaders_Leader {
uri: Uri! @fake(type:url)
schema_org_name: ValueObject # Added ValueObject to show that these need a {value}
schema_org_description: DescriptionObject
schema_org_birthPlace: ValueObject
schema_org_imageUrl: UrlObject
schema_org_url: ValueObject
}
type DescriptionObject {
value: String @fake(type: lorem)
}
type UrlObject {
value: Url @fake(type:imageUrl, options:{ imageCategory: cats, randomizeImageUrl: true })
}
type ValueObject {
value:String @fake(type:productName)
}
# -------- Facets (mutation inputs)
input FacetsInput {
facets: [FacetInput]
}
input FacetInput {
caption: String!
options: [OptionInput!]!
}
input OptionInput {
name: String!
}
# -------- Facets (Query)
type Facet {
caption: String! @fake(type: productCategory)
options: [Option!]!
}
type Option {
name: String! @fake(type: productName)
count: Int! @fake(type:money)
}
# -------- Components (Query)
type Component {
type: ComponentType! # depending on this type, you can expect an x amount of fields => this can be traced back in the GUI, which is in charge of the view configuration
value: ComponentValue
key: ComponentValue
title: ComponentValue
url: ComponentValue
alt: ComponentValue
tree: String @examples(values: ["{'a':{'b':'1','c':{'d':'2','e':'3'}},'f':'4'}"]) # a stringified object to ensure we do not have to know how many levels deep we need to go
values: [ Component ]
}
type ComponentValue {
field: String @examples(values: ["Hardcoded example string"])
fields: [ String ] @examples(values:[["level one", "level two", "level three", "level four"]])
}
enum ComponentType {
TITLE
VALUE
IMAGE
LINK
DIVIDER
KEYVALUE
TREE
}
# Different kinds of values supported by the different Elements
type ContactInfo {
name: String! @fake(type:fullName)
email: Email @fake(type:email)
}
type MemberInfo {
name: String! @fake(type:fullName)
url: Url @fake(type:url)
}
type ProvenanceInfo {
title: String! @fake(type:state)
body: Markdown! @fake(type:lorem) #FIXME: limit size
}
enum DataSetPermission {
SEARCH_AND_VIEW #Is allowed to search the dataset and query it using graphql
DOWNLOAD_DUMP #Is allowed to download raw rdf files with the data and query for recent changes
FORK #Is allowed to fork the dataset (into a new dataset)
PUBLISH #Is allowed to change this dataset into a publicly visible one
EDIT_ENTRIES #Is allowed to edit entries using the REST endpoint
EDIT_DATASET #Is allowed to upload rdf data/change dataset metadata/upload files etc.
EDIT_ROLES #Is allowed to assign roles to users
}