query-ee1f1db4c29adb688d0e05f995ef6244

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
select ?item ?itemLabel (year(?date) as ?année_naissance) ?paysLabel ?pays ?clétrinom{
  ?item wdt:P31 wd:Q5 ;
        wdt:P21 wd:Q6581072 ;
        wdt:P106 wd:Q170790 ;
        ^schema:about/schema:isPartOf <https://fr.wikipedia.org/>
  optional { 
    ?item wdt:P734 ?nom_de_famille . ?nom_de_famille wdt:P282 wd:Q8229 . 
  }
  optional { 
    ?item wdt:P569 ?date .
  }
  optional {
    ?item wdt:P27 ?pays .
  }
  service wikibase:label { 
    bd:serviceParam wikibase:language "fr,en". 
    ?nom_de_famille rdfs:label ?nom_de_familleLabel .
    ?item rdfs:label ?itemLabel .        
    ?pays rdfs:label ?paysLabel
  }
  bind(
    coalesce(?nom_de_familleLabel,         # en clé de tri : le nom de famille si il est précisé,
             if(contains(?itemLabel," "),  
                strafter(?itemLabel," "),  # sinon pour les noms, ce qu’il y a après le premier espaces du libellé
                ?itemLabel                 # et pour les noms sans noms de famille (grecs anthiques), on prend le label
               )) as ?clétrinom)
} order by ?clétrinom

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?année_naissance") v9("?clétrinom"):::projected v4("?date"):::projected v2("?item"):::projected v7("?itemLabel"):::projected v3("?nom_de_famille") v6("?nom_de_familleLabel") v5("?pays"):::projected v8("?paysLabel"):::projected a1((" ")) c6(["wd:Q170790"]):::iri c9([https://fr.wikipedia.org/]):::iri c4(["wd:Q6581072"]):::iri c16(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c12(["wd:Q8229"]):::iri c18(["fr,en"]):::literal v2 --"wdt:P31"--> c2 v2 --"wdt:P21"--> c4 v2 --"wdt:P106"--> c6 a1 --"schema:about"--> v2 a1 --"schema:isPartOf"--> c9 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P734".-> v3 v3 --"wdt:P282"--> c12 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P569".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P27".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 v3 --"rdfs:label"--> v6 v2 --"rdfs:label"--> v7 v5 --"rdfs:label"--> v8 end bind0[/"?nom_de_familleLabelif(contains(?itemLabel,' '),substring-after(?itemLabel,' '),?itemLabel)"/] v6 --o bind0 v7 --o bind0 bind0 --as--o v9 bind1[/"year-from-dateTime(?date)"/] v4 --o bind1 bind1 --as--o v9