query-0881306943ac70be9cfedee836d06101

rq turtle/ttl

Dipsacus fullonum

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 ?itemLabel ?naissance (coalesce(?nomLabel,?nom1Label,?nom2Label) as ?NOM)
        (coalesce(?pr_nomLabel ,?pr_nom1Label , ?pr_nom2Label ) as ?PRENOM)
where {SELECT ?item ?itemLabel ?naissance ?nomLabel ?nom1Label ?nom2Label   ?pr_nomLabel ?pr_nom1Label  ?pr_nom2Label 
WHERE {
  ?item wdt:P39 wd:Q258045.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
  OPTIONAL { ?item wdt:P569 ?naissance. }
  OPTIONAL {
    ?item p:P734 ?nom1_statement.
    ?nom1_statement a wikibase:BestRank.
    ?nom1_statement pq:P1545 "1".
    ?nom1_statement ps:P734 ?nom1.
  }
  OPTIONAL {
    ?item p:P734 ?nom2_statement.
    ?nom2_statement a wikibase:BestRank.
    ?nom2_statement pq:P1545 "2".
    ?nom2_statement ps:P734 ?nom2.
  }
  OPTIONAL {
    ?item p:P734 ?nom_statement.
    ?nom_statement a wikibase:BestRank.
    ?nom_statement ps:P734 ?nom.
    FILTER (NOT EXISTS { ?nom_statement pq:P1545 "1". } && NOT EXISTS { ?nom_statement pq:P1545 "2". })
  }
  OPTIONAL {
    ?item p:P735 ?pr_nom1_statement.
    ?pr_nom1_statement a wikibase:BestRank.
    ?pr_nom1_statement pq:P1545 "1".
    ?pr_nom1_statement ps:P735 ?pr_nom1.
  }
  OPTIONAL {
    ?item p:P735 ?pr_nom2_statement.
    ?pr_nom2_statement a wikibase:BestRank.
    ?pr_nom2_statement pq:P1545 "2".
    ?pr_nom2_statement ps:P735 ?pr_nom2.
  }
  OPTIONAL {
    ?item p:P735 ?pr_nom_statement.
    ?pr_nom_statement a wikibase:BestRank.
    ?pr_nom_statement ps:P735 ?pr_nom.
    FILTER (NOT EXISTS { ?pr_nom_statement pq:P1545 "1". } && NOT EXISTS { ?pr_nom_statement pq:P1545 "2". })
  }
}
       } order by ?NOM ?PRENOM

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v17("?NOM") v17("?PRENOM") v5("?item"):::projected v6("?naissance"):::projected v11("?nom") v8("?nom1") v7("?nom1_statement") v10("?nom2") v9("?nom2_statement") v4("?nom_statement") v16("?pr_nom") v13("?pr_nom1") v12("?pr_nom1_statement") v15("?pr_nom2") v14("?pr_nom2_statement") v3("?pr_nom_statement") c13(["wikibase:BestRank"]):::iri c9(["fr"]):::literal c5(["wd:Q258045"]):::iri c2(["1"]):::literal c3(["2"]):::literal c7(["bd:serviceParam"]):::iri v5 --"p:direct/P39"--> c5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:direct/P569".-> v6 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:P734".-> v7 v7 --"a"--> c13 v7 --"p:qualifier/P1545"--> c2 v7 --"p:statement/P734"--> v8 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:P734".-> v9 v9 --"a"--> c13 v9 --"p:qualifier/P1545"--> c3 v9 --"p:statement/P734"--> v10 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:P734".-> v4 v4 --"a"--> c13 v4 --"p:statement/P734"--> v11 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:P735".-> v12 v12 --"a"--> c13 v12 --"p:qualifier/P1545"--> c2 v12 --"p:statement/P735"--> v13 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:P735".-> v14 v14 --"a"--> c13 v14 --"p:qualifier/P1545"--> c3 v14 --"p:statement/P735"--> v15 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:P735".-> v3 v3 --"a"--> c13 v3 --"p:statement/P735"--> v16 end bind0[/"?nomLabel?nom1Label?nom2Label"/] null --o bind0 null --o bind0 null --o bind0 bind0 --as--o v17 bind1[/"?pr_nomLabel?pr_nom1Label?pr_nom2Label"/] null --o bind1 null --o bind1 null --o bind1 bind1 --as--o v17