query-daa53fe36d4ed9ce085c117d61d3ebae

rq turtle/ttl

Debug denylist

Use at

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#>
SELECT (COUNT(*) AS ?count) ?istanza_diNome
WHERE { 
  ?item (wdt:P131*) wd:Q1256.
  MINUS {
    VALUES ?denylist {
       wd:Q3914     # school
       wd:Q2824645  # administrative divisions of Italy
       wd:Q26907166 # temporal entity
    }.
    ?item wdt:P31/wdt:P279* ?denylist. 
  }
  OPTIONAL {
    ?item       wdt:P31    ?istanza_di.
    ?istanza_di rdfs:label ?istanza_diNome
    FILTER ( LANGMATCHES ( LANG ( ?istanza_diNome ), "it" ) )
  }
} 
GROUP BY ?istanza ?istanza_diNome
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?count") v4("?denylist") v5("?istanza_di") v2("?istanza_diNome"):::projected v3("?item") a1((" ")) c3(["wd:Q1256"]):::iri v3 --"wdt:P131"--> c3 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; bind1[/VALUES ?denylist/] bind1-->v4 bind10(["wd:Q3914"]) bind10 --> bind1 bind11(["wd:Q2824645"]) bind11 --> bind1 bind12(["wd:Q26907166"]) bind12 --> bind1 v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> v4 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P31".-> v5 v5 --"rdfs:label"--> v2 end bind3[/"count(*)"/] bind3 --as--o v6