query-47a4ed9ae6ae51efce952a5a6328bc22
List of French ministers and their positions in all history. (Q142)France value to (P17)country which instance has a (Q83307)minister that is a subclass of (P39)position held Hi, I'd like to create a list of (person, position, start date, end date) of all known persons that have a are not specified (ex: ministers currently in charge) (P582)end time or (P580)start time The query should return results even is the position of the related position. (P582)end time and (P580)start time This example looks to work but i cant find a way to extract optional
Use at
- https://query.wikidata.org/sparql
 
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?person ?personLabel ?positionLabel ?startTime ?endTime
WHERE {
  ?person wdt:P39 ?position.
  ?position wdt:P279* wd:Q83307; 
            wdt:P17 wd:Q142 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
}
order by (?personLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?person"):::projected 
  v1("?personLabel"):::projected 
  v3("?position")
  c7(["bd:serviceParam"]):::iri 
  c9(["fr"]):::literal 
  c3(["wd:Q83307"]):::iri 
  c5(["wd:Q142"]):::iri 
  v2 --"wdt:P39"-->  v3
  v3 --"wdt:P279"-->  c3
  v3 --"wdt:P17"-->  c5
  subgraph s1["http://wikiba.se/ontology#label"]
    style s1 stroke-width:4px;
    c7 --"wikibase:language"-->  c9
  end