query-a4b008b205bdfba51f711a46a5ad0e32

rq turtle/ttl

13:35, 8 October 2017 (UTC)) talk (Ayackbut I don't know how to exclude those with a church. Could you help me please? Thanks. —

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#>
SELECT distinct ?commune ?communeLabel
WHERE
{

{
  SELECT ?commune
  {
    ?commune wdt:P31 wd:Q484170 . 
    ?commune p:P31 ?statement .
    ?statement ps:P31 wd:Q484170 . 
    FILTER NOT EXISTS { ?statement pq:P582 ?x } .
    FILTER NOT EXISTS { ?commune wdt:P576 [] }
  }
}    FILTER NOT EXISTS { ?church wdt:P131 ?commune ; wdt:P31 wd:Q16970 }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?church") v2("?commune"):::projected v3("?statement") v4("?x") a1((" ")) c10(["bd:serviceParam"]):::iri c3(["wd:Q16970"]):::iri c12(["fr"]):::literal c6(["wd:Q484170"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:direct/P131"--> e0v2 e0v1 --"p:direct/P31"--> e0c3 e0v1("?church"):::projected e0v2("?commune"):::projected e0c3(["wd:Q16970"]):::iri end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> v2 f0 --> c2 f0 --> c3 v1 --"p:direct/P131"--> v2 v1 --"p:direct/P31"--> c3 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"p:direct/P576"--> e1a1 e1v1("?commune"):::projected e1a1((" ")):::projected end f1--EXISTS--> f1e1 f1 --> v2 f1 --> c4 f1 --> a1 v2 --"p:direct/P576"--> a1 f2[["not "]] subgraph f2e2["Exists Clause"] e2v1 --"p:qualifier/P582"--> e2v2 e2v1("?statement"):::projected e2v2("?x"):::projected end f2--EXISTS--> f2e2 f2 --> v3 f2 --> c5 f2 --> v4 v3 --"p:qualifier/P582"--> v4 v2 --"p:direct/P31"--> c6 v2 --"p:P31"--> v3 v3 --"p:statement/P31"--> c6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end