query-25b1f5b571b2e2402d9e655db6a34f78

rq turtle/ttl

Bouzinac(P585)point in time (P6259)epoch

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 ?item ?name ?language_tag ?rank ?epochLabel ?start ?point_of_time ?end
WHERE
{

{
  SELECT ?item
  WHERE
  {

{
  # Select items with more than 3 official names, i.e. it has changed at least 3 times.
  SELECT ?item
  WHERE
  {
    ?item p:P1448 []. # Official name
  }
  GROUP BY ?item
  HAVING (COUNT(?item) > 3)
}    ?item p:P1448 / ps:P1448 ?name.
    FILTER LANGMATCHES(LANG(?name), "fr")
  }
  GROUP BY ?item
  HAVING (COUNT(?item) > 3)
}  ?item wdt:P31 / wdt:P279 wd:Q486972. # ?item is a settelement
  ?item p:P1448 ?name_statement.
  ?name_statement wikibase:rank ?rank.
  ?name_statement ps:P1448 ?name.
  BIND (LANG(?name) AS ?language_tag).
  OPTIONAL { ?name_statement pq:P6259 ?epoch. }
  OPTIONAL { ?name_statement pq:P580 ?start. }
  OPTIONAL { ?name_statement pq:P585 ?point_of_time. }
  OPTIONAL { ?name_statement pq:P582 ?end. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,en". }
}
ORDER By ?item ?start ?point_of_time ?end

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?_anon_42b5416610844a34809f33a099ae9de175947") v7("?_anon_42b5416610844a34809f33a099ae9de175950") v4("?end"):::projected v11("?epoch") v1("?item"):::projected v10("?language_tag"):::projected v5("?name"):::projected v8("?name_statement") v3("?point_of_time"):::projected v9("?rank"):::projected v2("?start"):::projected a3((" ")) a2((" ")) a4((" ")) a1((" ")) a5((" ")) c16(["#91;AUTO_LANGUAGE#93;,fr,en"]):::literal c7(["wd:Q486972"]):::iri c14(["bd:serviceParam"]):::iri f0[[" > '3^^xsd:integer'"]] f0 --> a1 f1[["langmatch(?name,'fr')"]] f1 --> v5 f2[[" > '3^^xsd:integer'"]] f2 --> a2 v1 --"p:P1448"--> a3 bind4[/"count(?item)"/] v1 --o bind4 bind4 --as--o v6 v1 --"p:P1448"--> a4 a4 --"p:statement/P1448"--> v5 bind6[/"count(?item)"/] v1 --o bind6 bind6 --as--o v7 v1 --"p:direct/P31"--> a5 a5 --"p:direct/P279"--> c7 v1 --"p:P1448"--> v8 v8 --"wikibase:rank"--> v9 v8 --"p:statement/P1448"--> v5 bind7[/"?name"/] v5 --o bind7 bind7 --as--o v10 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:qualifier/P6259".-> v11 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:qualifier/P580".-> v2 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:qualifier/P585".-> v3 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:qualifier/P582".-> v4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end