query-8239f245595c9f1c5e23c7de7f9a639f

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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT 
?participant ?participantLabel 
?datenaissance ?annee_naissance ?mois_naissance ?jour_naissance ?precision_naissance

WHERE {
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
 ?La_Revue_LGBT_BD wdt:P361 wd:Q57925218.
 ?La_Revue_LGBT_BD wdt:P710 ?participant.

 OPTIONAL{
 ?participant p:P569 ?statement.
 ?statement psv:P569 ?full_value.
 ?full_value wikibase:timeValue ?datenaissance.
 ?full_value wikibase:timePrecision ?precision_naissance.
 BIND( IF(?precision_naissance >=  9, YEAR(?datenaissance),  "") AS ?annee_naissance)
 BIND( IF(?precision_naissance >= 10, MONTH(?datenaissance), "") AS ?mois_naissance)
 BIND( IF(?precision_naissance >= 11, DAY(?datenaissance),   "") AS ?jour_naissance)

 # Use only truthy statements
 ?statement wikibase:rank ?rank.
 FILTER (?rank = wikibase:PreferredRank ||
         (?rank = wikibase:NormalRank && NOT EXISTS { ?participant p:P69/wikibase:rank wikibase:PreferredRank. } )
        )

 }
}

LIMIT 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?La_Revue_LGBT_BD") v8("?annee_naissance"):::projected v6("?datenaissance"):::projected v5("?full_value") v10("?jour_naissance"):::projected v9("?mois_naissance"):::projected v2("?participant"):::projected v7("?precision_naissance"):::projected v1("?rank") v4("?statement") a1((" ")) c1(["wikibase:PreferredRank"]):::iri c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal c10(["wd:Q57925218"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end v3 --"p:direct/P361"--> c10 v3 --"p:direct/P710"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P569".-> v4 v4 --"p:statement/value/P569"--> v5 v5 --"wikibase:timeValue"--> v6 v5 --"wikibase:timePrecision"--> v7 bind0[/"if(?precision_naissance >= '9^^xsd:integer',year-from-dateTime(?datenaissance),'')"/] v7 --o bind0 v6 --o bind0 bind0 --as--o v8 bind1[/"if(?precision_naissance >= '10^^xsd:integer',month-from-dateTime(?datenaissance),'')"/] v7 --o bind1 v6 --o bind1 bind1 --as--o v9 bind2[/"if(?precision_naissance >= '11^^xsd:integer',day-from-dateTime(?datenaissance),'')"/] v7 --o bind2 v6 --o bind2 bind2 --as--o v10 v4 --"wikibase:rank"--> v1 end