Changes: QB unit test/data: Use "grouped" SPARQL syntax
[qtcontacts-tracker:hasselmms-qtcontacts-tracker.git] / tests / ut_qtcontacts_trackerplugin_querybuilder / data / 101-Group-Address.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:country(?_address, "\u002c", "\u001c"), ""), "\u001f",
8                           tracker:coalesce(nco:locality(?_address, "\u002c", "\u001c"), ""), "\u001f",
9                           tracker:coalesce(nco:pobox(?_address, "\u002c", "\u001c"), ""), "\u001f",
10                           tracker:coalesce(nco:postalcode(?_address, "\u002c", "\u001c"), ""), "\u001f",
11                           tracker:coalesce(nco:region(?_address, "\u002c", "\u001c"), ""), "\u001f",
12                           tracker:coalesce(nco:streetAddress(?_address, "\u002c", "\u001c"), ""), "\u001f",
13                           tracker:coalesce((SELECT
14                                               GROUP_CONCAT(tracker:id(?_t), "\u001d")
15                                             WHERE {
16                                               ?_address rdf:type ?_t
17                                             }), ""), "\u001f",
18                           tracker:coalesce((SELECT
19                                               GROUP_CONCAT(fn:concat(nao:propertyValue(?_p), "\u001c",
20                                                                      tracker:coalesce((SELECT ?_g WHERE {GRAPH ?_g {?_address nao:hasProperty ?_p}}),
21                                                                                       "")),
22                                                            "\u001d")
23                                             WHERE {
24                                               ?_address nao:hasProperty ?_p .
25                                               ?_p nao:propertyName "SubTypes"
26                                             }), "")),
27                 "\u001e")
28
29   WHERE {
30     ?_contact nco:hasPostalAddress ?_address
31   })
32
33 WHERE {
34   ?_contact rdf:type nco:ContactGroup, nco:Contact
35
36   OPTIONAL { ?_contact nco:hasAffiliation ?_context }
37 }