query-238fd86b527a3de5fc26e954b8cedb0e
mw:Wikidata Query Service/User Manual#Label service
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
?personnage_de_fiction ?personnage_de_fictionLabel
(GROUP_CONCAT(DISTINCT (?present_dans_l_ouvre); separator=", ") as ?personnage_de)
(GROUP_CONCAT(DISTINCT (?present_dans_l_ouvreLabel); separator=", ") as ?personnage_deLabel)
WHERE {
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?present_dans_l_ouvre rdfs:label ?present_dans_l_ouvreLabel.
?personnage_de_fiction rdfs:label ?personnage_de_fictionLabel.
}
VALUES ?orientation {
wd:Q43200
wd:Q271534
}
?personnage_de_fiction (wdt:P31/(wdt:P279*)) wd:Q95074;
wdt:P91 ?orientation.
OPTIONAL { ?personnage_de_fiction wdt:P1441 ?present_dans_l_ouvre. }
OPTIONAL { ?personnage_de_fiction wdt:P91 ?orientation_sexuelle. }
}
GROUP BY ?personnage_de_fiction ?personnage_de_fictionLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?orientation")
v6("?orientation_sexuelle")
v7("?personnage_de")
v8("?personnage_deLabel")
v3("?personnage_de_fiction"):::projected
v4("?personnage_de_fictionLabel"):::projected
v1("?present_dans_l_ouvre"):::projected
v2("?present_dans_l_ouvreLabel"):::projected
a1((" "))
c2(["bd:serviceParam"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c8(["wd:Q95074"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
v1 --"rdfs:label"--> v2
v3 --"rdfs:label"--> v4
end
bind0[/VALUES ?orientation/]
bind0-->v5
bind00(["wd:Q43200"])
bind00 --> bind0
bind01(["wd:Q271534"])
bind01 --> bind0
v3 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c8
v3 --"wdt:P91"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P1441".-> v1
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P91".-> v6
end
bind3[/"?present_dans_l_ouvre"/]
v1 --o bind3
bind3 --as--o v7
bind4[/"?present_dans_l_ouvreLabel"/]
v2 --o bind4
bind4 --as--o v8