summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0423.json
blob: 6a0b4a32fb433cb7ded94d744ed155821164c1bd (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
{
	"description": "Test in-text annotation / `#ask` (#MEDIAWIKI, #LOCL) output for `_dat` datatype (#1545, `wgContLang=en`, `wgLang=ja`)",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has date",
			"contents": "[[Has type::Date]]"
		},
		{
			"page": "Example/P0423/1",
			"contents": "[[Has date::12 Jan 1957 12:05]]"
		},
		{
			"contentlanguage": "fr",
			"page": "Example/P0423/2",
			"contents": "[[Has date::12 April 1957 12:05]]"
		},
		{
			"page": "Example/P0423/Q1.1",
			"contents": "{{#ask: [[Has date::12 Jan 1957 12:05]] |?Has date |?Has date#MEDIAWIKI }}"
		},
		{
			"page": "Example/P0423/Q1.2",
			"contents": "{{#show: Example/P0423/1 |?Has date |?Has date#MEDIAWIKI }}"
		},
		{
			"page": "Example/P0423/Q1.3",
			"contents": "{{#ask: [[Has date::12 Jan 1957 12:05]] |?Has date#LOCL }}"
		},
		{
			"page": "Example/P0423/Q1.4",
			"contents": "{{#show: Example/P0423/1 |?Has date#LOCL }}"
		},
		{
			"page": "Example/P0423/Q1.5",
			"contents": "{{#show: Example/P0423/1 |?Has date#LOCL@fr }}"
		},
		{
			"page": "Example/P0423/Q2.1",
			"contents": "{{#show: Example/P0423/2 |?Has date }}"
		},
		{
			"skip-on": {
				"virtuoso": "Virtuoso 6.1 does not support `-4715-11-24T12:00:00Z\"^^xsd:dateTime` and goes '...Error: Malformed query...'"
			},
			"page": "Example/P0423/3",
			"contents": "[[Has date::Jan 10000000000]]"
		},
		{
			"page": "Example/P0423/Q3.1",
			"contents": "{{#ask: [[Example/P0423/3]] |?Has date#LOCL }}"
		}
	],
	"tests": [
		{
			"type": "parser",
			"about": "#0",
			"subject": "Example/P0423/1",
			"store": {
				"clear-cache": true
			},
			"assert-store": {
				"semantic-data": {
					"strictPropertyValueMatch": false,
					"propertyCount": 3,
					"propertyKeys": [
						"Has_date",
						"_SKEY",
						"_MDAT"
					],
					"propertyValues": [
						"1957-01-12T12:05:00"
					]
				}
			},
			"assert-output": {
				"to-contain": [
					"12 Jan 1957 12:05"
				]
			}
		},
		{
			"type": "parser",
			"about": "#1 (#ask MEDIAWIKI)",
			"subject": "Example/P0423/Q1.1",
			"assert-output": {
				"to-contain": [
					"<td class=\"Has-date smwtype_dat\" data-sort-value=\"2435851.0034722\">12 January 1957 12:05:00</td>",
					"<td class=\"Has-date smwtype_dat\" data-sort-value=\"2435851.0034722\">1957年1月12日 (土) 12:05</td>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#2 (#show MEDIAWIKI)",
			"subject": "Example/P0423/Q1.2",
			"assert-output": {
				"to-contain": [
					"<td class=\"smwtype_dat\" data-sort-value=\"2435851.0034722\">12 January 1957 12:05:00</td>",
					"<td class=\"smwtype_dat\" data-sort-value=\"2435851.0034722\">1957年1月12日 (土) 12:05</td>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#3 (#ask LOCL)",
			"subject": "Example/P0423/Q1.3",
			"assert-output": {
				"to-contain": [
					"<td class=\"Has-date smwtype_dat\" data-sort-value=\"2435851.0034722\">1957年1月12日 (土) 12:05:00</td>"
				]
			}
		},
		{
			"type": "parser",
			"about": "#4 (#show LOCL for user lang)",
			"subject": "Example/P0423/Q1.4",
			"assert-output": {
				"to-contain": [
					"1957年1月12日 (土) 12:05:00"
				]
			}
		},
		{
			"type": "parser",
			"about": "#5 (#show LOCL@fr for annotated fr lang and not for user lang)",
			"subject": "Example/P0423/Q1.5",
			"assert-output": {
				"to-contain": [
					"12:05:00, 12 janvier 1957"
				]
			}
		},
		{
			"type": "parser",
			"about": "#6 page vs global content language",
			"subject": "Example/P0423/Q2.1",
			"assert-output": {
				"to-contain": [
					"12 April 1957 12:05:00"
				],
				"not-contain": [
					"12 avril 1957 12:05:00"
				]
			}
		},
		{
			"skip-on": {
				"virtuoso": "Virtuoso 6.1, see Example/P0423/3 comment!"
			},
			"type": "parser",
			"about": "#7 avoid a possible `DateTime ... Failed to parse time ...` on large dates, only checking some minor output since WINOS reports 784354016999.5, yet Linux returns 3652426721059.5 (float precision issue)",
			"subject": "Example/P0423/Q3.1",
			"assert-output": {
				"to-contain": [
					"class=\"Has-date smwtype_dat\" "
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "ja",
		"smwgPageSpecialProperties": [
			"_MDAT"
		]
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}