query-d1d44d4d02cdf8089f54d2d3c9ff4bf7

rq turtle/ttl

Docteur.e plus âgé.e.s que leurs responsables de thèse

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?difference ?doctor ?doctorLabel ?doctorBirthdate ?doctorIdref ?supervisor ?supervisorLabel ?supervisorBirthdate ?supervisorIdref
WHERE 
{
  ?doctor wdt:P184 ?supervisor .
  ?supervisor wdt:P269 ?supervisorIdref .
  ?doctor wdt:P269 ?doctorIdref .
  ?doctor p:P569/psv:P569 [
    wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year
    wikibase:timeValue ?doctorBirthdate ;
  ] .
  ?supervisor p:P569/psv:P569 [
    wikibase:timePrecision "9"^^xsd:integer ; # precision of at least year
    wikibase:timeValue ?supervisorBirthdate ;
  ]

  FILTER(datatype(?supervisorBirthdate) = <http://www.w3.org/2001/XMLSchema#dateTime>) .
  FILTER(datatype(?doctorBirthdate) = <http://www.w3.org/2001/XMLSchema#dateTime>) .


  BIND(YEAR(?doctorBirthdate)-YEAR(?supervisorBirthdate) as ?difference)

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # le label viendra de préférence dans votre langue, et autrement en anglais
}
ORDER BY ?difference
LIMIT 10

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?difference"):::projected v4("?doctor"):::projected v2("?doctorBirthdate"):::projected v7("?doctorIdref"):::projected v5("?supervisor"):::projected v3("?supervisorBirthdate"):::projected v6("?supervisorIdref"):::projected a2((" ")) a1((" ")) a4((" ")) a3((" ")) c10(["bd:serviceParam"]):::iri c5(["9^^xsd:integer"]):::literal c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?doctorBirthdate = 'xsd:dateTime'"]] f0 --> v2 f1[["?supervisorBirthdate = 'xsd:dateTime'"]] f1 --> v3 v4 --"p:direct/P184"--> v5 v5 --"p:direct/P269"--> v6 v4 --"p:direct/P269"--> v7 a1 --"wikibase:timePrecision"--> c5 a1 --"wikibase:timeValue"--> v2 v4 --"p:P569"--> a2 a2 --"p:statement/value/P569"--> a1 a3 --"wikibase:timePrecision"--> c5 a3 --"wikibase:timeValue"--> v3 v5 --"p:P569"--> a4 a4 --"p:statement/value/P569"--> a3 bind2[/"year-from-dateTime(?doctorBirthdate) - year-from-dateTime(?supervisorBirthdate)"/] v2 --o bind2 v3 --o bind2 bind2 --as--o v8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end