summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0618.json
blob: ba1e5046ee962b2f15946d51482f9aac2fa0d030 (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
{
	"description": "Test deep subqueries (Friends of friends) (`smwgQMaxDepth`)",
	"setup": [
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Age",
			"contents": "[[Has type::Number]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Material status",
			"contents": "[[Has type::Text]]"
		},
		{
			"page": "Example/Q0618/1",
			"contents": {
				"import-from": "/../Fixtures/q-0618.persons.txt"
			}
		},
		{
			"page": "Example/Q0618/2",
			"contents": {
				"import-from": "/../Fixtures/q-0618.visits.txt"
			}
		},
		{
			"page": "Example/Q0618/3",
			"contents": {
				"import-from": "/../Fixtures/q-0618.friends.txt"
			}
		},
		{
			"page": "Example/Q0618/4a",
			"contents": "{{#ask: [[Person::Andy Mars]][[Age::+]] |?Age |mainlabel=- |headers=hide }} {{#ask: [[Person::Andy Mars]][[Age::+]] |?Age |mainlabel=- |headers=hide |format=debug }}"
		},
		{
			"page": "Example/Q0618/4b",
			"contents": "{{#ask: [[-Person::<q>[[Person.-Has friend.Person::Andy Mars]][[Age::>>{{#ask: [[Person::Andy Mars]][[Age::+]] |?Age |mainlabel=- |headers=hide }} ]]</q>]] }} {{#ask: [[-Person::<q>[[Person.-Has friend.Person::Andy Mars]][[Age::>>{{#ask: [[Person::Andy Mars]][[Age::+]] |?Age |mainlabel=- |headers=hide }} ]]</q>]] |format=debug}}"
		}
	],
	"tests": [
		{
			"type": "query",
			"about": "#0 (Show Friends of friends from Andy Mars)",
			"condition": "[[-Has friend.Person.-Has friend.Person::Andy Mars]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 7,
				"results": [
					"Charlotte Beans#0##",
					"Evelyne Lynn#0##",
					"James Ross#0##",
					"Mandy Rose#0##",
					"Michael Chester#0##",
					"Rosalia Alvarez#0##",
					"Yumi Tanaka#0##"
				]
			}
		},
		{
			"type": "query",
			"about": "#1 (Show Friends of friends from Andy Mars who are single and over 30)",
			"condition": "[[-Person:: <q>[[Person.-Has friend.Person.-Has friend.Person::Andy Mars]] [[Material status::single]][[Age::> 30]]</q>]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 1,
				"results": [
					"Michael Chester#0##"
				]
			}
		},
		{
			"type": "query",
			"about": "#2 (Show Friends who have been to places Andy Mars has visited)",
			"condition": "[[-Person.Place visited::<q>[[-Place visited.Person::<q>[[-Has friend.Person::Andy Mars]]</q>]][[-Place visited::<q>[[Person::Andy Mars]]</q>]]</q>]] [[!Andy Mars]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 7,
				"results": [
					"Charles Banning#0##",
					"Charlotte Beans#0##",
					"John Maier#0##",
					"Kevin Mikaelson#0##",
					"Mike Bloom#0##",
					"Rosalia Alvarez#0##",
					"Yumi Tanaka#0##"
				]
			}
		},
		{
			"type": "parser",
			"about": "#3 (age)",
			"subject": "Example/Q0618/4a",
			"assert-output": {
				"to-contain": [
					"32"
				]
			}
		},
		{
			"type": "parser",
			"about": "#4 (Show Friends from Andy Mars that are older has him)",
			"subject": "Example/Q0618/4b",
			"assert-output": {
				"to-contain": [
					"Charles Banning"
				]
			}
		}
	],
	"settings": {
		"smwgQMaxDepth": 16,
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true,
			"NS_HELP": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}