-
Notifications
You must be signed in to change notification settings - Fork 9
/
config-sorting-duplicates.yaml
196 lines (192 loc) · 5.88 KB
/
config-sorting-duplicates.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
openapi: 3.0.2
info:
title: 'Example site'
version: 0.1.0
x-walder-resources:
root: ./
views: views
pipe-modules: pipeModules
public: public
x-walder-datasources:
- http://fragments.dbpedia.org/2016-04/en
paths:
/music/{musician}/sorted:
get:
# Working example: Marcella Detroit
summary: Returns a list of songs of the given musician, sorted in descending order by song label.
parameters:
- in: path
name: musician
required: true
schema:
type: string
description: The target musician
x-walder-query:
graphql-query: >
{
label @single
writer(label_en: $musician) @single
artist @single(scope: all) {
label
}
}
json-ld-context: >
{
"@context": {
"label": "http://www.w3.org/2000/01/rdf-schema#label",
"label_en": { "@id": "http://www.w3.org/2000/01/rdf-schema#label", "@language": "en" },
"writer": "http://dbpedia.org/ontology/writer",
"artist": "http://dbpedia.org/ontology/musicalArtist"
}
}
options:
sort:
object: $[*]
selectors:
- value: label
order: desc
responses:
200:
description: list of songs
x-walder-input-text/html: songs-with-artist.handlebars
/music/{musician}/no_duplicates:
get:
# Working example: Marcella Detroit
summary: Returns a list of songs of the given musician, where duplicate songe names are removed.
parameters:
- in: path
name: musician
required: true
schema:
type: string
description: The target musician
x-walder-query:
graphql-query: >
{
label @single
writer(label_en: $musician) @single
artist @single(scope: all) {
label
}
}
json-ld-context: >
{
"@context": {
"label": "http://www.w3.org/2000/01/rdf-schema#label",
"label_en": { "@id": "http://www.w3.org/2000/01/rdf-schema#label", "@language": "en" },
"writer": "http://dbpedia.org/ontology/writer",
"artist": "http://dbpedia.org/ontology/musicalArtist"
}
}
options:
remove-duplicates:
object: $[*]
value: label
responses:
200:
description: list of songs
x-walder-input-text/html: songs.handlebars
/music/{musician}/everything_together:
get:
# Working example: Marcella Detroit
summary: Returns a list of songs of the given musician, sorted in descending order by label of the song and duplicates songs are removed.
parameters:
- in: path
name: musician
required: true
schema:
type: string
description: The target musician
x-walder-query:
graphql-query: >
{
label @single
writer(label_en: $musician) @single
artist @single(scope: all) {
label
}
}
json-ld-context: >
{
"@context": {
"label": "http://www.w3.org/2000/01/rdf-schema#label",
"label_en": { "@id": "http://www.w3.org/2000/01/rdf-schema#label", "@language": "en" },
"writer": "http://dbpedia.org/ontology/writer",
"artist": "http://dbpedia.org/ontology/musicalArtist"
}
}
options:
sort:
object: $[*]
selectors:
- value: label
order: desc
remove-duplicates:
object: $[*]
value: label
responses:
200:
description: list of songs
x-walder-input-text/html: songs.handlebars
/artist/{artist}:
get:
# Working example: David Bowie
summary: Returns a list of songs and movies for a given artist. Where duplicate songs are removed and the movies are ordered by id in descending manner.
parameters:
- in: path
name: artist
required: true
schema:
type: string
description: The target artist
x-walder-query:
graphql-query:
songs:
query: >
{
label @single
writer(label_en: $artist) @single
artist @single(scope: all) {
label
}
}
options:
remove-duplicates:
object: $[*]
value: label
films:
query: >
{
id @single
... on Film {
starring(label_en: $artist) @single
}
}
options:
sort:
object: $[*]
selectors:
- value: id
order: desc
json-ld-context: >
{
"@context": {
"label": "http://www.w3.org/2000/01/rdf-schema#label",
"label_en": { "@id": "http://www.w3.org/2000/01/rdf-schema#label", "@language": "en" },
"writer": "http://dbpedia.org/ontology/writer",
"artist": "http://dbpedia.org/ontology/musicalArtist",
"Film": "http://dbpedia.org/ontology/Film",
"starring": "http://dbpedia.org/ontology/starring"
}
}
responses:
200:
description: list of songs and movies
x-walder-input-text/html: songs_movies.handlebars
x-walder-errors:
404:
description: page not found error
x-walder-input-text/html: error404.html
500:
description: internal server error
x-walder-input-text/html: error500.html