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
|
{
"description": "Test #ask with `format=table` on inverse property, property path",
"setup": [
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has page",
"contents": "[[Has type::Page]]"
},
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has number",
"contents": "[[Has type::Number]]"
},
{
"page": "P0709/1",
"contents": "[[Has number::123]] [[Has page::ABC]] [[Category:P0709]]"
},
{
"page": "P0709/2",
"contents": "[[Has number::1234]] [[Has page::DEF]] [[Category:P0709]]"
},
{
"page": "P0709/3",
"contents": "{{#subobject:A |@category=P0709}} {{#subobject:B |@category=P0709}}"
},
{
"page": "P0709/Q.1",
"contents": "{{#ask: [[-Has page.Has number::123]] |?Has page |format=table}}"
},
{
"page": "P0709/Q.2",
"contents": "{{#ask: [[-Has page.Has number::+]] |?Has page |order=asc |format=table}}"
},
{
"page": "P0709/Q.3",
"contents": "{{#ask: [[-Has page.Has number::+]] |?Has page |order=desc |format=table}}"
},
{
"page": "P0709/Q.4",
"contents": "{{#ask: [[-Has subobject::+]] [[Category:P0709]] |order=asc |format=table}}"
},
{
"page": "P0709/Q.5",
"contents": "{{#ask: [[-Has number::+]] |format=table |default=is empty}}"
}
],
"tests": [
{
"type": "parser",
"about": "#0 (-Has page.Has number::123)",
"subject": "P0709/Q.1",
"assert-output": {
"to-contain": [
"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"smwtype_wpg\"><a href=\".*\">ABC</a></td>"
]
}
},
{
"type": "parser",
"about": "#1 (-Has page.Has number::+, sort=asc)",
"subject": "P0709/Q.2",
"assert-output": {
"to-contain": [
"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"smwtype_wpg\"><a href=\".*\">ABC</a></td>",
"<tr data-row-number=\"2\" class=\"row-even\"><td class=\"smwtype_wpg\"><a href=\".*\">DEF</a></td>"
]
}
},
{
"type": "parser",
"about": "#2 (-Has page.Has number::+, sort=desc)",
"subject": "P0709/Q.3",
"assert-output": {
"to-contain": [
"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"smwtype_wpg\"><a href=\".*\">DEF</a></td>",
"<tr data-row-number=\"2\" class=\"row-even\"><td class=\"smwtype_wpg\"><a href=\".*\">ABC</a></td>"
]
}
},
{
"type": "parser",
"about": "#3 (-Has subobject::+, sort=asc)",
"subject": "P0709/Q.4",
"assert-output": {
"to-contain": [
"<tr data-row-number=\"1\" class=\"row-odd\"><td class=\"smwtype_wpg\"><span class=\"smw-subobject-entity\"><a href=\".*\">P0709/3#A</a></span></td></tr>",
"<tr data-row-number=\"2\" class=\"row-even\"><td class=\"smwtype_wpg\"><span class=\"smw-subobject-entity\"><a href=\".*\">P0709/3#B</a></span></td></tr>"
]
}
}
],
"settings": {
"wgContLang": "en",
"wgLang": "en",
"smwgPageSpecialProperties": [
"_MDAT"
]
},
"meta": {
"version": "2",
"is-incomplete": false,
"debug": false
}
}
|