summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0502.json
blob: 65bf284486ab17e3ad3d5bc0e8ec951b84361813 (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
{
	"description": "Test `_qty` range queries using non strict comparators (`smwStrictComparators=false`)",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has starting wattage",
			"contents": "[[Has type::Quantity]] [[Display units::kW]] [[Corresponds to::1 W, Watt, Watts]] [[Corresponds to::0.001 kW]] [[Corresponds to::0.0013410220 hp, bhp, horsepower]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has running wattage",
			"contents": "[[Has type::Quantity]] [[Display units::kW]] [[Corresponds to::1 W, Watt, Watts]] [[Corresponds to::0.001 kW]] [[Corresponds to::0.0013410220 hp, bhp, horsepower]]"
		},
		{
			"page": "Home appliance",
			"contents": "{{#subobject:MicrowaveOven|Has starting wattage=1 kW|Has running wattage=1 kW}} {{#subobject:Refrigerator|Has starting wattage=1.2 kW|Has running wattage=130 W}} {{#subobject:Dishwasher|Has starting wattage=540 W|Has running wattage=200 W}} {{#subobject:Blender|Has starting wattage=840 W|Has running wattage=400 W}}"
		}
	],
	"tests": [
		{
			"type": "query",
			"about": "#0",
			"condition": "[[Has starting wattage::≥1 kW]]",
			"printouts": [
				"Has starting wattage"
			],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"results": [
					"Home appliance#0##MicrowaveOven",
					"Home appliance#0##Refrigerator"
				],
				"count": "2",
				"datavalues": [
					{
						"property": "Has starting wattage",
						"value": "1.2 kW"
					},
					{
						"property": "Has starting wattage",
						"value": "1 kW"
					}
				]
			}
		},
		{
			"type": "query",
			"about": "#1 Conjunctive condition",
			"condition": "[[Has starting wattage::≥1 kW]] [[Has running wattage::< 500 W]]",
			"printouts": [
				"Has starting wattage",
				"Has running wattage"
			],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"results": [
					"Home appliance#0##Refrigerator"
				],
				"count": "1",
				"datavalues": [
					{
						"property": "Has starting wattage",
						"value": "1.2 kW"
					},
					{
						"property": "Has running wattage",
						"value": "130 W"
					}
				]
			}
		}
	],
	"settings": {
		"smwStrictComparators": false
	},
	"meta": {
		"version": "2",
		"debug": false
	}
}