Changes: QB unit test/data: Use "grouped" SPARQL syntax
[qtcontacts-tracker:hasselmms-qtcontacts-tracker.git] / tests / ut_qtcontacts_trackerplugin_querybuilder / data / 119-Group-Presence.rq
1 SELECT
2   ?_contact tracker:id(?_contact)
3   ?_context rdfs:label(?_context)
4
5  (SELECT
6     GROUP_CONCAT(fn:concat(?_address, "\u001f",
7                            tracker:coalesce(nco:imNickname(?_address, "\u002c", "\u001c"), ""), "\u001f",
8                            tracker:coalesce(nco:imStatusMessage(?_address, "\u002c", "\u001c"), ""), "\u001f",
9                            tracker:coalesce(nco:presenceLastModified(?_address, "\u002c", "\u001c"), ""), "\u001f",
10                            tracker:coalesce((SELECT
11                                                GROUP_CONCAT(fn:concat(tracker:id(?_presenceStatus), "\u001c",
12                                                                       tracker:coalesce((SELECT ?g1 WHERE { GRAPH ?g1 { ?_address nco:imPresence ?_presenceStatus } }), "")),
13                                                             "\u001d")
14                                              WHERE {
15                                                ?_address nco:imPresence ?_presenceStatus
16                                              }), ""), "\u001f",
17                            tracker:coalesce((SELECT
18                                                GROUP_CONCAT(fn:concat(tracker:id(?_authStatusFrom), "\u001c",
19                                                                       tracker:coalesce((SELECT ?g2 WHERE { GRAPH ?g2 { ?_address nco:imAddressAuthStatusFrom ?_authStatusFrom } }), "")),
20                                                             "\u001d")
21                                              WHERE {
22                                                ?_address nco:imAddressAuthStatusFrom ?_authStatusFrom
23                                              }), ""), "\u001f",
24                            tracker:coalesce((SELECT
25                                                GROUP_CONCAT(fn:concat(tracker:id(?_authStatusTo), "\u001c",
26                                                                       tracker:coalesce((SELECT ?g3 WHERE { GRAPH ?g3 { ?_address nco:imAddressAuthStatusTo ?_authStatusTo } }), "")),
27                                                             "\u001d")
28                                              WHERE {
29                                                ?_address nco:imAddressAuthStatusTo ?_authStatusTo
30                                              }), "")),
31                  "\u001e")
32
33   WHERE {
34     ?_contact nco:hasIMAddress ?_address
35   })
36
37 WHERE {
38   ?_contact rdf:type nco:ContactGroup, nco:Contact
39
40   OPTIONAL { ?_contact nco:hasAffiliation ?_context }
41 }