Changes: Update reference files for testFetchRequestQuery
[qtcontacts-tracker:hasselmms-qtcontacts-tracker.git] / tests / ut_qtcontacts_trackerplugin_querybuilder / data / 100-Group.rq
1 SELECT
2   ?_contact tracker:id(?_contact)
3   ?_context rdfs:label(?_context)
4
5  (SELECT
6     GROUP_CONCAT(fn:concat(?_postalAddress, "\u001f",
7                            tracker:coalesce(nco:country(?_postalAddress, "\u002c", "\u001c"), ""), "\u001f",
8                            tracker:coalesce(nco:locality(?_postalAddress, "\u002c", "\u001c"), ""), "\u001f",
9                            tracker:coalesce(nco:pobox(?_postalAddress, "\u002c", "\u001c"), ""), "\u001f",
10                            tracker:coalesce(nco:postalcode(?_postalAddress, "\u002c", "\u001c"), ""), "\u001f",
11                            tracker:coalesce(nco:region(?_postalAddress, "\u002c", "\u001c"), ""), "\u001f",
12                            tracker:coalesce(nco:streetAddress(?_postalAddress, "\u002c", "\u001c"), ""), "\u001f",
13                            tracker:coalesce((SELECT GROUP_CONCAT(tracker:id(?_t), "\u001d")
14                                              WHERE { ?_postalAddress rdf:type ?_t }), ""), "\u001f",
15                            tracker:coalesce((SELECT GROUP_CONCAT(fn:concat(nao:propertyValue(?_p), "\u001c",
16                                                                            tracker:coalesce((SELECT ?g0 WHERE { GRAPH ?g0 { ?_postalAddress nao:hasProperty ?_p } }),  "")),
17                                                                  "\u001d")
18                                              WHERE { ?_postalAddress nao:hasProperty ?_p . ?_p nao:propertyName "SubTypes" }), "")),
19                  "\u001e")
20   WHERE { ?_contact nco:hasPostalAddress ?_postalAddress })
21
22  (SELECT
23     GROUP_CONCAT(fn:concat(tracker:coalesce(ncal:uid(?_anniversary, "\u002c", "\u001c"), ""), "\u001f",
24                            tracker:coalesce((SELECT fn:concat(fn:concat(?_dateTime, "|", fn:timezone-from-dateTime(?_dateTime)), "\u001c",
25                                                               tracker:coalesce ((SELECT ?_anniversary_graph WHERE { GRAPH ?_anniversary_graph { ?_dtstart ncal:dateTime ?_dateTime } } ) , "" ) )
26                                              WHERE { ?_anniversary ncal:dtstart ?_dtstart . ?_dtstart ncal:dateTime ?_dateTime } ) , "" ), "\u001f",
27                            tracker:coalesce(ncal:description(?_anniversary, "\u002c", "\u001c"), ""), "\u001f",
28                            tracker:coalesce(ncal:categories(?_anniversary, "\u001d", "\u001c"), "")),
29                  "\u001e")
30   WHERE { ?_contact ncal:anniversary ?_anniversary })
31
32  (SELECT fn:concat (fn:concat(?birthDate, "|", fn:timezone-from-dateTime(?birthDate)) , "\u001c",
33                     tracker:coalesce((SELECT ?_3
34                                       WHERE { GRAPH ?_3 { ?_contact nco:birthDate ?birthDate }}), ""))
35   WHERE { ?_contact nco:birthDate ?birthDate })
36
37
38  (SELECT ncal:uid(?_birthday, "\u002c", "\u001c")
39   WHERE {?_contact ncal:birthday ?_birthday})
40
41  (SELECT GROUP_CONCAT(fn:concat(?_emailAddress, "\u001f",
42                                 fn:concat(
43                                     nco:emailAddress(?_emailAddress),"\u001c",
44                                     tracker:coalesce((SELECT ?g11 WHERE { GRAPH ?g11 { ?_contact nco:hasEmailAddress ?_emailAddress } }),""))), "\u001e")
45   WHERE { ?_contact nco:hasEmailAddress ?_emailAddress })
46
47   nie:title(nco:hasLocation(?_contact), "\u002c", "\u001c")
48   slo:latitude(nco:hasLocation(?_contact), "\u002c", "\u001c")
49   slo:longitude(nco:hasLocation(?_contact), "\u002c", "\u001c")
50   slo:altitude(nco:hasLocation(?_contact), "\u002c", "\u001c")
51   slo:timestamp(nco:hasLocation(?_contact), "\u002c", "\u001c")
52
53   nco:contactUID(?_contact, "\u002c", "\u001c")
54
55   nco:contactGroupName(?_contact, "\u002c", "\u001c")
56
57   nco:note(?_contact, "\u001e", "\u001c")
58
59  (SELECT
60     GROUP_CONCAT(fn:concat(?_onlineAccount, "\u001f",
61                            tracker:coalesce(nco:imID(?_onlineAccount, "\u002c", "\u001c"), ""), "\u001f",
62                            tracker:coalesce(nco:imProtocol(?_onlineAccount, "\u002c", "\u001c"), ""), "\u001f",
63                            tracker:coalesce((SELECT GROUP_CONCAT(fn:concat(tracker:id(?_capability), "\u001c",
64                                                                            tracker:coalesce((SELECT ?g7 WHERE { GRAPH ?g7 { ?_onlineAccount nco:imCapability ?_capability } }), "")),
65                                                                  "\u001d")
66                                              WHERE { ?_onlineAccount nco:imCapability ?_capability }), ""), "\u001f",
67                            tracker:coalesce((SELECT GROUP_CONCAT(fn:concat(nao:propertyValue(?_p), "\u001c",
68                                                                            tracker:coalesce((SELECT ?g2 WHERE { GRAPH ?g2 { ?_onlineAccount nao:hasProperty ?_p } }), "")),
69                                                                  "\u001d")
70                                              WHERE { ?_onlineAccount nao:hasProperty ?_p . ?_p nao:propertyName "Capabilities" }), ""), "\u001f",
71                            tracker:coalesce((SELECT GROUP_CONCAT(fn:concat(nao:propertyValue(?_p), "\u001c",
72                                                                            tracker:coalesce((SELECT ?g3 WHERE { GRAPH ?g3 { ?_onlineAccount nao:hasProperty ?_p } }), "")),
73                                                                  "\u001d")
74                                              WHERE { ?_onlineAccount nao:hasProperty ?_p . ?_p nao:propertyName "SubTypes" }), ""), "\u001f",
75                            tracker:coalesce((SELECT fn:concat(fn:concat(?_account, "\u001c",
76                                                                         tracker:coalesce((SELECT ?g4 WHERE { GRAPH ?g4 { ?_contact nco:hasIMAddress ?_onlineAccount } }), "")),
77                                                                         "\u001f",
78                                                                         tracker:coalesce(fn:concat(nco:imDisplayName(?_account), "\u001c",
79                                                                                          tracker:coalesce((SELECT ?g21 WHERE { GRAPH ?g21 { ?_contact nco:hasIMAddress ?_onlineAccount } }), "")), ""))
80                                              WHERE { ?_account nco:hasIMContact ?_onlineAccount }), "\u001f")),
81                  "\u001e")
82   WHERE { ?_contact nco:hasIMAddress ?_onlineAccount })
83
84  (SELECT GROUP_CONCAT(fn:concat(tracker:coalesce((SELECT fn:concat(nie:url(?_imAvatar), "\u001c",
85                                                                    tracker:coalesce((SELECT ?g12 WHERE { GRAPH ?g12 { ?_imAddress nco:imAvatar ?_imAvatar } }), ""))
86                                                   WHERE {?_imAddress nco:imAvatar ?_imAvatar} ), ""), "\u001f",
87                                 fn:concat(?_imAddress, "\u001c",
88                                           tracker:coalesce((SELECT ?g5 WHERE { GRAPH ?g5 { ?_contact nco:hasIMAddress ?_imAddress } }), ""))),
89                       "\u001e")
90   WHERE { ?_contact nco:hasIMAddress ?_imAddress })
91
92  (SELECT
93   fn:concat(nie:url(?_photo), "\u001c",
94                          tracker:coalesce((SELECT ?g18 WHERE { GRAPH ?g18 { ?_contact nco:photo ?_photo } }),
95                                           ""))
96   WHERE {?_contact nco:photo ?_photo} )
97  (SELECT
98   fn:concat(nie:url(?_video), "\u001c",
99                          tracker:coalesce((SELECT ?g19 WHERE { GRAPH ?g19 { ?_contact nco:video ?_video } }),
100                                           ""))
101   WHERE {?_contact nco:video ?_video} )
102
103  (SELECT
104     GROUP_CONCAT(fn:concat(?_phoneNumber, "\u001f",
105                            fn:concat(nco:phoneNumber(?_phoneNumber),
106                                      "\u001c",
107                                      tracker:coalesce((SELECT ?g13 WHERE { GRAPH ?g13 { ?_contact nco:hasPhoneNumber ?_phoneNumber } }),
108                                                  "")), "\u001f",
109                            tracker:coalesce((SELECT GROUP_CONCAT(tracker:id(?_t), "\u001d")
110                                              WHERE {?_phoneNumber rdf:type ?_t}), ""), "\u001f",
111                            tracker:coalesce((SELECT GROUP_CONCAT(fn:concat(nao:propertyValue(?_p), "\u001c",
112                                                                            tracker:coalesce((SELECT ?g6 WHERE { GRAPH ?g6 { ?_phoneNumber nao:hasProperty ?_p } }), "")),
113                                                                  "\u001d")
114                                              WHERE {?_phoneNumber nao:hasProperty ?_p . ?_p nao:propertyName "SubTypes"}), "")),
115                  "\u001e")
116   WHERE { ?_contact nco:hasPhoneNumber ?_phoneNumber })
117
118  (SELECT
119     GROUP_CONCAT(fn:concat(?_onlinePresence, "\u001f",
120                            tracker:coalesce(nco:imNickname(?_onlinePresence, "\u002c", "\u001c"), ""), "\u001f",
121                            tracker:coalesce(nco:imStatusMessage(?_onlinePresence, "\u002c", "\u001c"), ""), "\u001f",
122                            tracker:coalesce(nco:presenceLastModified(?_onlinePresence, "\u002c", "\u001c"), ""), "\u001f",
123                            tracker:coalesce((SELECT
124                                                GROUP_CONCAT(fn:concat(tracker:id(?_presenceStatus), "\u001c",
125                                                                       tracker:coalesce((SELECT ?g8 WHERE { GRAPH ?g8 { ?_onlinePresence nco:imPresence ?_presenceStatus } }), "")),
126                                                             "\u001d")
127                                              WHERE {
128                                                ?_onlinePresence nco:imPresence ?_presenceStatus
129                                              }), ""), "\u001f",
130                            tracker:coalesce((SELECT
131                                                GROUP_CONCAT(fn:concat(tracker:id(?_authStatusFrom), "\u001c",
132                                                                       tracker:coalesce((SELECT ?g9 WHERE { GRAPH ?g9 { ?_onlinePresence nco:imAddressAuthStatusFrom ?_authStatusFrom } }), "")),
133                                                             "\u001d")
134                                              WHERE {
135                                                ?_onlinePresence nco:imAddressAuthStatusFrom ?_authStatusFrom
136                                              }), ""), "\u001f",
137                            tracker:coalesce((SELECT
138                                                GROUP_CONCAT(fn:concat(tracker:id(?_authStatusTo), "\u001c",
139                                                                       tracker:coalesce((SELECT ?g10 WHERE { GRAPH ?g10 { ?_onlinePresence nco:imAddressAuthStatusTo ?_authStatusTo } }), "")),
140                                                             "\u001d")
141                                              WHERE {
142                                                ?_onlinePresence nco:imAddressAuthStatusTo ?_authStatusTo
143                                              }), "")),
144                  "\u001e")
145   WHERE { ?_contact nco:hasIMAddress ?_onlinePresence })
146
147   maemo:relevance(?_contact, "\u002c", "\u001c")
148
149   (SELECT
150   fn:concat(nie:url(?_audioRingtone), "\u001c",
151                          tracker:coalesce((SELECT ?g15 WHERE { GRAPH ?g15 { ?_contact maemo:contactGroupAudioRingtone ?_audioRingtone } }),
152                                           ""))
153   WHERE {?_contact maemo:contactGroupAudioRingtone ?_audioRingtone} )
154   (SELECT
155   fn:concat(nie:url(?_videoRingtone), "\u001c",
156                          tracker:coalesce((SELECT ?g16 WHERE { GRAPH ?g16 { ?_contact maemo:contactGroupVideoRingtone ?_videoRingtone } }),
157                                           ""))
158   WHERE {?_contact maemo:contactGroupVideoRingtone ?_videoRingtone} )
159   (SELECT
160   fn:concat(nie:url(?_vibrationRingtone), "\u001c",
161                          tracker:coalesce((SELECT ?g17 WHERE { GRAPH ?g17 { ?_contact maemo:contactGroupVibrationRingtone ?_vibrationRingtone } }),
162                                           ""))
163   WHERE {?_contact maemo:contactGroupVibrationRingtone ?_vibrationRingtone} )
164
165   nie:generator(?_contact, "\u002c", "\u001c")
166
167  (SELECT GROUP_CONCAT(fn:concat(nao:prefLabel(?_tag), "\u001c",
168                            tracker:coalesce((SELECT ?g14 WHERE { GRAPH ?g14 { ?_contact nao:hasTag ?_tag } }), "")), "\u001e")
169   WHERE {?_contact nao:hasTag ?_tag})
170
171   nie:contentCreated(?_contact, "\u002c", "\u001c")
172   nie:contentLastModified(?_contact, "\u002c", "\u001c")
173   nie:contentAccessed(?_contact, "\u002c", "\u001c")
174
175  (SELECT GROUP_CONCAT(fn:concat(?_url, "\u001c",
176                                 tracker:coalesce((SELECT ?g WHERE { GRAPH ?g { ?_contact nco:url ?_url } }), "")), "\u001e")
177   WHERE { ?_contact nco:url ?_url })
178
179  nco:websiteUrl(?_contact, "\u001e", "\u001c")
180  nco:blogUrl(?_contact, "\u001e", "\u001c")
181
182  (SELECT
183     GROUP_CONCAT(fn:concat(nao:propertyName(?_customDetail), "\u001f",
184                            (SELECT
185                               GROUP_CONCAT(fn:concat(nao:propertyName(?_customField), "\u001f",
186                                                      (SELECT GROUP_CONCAT(fn:concat(tracker:id(?_customField), ":", ?_value), "\u001d")
187                                                       WHERE {?_customField nao:propertyValue ?_value})), "\u001f")
188                             WHERE {
189                               ?_customDetail nao:hasProperty ?_customField
190                             })),
191                  "\u001e")
192   WHERE {
193     ?_contact nao:hasProperty ?_customDetail
194   })
195
196 WHERE {
197   ?_contact rdf:type nco:ContactGroup, nco:Contact
198
199   OPTIONAL {?_contact nco:hasAffiliation ?_context}
200 }