Changes: QB unit test/data: Use "grouped" SPARQL syntax
[qtcontacts-tracker:hasselmms-qtcontacts-tracker.git] / tests / ut_qtcontacts_trackerplugin_querybuilder / data / 118-Group-PhoneNumber.rq
1 SELECT
2   ?_contact tracker:id(?_contact)
3   ?_context rdfs:label(?_context)
4
5  (SELECT
6     GROUP_CONCAT(fn:concat(?_tel, "\u001f",
7                            fn:concat(nco:phoneNumber(?_tel),
8                                      "\u001c",
9                                      tracker:coalesce((SELECT ?g1 WHERE { GRAPH ?g1 { ?_contact nco:hasPhoneNumber ?_tel } }),
10                                                  "")), "\u001f",
11                            tracker:coalesce((SELECT GROUP_CONCAT(tracker:id(?_t), "\u001d")
12                                              WHERE { ?_tel rdf:type ?_t }), ""), "\u001f",
13                            tracker:coalesce((SELECT
14                                                GROUP_CONCAT(fn:concat(nao:propertyValue(?_p), "\u001c",
15                                                                       tracker:coalesce((SELECT ?_g2 WHERE { GRAPH ?_g2 { ?_tel nao:hasProperty ?_p } }), "")),
16                                                             "\u001d")
17                                              WHERE {
18                                                ?_tel nao:hasProperty ?_p .
19                                                ?_p nao:propertyName "SubTypes"
20                                              }), "")),
21                  "\u001e")
22   WHERE {
23     ?_contact nco:hasPhoneNumber ?_tel
24   })
25
26 WHERE {
27   ?_contact rdf:type nco:ContactGroup, nco:Contact
28
29   OPTIONAL { ?_contact nco:hasAffiliation ?_context }
30 }