summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0802.json
blob: 9dab306fc4ed4e6e4f46e45920de5072c343bfdb (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
{
	"description": "Test `_INST`/`_SUBC` queries (#1005, en, skip virtuoso)",
	"setup": [
		{
			"namespace": "NS_CATEGORY",
			"page": "Foo",
			"contents": ""
		},
		{
			"namespace": "NS_CATEGORY",
			"page": "Bar",
			"contents": "[[Category:Foo]]"
		},
		{
			"namespace": "NS_CATEGORY",
			"page": "Bam",
			"contents": "[[Category:Foo]]"
		},
		{
			"page": "Page-annotated-with-subcategory",
			"contents": "[[Category:Bar]] [[Category:Bam]]"
		},
		{
			"page": "Page-annotated-with-another-subcategory",
			"contents": "[[Category:Bam]]"
		},
		{
			"page": "Page-annotated-with-supercategory-subcategory",
			"contents": "[[Category:Foo]] [[Category:Bam]]"
		}
	],
	"tests": [
		{
			"type": "query",
			"about": "#0 query pages with annotated category(subcategory)",
			"condition": "[[Category:Bar]]",
			"printouts": [
				"_INST"
			],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 1,
				"results": [
					"Page-annotated-with-subcategory#0##"
				],
				"datavalues": [
					{
						"property": "_INST",
						"value": "Bar"
					}
				]
			}
		},
		{
			"type": "query",
			"about": "#1 disjuntive query for two categories",
			"condition": "[[Category:Bar]] OR [[Category:Bam]]",
			"printouts": [
				"_INST"
			],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 3,
				"results": [
					"Page-annotated-with-subcategory#0##",
					"Page-annotated-with-another-subcategory#0##",
					"Page-annotated-with-supercategory-subcategory#0##"
				]
			}
		},
		{
			"type": "query",
			"about": "#2 conjuntive query for two categories",
			"condition": "[[Category:Bar]][[Category:Bam]]",
			"printouts": [
				"_INST"
			],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 1,
				"results": [
					"Page-annotated-with-subcategory#0##"
				]
			}
		},
		{
			"type": "query",
			"about": "#3 find list of subcategories for selected super",
			"condition": "[[Subcategory of::Category:Foo]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 2,
				"results": [
					"Bar#14##",
					"Bam#14##"
				]
			}
		},
		{
			"type": "query",
			"about": "#4 find the super for a selected subcategory",
			"condition": "[[-Subcategory of::Category:Bar]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 1,
				"results": [
					"Foo#14##"
				]
			}
		},
		{
			"type": "query",
			"about": "#5 disjuntive query for two categories",
			"condition": "[[Category:Foo]] OR [[Category:Bam]]",
			"printouts": [
				"_INST"
			],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 3,
				"results": [
					"Page-annotated-with-subcategory#0##",
					"Page-annotated-with-another-subcategory#0##",
					"Page-annotated-with-supercategory-subcategory#0##"
				]
			}
		}
	],
	"settings": {
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"NS_CATEGORY": true,
			"SMW_NS_PROPERTY": true
		},
		"wgContLang": "en",
		"smwgQSubcategoryDepth": 10
	},
	"meta": {
		"skip-on": {
			"virtuoso": "Virtuoso 6.1 rdfs / subproperty/subcategory hierarchies are not supported"
		},
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}