query-567fb57191b4f5a58cff265500a13a81

rq turtle/ttl

List of organizations of the Indian Red Cross Society (IRCS): notably its state branches; added 2021-02-23, by Jura1 SELECT ?rc ?rcLabel ?hqLabel ?roleLabel ?item ?itemLabel ?sts ?ids { ?rc ( wdt:P361 | wdt:P463 | wdt:P749 ) wd:Q16237727 . OPTIONAL { ?rc wdt:P2541 ?item } OPTIONAL { ?rc wdt:P159 ?hq } OPTIONAL { ?rc wdt:P856 ?ws } OPTIONAL { ?rc ( p:P361 | p:P463 | p:P749 ) [ pq:P2868 ?role ; ( ps:P361 | ps:P463 | ps:P749 ) / ( wdt:P361 | wdt:P463 | wdt:P749 ) wd:Q16237727 ] } ?rc wikibase:statements ?sts ; wikibase:identifiers ?ids . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY DESC(?item = wd:Q668)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#List of organizations of the Indian Red Cross Society (IRCS): notably its state branches; added 2021-02-23, by Jura1
SELECT ?rc ?rcLabel ?hqLabel ?roleLabel ?item ?itemLabel ?sts ?ids
{
    ?rc ( wdt:P361 | wdt:P463 | wdt:P749 )*  wd:Q16237727 .
    OPTIONAL { ?rc wdt:P2541 ?item }
    OPTIONAL { ?rc wdt:P159 ?hq }
    OPTIONAL { ?rc wdt:P856 ?ws }
    OPTIONAL { ?rc ( p:P361 | p:P463 | p:P749 ) [ pq:P2868 ?role ; ( ps:P361 | ps:P463 | ps:P749 ) / ( wdt:P361 | wdt:P463 | wdt:P749 )*  wd:Q16237727 ] }
    ?rc wikibase:statements ?sts ; wikibase:identifiers ?ids .
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?item = wd:Q668)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?hq") v7("?ids"):::projected v1("?item"):::projected v2("?rc"):::projected v5("?role") v6("?sts"):::projected v4("?ws") a1((" ")) a2((" ")) c19(["bd:serviceParam"]):::iri c3(["wd:Q16237727"]):::iri c21(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P749"--> c3 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P463"--> c3 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P361"--> c3 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P2541".-> v1 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P159".-> v3 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P856".-> v4 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; a1 -."p:qualifier/P2868".-> v5 subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; a1 --"p:statement/P749"--> a2 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; a1 --"p:statement/P463"--> a2 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; a1 --"p:statement/P361"--> a2 end union2r <== or ==> union2l end subgraph union4[" Union "] subgraph union4l[" "] style union4l fill:#abf,stroke-dasharray: 3 3; subgraph union5[" Union "] subgraph union5l[" "] style union5l fill:#abf,stroke-dasharray: 3 3; a2 --"p:direct/P749"--> c3 end subgraph union5r[" "] style union5r fill:#abf,stroke-dasharray: 3 3; a2 --"p:direct/P463"--> c3 end union5r <== or ==> union5l end end subgraph union4r[" "] style union4r fill:#abf,stroke-dasharray: 3 3; a2 --"p:direct/P361"--> c3 end union4r <== or ==> union4l end subgraph union6[" Union "] subgraph union6l[" "] style union6l fill:#abf,stroke-dasharray: 3 3; subgraph union7[" Union "] subgraph union7l[" "] style union7l fill:#abf,stroke-dasharray: 3 3; v2 --"p:P749"--> a1 end subgraph union7r[" "] style union7r fill:#abf,stroke-dasharray: 3 3; v2 --"p:P463"--> a1 end union7r <== or ==> union7l end end subgraph union6r[" "] style union6r fill:#abf,stroke-dasharray: 3 3; v2 --"p:P361"--> a1 end union6r <== or ==> union6l end end v2 --"wikibase:statements"--> v6 v2 --"wikibase:identifiers"--> v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c19 --"wikibase:language"--> c21 end