summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0105.json
blob: ba946eadc4652efe8ab1b7f765d1baa50ab1d709 (plain)
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
{
	"description": "Test `_wpg`/`~` with enabled full-text search support (only enabled for MySQL, SQLite, `SMW_FT_WIKIPAGE`)",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has page",
			"contents": "[[Has type::Page]]"
		},
		{
			"page": "Example/Q0105/1",
			"contents": "{{#subobject: |Has page=MySQL vs MariaDB database}} {{#subobject: |Has page=Oracle vs MariaDB database}} {{#subobject: |Has page=PostgreSQL vs MariaDB database and more of}} {{#subobject: |Has page=MariaDB overview}}"
		},
		{
			"page": "Example/Q0105/2",
			"contents": "{{#subobject: |Has page=Elastic search}} {{#subobject: |Has page=Sphinx search}}"
		},
		{
			"page": "Example/Q0105/3",
			"contents": "{{#subobject: |Has page=...a hyphenated phrase that has special significance when it appears at the beginning of text...}} {{#subobject: |Has page=...a hyphenated phrase that has NOT any special significance when it appears at the beginning of text...}}"
		},
		{
			"page": "Example/Q0105/4",
			"contents": "{{#subobject: |Has page=Text with a category|@category=Q0105}} {{#subobject: |Has page=Text without a category}}"
		}
	],
	"beforeTest": {
		"job-run": [
			"SMW\\SearchTableUpdateJob"
		]
	},
	"tests": [
		{
			"type": "query",
			"about": "#0 with boolean include/not include",
			"condition": "[[Has page::~+MariaDB -database]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 1,
				"results": [
					"Example/Q0105/1#0##_13bfd7da17ee73035f210b926e671c83"
				]
			}
		},
		{
			"type": "query",
			"about": "#1",
			"condition": "[[Has page::~+database]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 3,
				"results": [
					"Example/Q0105/1#0##_d1e52a56041afb2795ebc6683f9a5229",
					"Example/Q0105/1#0##_e64ad35fdcd8d9e99f2db9a815e36be3",
					"Example/Q0105/1#0##_4b9aef2f903c80012ed4000b519a039d"
				]
			}
		},
		{
			"type": "query",
			"about": "#2 (plus sorting)",
			"condition": "[[Has page::~DATA*]]",
			"skip-on": {
				"elastic": "ES, not expect a prefix search without an explicit wildcard (*)."
			},
			"printouts": [],
			"parameters": {
				"limit": "10",
				"sort": {
					"Has_page": "DESC"
				}
			},
			"assert-queryresult": {
				"count": 3,
				"results": [
					"Example/Q0105/1#0##_d1e52a56041afb2795ebc6683f9a5229",
					"Example/Q0105/1#0##_e64ad35fdcd8d9e99f2db9a815e36be3",
					"Example/Q0105/1#0##_4b9aef2f903c80012ed4000b519a039d"
				]
			}
		},
		{
			"type": "query",
			"about": "#2.elastic (plus sorting)",
			"condition": "[[Has page::~*DATA*]]",
			"printouts": [],
			"parameters": {
				"limit": "10",
				"sort": {
					"Has_page": "DESC"
				}
			},
			"assert-queryresult": {
				"count": 3,
				"results": [
					"Example/Q0105/1#0##_d1e52a56041afb2795ebc6683f9a5229",
					"Example/Q0105/1#0##_e64ad35fdcd8d9e99f2db9a815e36be3",
					"Example/Q0105/1#0##_4b9aef2f903c80012ed4000b519a039d"
				]
			}
		},
		{
			"type": "query",
			"about": "#3 (plus sorting)",
			"condition": "[[Has page::~sear*]]",
			"skip-on": {
				"elastic": "ES, not expect a prefix search without an explicit wildcard (*)."
			},
			"printouts": [],
			"parameters": {
				"limit": "10",
				"sort": {
					"Has_page": "ASC"
				}
			},
			"assert-queryresult": {
				"count": 2,
				"results": [
					"Example/Q0105/2#0##_4e8a7e81b361d0e14670809d9a1ff614",
					"Example/Q0105/2#0##_7927dc49ee111e0929a91a1f357d9906"
				]
			}
		},
		{
			"type": "query",
			"about": "#3.elastic (plus sorting)",
			"condition": "[[Has page::~*sear*]]",
			"printouts": [],
			"parameters": {
				"limit": "10",
				"sort": {
					"Has_page": "ASC"
				}
			},
			"assert-queryresult": {
				"count": 2,
				"results": [
					"Example/Q0105/2#0##_4e8a7e81b361d0e14670809d9a1ff614",
					"Example/Q0105/2#0##_7927dc49ee111e0929a91a1f357d9906"
				]
			}
		},
		{
			"type": "query",
			"about": "#4 include/not include",
			"condition": "[[Has page::~sear*, -elas*]]",
			"printouts": [],
			"parameters": {
				"limit": "10",
				"sort": {
					"Has_page": "DESC"
				}
			},
			"assert-queryresult": {
				"count": 1,
				"results": [
					"Example/Q0105/2#0##_7927dc49ee111e0929a91a1f357d9906"
				]
			}
		},
		{
			"type": "query",
			"about": "#5 same as #4",
			"condition": "[[Has page::!~elastic*, +sear*]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 1,
				"results": [
					"Example/Q0105/2#0##_7927dc49ee111e0929a91a1f357d9906"
				]
			}
		},
		{
			"type": "query",
			"about": "#6 phrase matching",
			"condition": "[[Has page::~\"phrase that has special\"]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 1,
				"results": [
					"Example/Q0105/3#0##_6b717d3124b3d294797a43ed5064374c"
				]
			}
		},
		{
			"type": "query",
			"about": "#7 similar to #5 but not used in phrase matching mode",
			"condition": "[[Has page::~phrase that has special]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 2,
				"results": [
					"Example/Q0105/3#0##_6b717d3124b3d294797a43ed5064374c",
					"Example/Q0105/3#0##_1dd972ef96528fe09e971c88ed933a7a"
				]
			}
		},
		{
			"type": "query",
			"about": "#8 free search (wide proximity)",
			"skip-on": {
				"elastic": "ES matches only `with` not `without`",
				"sqlite": "works different in comparison to MySQL, see #9"
			},
			"condition": "[[~~with a category]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 2,
				"results": [
					"Example/Q0105/4#0##_9f1222a5f6669be2c5f76dd5af08a4dc",
					"Example/Q0105/4#0##_b827401b701c08c3c3d610a3a43d18c3"
				]
			}
		},
		{
			"type": "query",
			"about": "#8.elastic, free search (wide proximity, also match the annotated value)",
			"skip-on": {
				"elastic": [ "not", "See #8" ]
			},
			"condition": "[[~~with a category]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 2,
				"results": [
					"Example/Q0105/4#0##_9f1222a5f6669be2c5f76dd5af08a4dc",
					"Text_with_a_category#0##"
				]
			}
		},
		{
			"type": "query",
			"about": "#9 free search (wide proximity)",
			"condition": "[[~~with* a category]] [[~Example/Q0105/*]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 2,
				"results": [
					"Example/Q0105/4#0##_9f1222a5f6669be2c5f76dd5af08a4dc",
					"Example/Q0105/4#0##_b827401b701c08c3c3d610a3a43d18c3"
				]
			}
		},
		{
			"type": "query",
			"about": "#10 free search (wide proximity)",
			"condition": "[[~~with a category]] [[Category:Q0105]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 1,
				"results": [
					"Example/Q0105/4#0##_9f1222a5f6669be2c5f76dd5af08a4dc"
				]
			}
		},
		{
			"type": "query",
			"about": "#11 retain spaces on +/- operators",
			"condition": "[[Has page::~+*maria* -postgres*]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 3,
				"results": [
					"Example/Q0105/1#0##_d1e52a56041afb2795ebc6683f9a5229",
					"Example/Q0105/1#0##_e64ad35fdcd8d9e99f2db9a815e36be3",
					"Example/Q0105/1#0##_13bfd7da17ee73035f210b926e671c83"
				]
			}
		},
		{
			"type": "query",
			"about": "#12 same as #11 only with `,` (required by MySQL 5.7/MariaDB 10.1)",
			"condition": "[[Has page::~+*maria*, -postgres*]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 3,
				"results": [
					"Example/Q0105/1#0##_d1e52a56041afb2795ebc6683f9a5229",
					"Example/Q0105/1#0##_e64ad35fdcd8d9e99f2db9a815e36be3",
					"Example/Q0105/1#0##_13bfd7da17ee73035f210b926e671c83"
				]
			}
		}
	],
	"settings": {
		"smwgEnabledFulltextSearch": true,
		"smwgFulltextDeferredUpdate": false,
		"smwgFulltextSearchIndexableDataTypes": [
			"SMW_FT_BLOB",
			"SMW_FT_URI",
			"SMW_FT_WIKIPAGE"
		]
	},
	"meta": {
		"skip-on": {
			"postgres": "Fulltext not supported by PostgreSQL.",
			"sesame": "Fulltext not supported by SPARQLStore (Sesame).",
			"virtuoso": "Fulltext not supported by SPARQLStore (Virtuoso).",
			"fuseki": "Fulltext not supported by SPARQLStore (Fuskei).",
			"blazegraph": "Fulltext not supported by SPARQLStore (Blazegraph)."
		},
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}