query-64ca0c006a9221c0071b104b1bfc64ce
title: List of characters in Tintin
SELECT ?character ?characterLabel ?book ?bookLabel ?rk WHERE {
?book wdt:P179 wd:Q744536.
OPTIONAL {
?book wdt:P1545 ?rank.
BIND(xsd:integer(?rank) AS ?rk)
}
OPTIONAL {?book wdt:P674 ?character.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY (?rk) (?characterLabel)
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: List of characters in Tintin
SELECT ?character ?characterLabel ?book ?bookLabel ?rk WHERE {
?book wdt:P179 wd:Q744536.
OPTIONAL {
?book wdt:P1545 ?rank.
BIND(xsd:integer(?rank) AS ?rk)
}
OPTIONAL {?book wdt:P674 ?character.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY (?rk) (?characterLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?book"):::projected
v5("?character"):::projected
v2("?characterLabel"):::projected
v4("?rank")
v5("?rk"):::projected
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q744536"]):::iri
v3 --"wdt:P179"--> c2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P1545".-> v4
bind0[/"http://www.w3.org/2001/XMLSchema#integer(?rank)"/]
v4 --o bind0
bind0 --as--o v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P674".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end