query-19990643f161c28adc54769285a69d96

rq turtle/ttl

/French mayorsOr, as an updating list: different ways: fourScanning the ones who don't have a jurisdiction, it looks this this can actually be set at least (Q382617)mayor of a place in France : (P39)position held as a qualifier on a bare (P768)electoral district (Q382617)mayor of a place in France : (P39)position held as a qualifier on a bare (P276)location (Q382617)mayor of a place in France : (P39)position held as a qualifier on a bare (P642)of on a dedicated item for the position(P1001)applies to jurisdiction qualifier, but that one seemed less defensible, so I changed it) (P1268)represents (There was also a single one using a So the next draft is:

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 ?item ?itemLabel ?person ?personLabel ?position ?positionLabel ?start
WHERE { 
  ?position wdt:P279* wd:Q382617 .
  ?person p:P39 ?statement FILTER NOT EXISTS { ?statement pq:P582 ?end } .
  ?statement ps:P39 ?position ; pq:P580 ?start .
  OPTIONAL { ?statement pq:P642 ?item } .
  OPTIONAL { ?statement pq:P276 ?item } .
  OPTIONAL { ?statement pq:P768 ?item } .
  OPTIONAL { ?position wdt:P1001 ?item } .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" . }
}
ORDER BY ?itemLabel ?start

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?end") v7("?item"):::projected v1("?itemLabel"):::projected v6("?person"):::projected v5("?position"):::projected v2("?start"):::projected v3("?statement") c14(["fr"]):::literal c12(["bd:serviceParam"]):::iri c3(["wd:Q382617"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:qualifier/P582"--> e0v2 e0v2("?end"):::projected e0v1("?statement"):::projected end f0--EXISTS--> f0e0 f0 --> v3 f0 --> c1 f0 --> v4 v3 --"p:qualifier/P582"--> v4 v5 --"p:direct/P279"--> c3 v6 --"p:P39"--> v3 v3 --"p:statement/P39"--> v5 v3 --"p:qualifier/P580"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:qualifier/P642".-> v7 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:qualifier/P276".-> v7 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:qualifier/P768".-> v7 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P1001".-> v7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end