query-c190e8efca41cbbfa5da25caa7a0cdcc

rq turtle/ttl

Sources of data for researchBased on a query by @WikiDigi on Twitter

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?storeLabel ?url (GROUP_CONCAT(DISTINCT ?typeLabel;separator=", ") AS ?types) ?subjectLabel
WHERE {
VALUES ?type {wd:Q5227308 wd:Q22692845 wd:Q7689673 wd:Q4117139
                          wd:Q5281480 wd:Q212805 wd:Q5570651}
?store wdt:P31/wdt:P279* ?type; 
         wdt:P856 ?url;
         wdt:P31 ?type
MINUS {?store wdt:P576 []}
OPTIONAL {?store wdt:P921 ?subject.}
SERVICE wikibase:label {
  bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
  ?type rdfs:label ?typeLabel. ?store rdfs:label ?storeLabel. ?subject rdfs:label ?subjectLabel
                       }
} GROUP BY ?storeLabel ?url ?subjectLabel ORDER BY UCASE(?storeLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?store") v1("?storeLabel"):::projected v5("?subject") v7("?subjectLabel"):::projected v2("?type") v6("?typeLabel"):::projected v8("?types") v4("?url"):::projected a2((" ")) a1((" ")) c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?type/] bind0-->v2 bind00(["wd:Q5227308"]) bind00 --> bind0 bind01(["wd:Q22692845"]) bind01 --> bind0 bind02(["wd:Q7689673"]) bind02 --> bind0 bind03(["wd:Q4117139"]) bind03 --> bind0 bind04(["wd:Q5281480"]) bind04 --> bind0 bind05(["wd:Q212805"]) bind05 --> bind0 bind06(["wd:Q5570651"]) bind06 --> bind0 v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> v2 v3 --"wdt:P856"--> v4 v3 --"wdt:P31"--> v2 subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P576"--> a2 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P921".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 v2 --"rdfs:label"--> v6 v3 --"rdfs:label"--> v1 v5 --"rdfs:label"--> v7 end bind3[/"?typeLabel"/] v6 --o bind3 bind3 --as--o v8