summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0301.json
blob: 0e09d46d40c493edf0a8a88244c08fa3096acaf0 (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
{
	"description": "Test `_IMPO` queries for imported foaf vocabulary (#891, en)",
	"setup": [
		{
			"namespace": "NS_MEDIAWIKI",
			"page": "Smw import foaf",
			"contents": "http://xmlns.com/foaf/0.1/|[http://www.foaf-project.org/ Friend Of A Friend]\n name|Type:Text\n homepage|Type:URL\n mbox|Type:Email\n mbox_sha1sum|Type:Text\n depiction|Type:URL\n phone|Type:Text\n Person|Category\n Organization|Category\n knows|Type:Page\n member|Type:Page\n"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Foaf:homepage",
			"contents": "[[Imported from::foaf:homepage]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Foaf:name",
			"contents": "[[Imported from::foaf:name]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Foaf:knows",
			"contents": "[[Imported from::foaf:knows]]"
		},
		{
			"namespace": "SMW_NS_PROPERTY",
			"page": "Has name",
			"contents": "#REDIRECT [[Property:Foaf:name]]"
		},
		{
			"page": "John Doe",
			"contents": "[[Foaf:name::John Doe]], [[Foaf:homepage::http://example.org/JohnDoe]] [[Foaf:knows::Jane Doe]]"
		},
		{
			"page": "Jane Doe",
			"contents": "[[Foaf:name::Jane Doe]], [[Foaf:homepage::http://example.org/JaneDoe]] [[Foaf:knows::John Doe]]"
		}
	],
	"tests": [
		{
			"type": "query",
			"about": "#0",
			"condition": "[[Foaf:name::John Doe]] OR [[Foaf:name::Jane Doe]]",
			"printouts": [
				"Foaf:name",
				"Foaf:knows"
			],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"results": [
					"John Doe#0##",
					"Jane Doe#0##"
				],
				"count": "2",
				"datavalues": [
					{
						"property": "Foaf:name",
						"value": "John Doe"
					},
					{
						"property": "Foaf:name",
						"value": "Jane Doe"
					},
					{
						"property": "Foaf:knows",
						"value": "Jane Doe"
					},
					{
						"property": "Foaf:knows",
						"value": "John Doe"
					}
				]
			}
		},
		{
			"type": "query",
			"about": "#1 check auto-property types, #891",
			"condition": "[[Foaf:name::John Doe]] OR [[Foaf:name::Jane Doe]]",
			"printouts": [
				"Foaf:homepage"
			],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"results": [
					"John Doe#0##",
					"Jane Doe#0##"
				],
				"count": "2",
				"dataitems": [
					{
						"type": "_uri",
						"value": "http://example.org/JohnDoe"
					},
					{
						"type": "_uri",
						"value": "http://example.org/JaneDoe"
					}
				]
			}
		},
		{
			"type": "query",
			"about": "#2 query on redirected property",
			"condition": "[[Has name::John Doe]]",
			"printouts": [],
			"parameters": {
				"limit": "10"
			},
			"assert-queryresult": {
				"count": 1,
				"results": [
					"John Doe#0##"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"smwgNamespace": "http://example.org/id/",
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}