query-0f26cc1a183a731d96e745cad79556a1

rq turtle/ttl

Creators with Reasonator links

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 (URI(CONCAT("https://tools.wmflabs.org/reasonator/?q=", SUBSTR(STR(?creator),32) )) as ?reasonator) ?creatorLabel
(GROUP_CONCAT(DISTINCT ?locLabel; separator=", ") AS ?locations) ?countryLabel (COUNT(?item) AS ?count) WHERE {
?item wdt:P31/wdt:P361? wd:Q164992.
VALUES ?rel {wdt:P170 wdt:P1774}
?item ?rel ?creator FILTER(!wikibase:isSomeValue(?creator))
OPTIONAL {?creator wdt:P27 ?country }
OPTIONAL {?creator wdt:P937 ?loc }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
                        ?loc rdfs:label ?locLabel. ?creator rdfs:label ?creatorLabel. ?country rdfs:label ?countryLabel }
} GROUP BY ?creator ?creatorLabel ?countryLabel
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v12("?count") v5("?country") v9("?countryLabel"):::projected v2("?creator"):::projected v8("?creatorLabel"):::projected v3("?item"):::projected v6("?loc") v7("?locLabel"):::projected v11("?locations") v10("?reasonator") v4("?rel") a1((" ")) c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2(["wd:Q164992"]):::iri f0[["not http://wikiba.se/ontology#isSomeValue(?creator)"]] f0 --> v2 v3 --"wdt:P31"--> a1 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; a1 --"wdt:P361"--> c2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; end union0r <== or ==> union0l end bind1[/VALUES ?rel/] bind1-->v4 bind10(["wdt:P170"]) bind10 --> bind1 bind11(["wdt:P1774"]) bind11 --> bind1 v3 -->v4--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P27".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P937".-> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 v6 --"rdfs:label"--> v7 v2 --"rdfs:label"--> v8 v5 --"rdfs:label"--> v9 end bind4[/"concat('https://tools.wmflabs.org/reasonator/?q=',substring(str(?creator),'32^^xsd:integer'))"/] v2 --o bind4 bind4 --as--o v10 bind5[/"?locLabel"/] v7 --o bind5 bind5 --as--o v11 bind6[/"count(?item)"/] v3 --o bind6 bind6 --as--o v12