query-f0f1de81d2006d5370f2a5b11be1b288

rq turtle/ttl

title: List of places in Tintin SELECT ?place ?placeLabel ?book ?bookLabel ?rk WHERE { ?book wdt:P179 wd:Q744536; wdt:P1545 ?rank. BIND(xsd:integer(?rank) AS ?rk) OPTIONAL { ?book wdt:P840 ?place. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY (?rk) (?placeLabel)

Use at

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 places in Tintin
SELECT ?place ?placeLabel ?book ?bookLabel ?rk WHERE {
  ?book wdt:P179 wd:Q744536;
    wdt:P1545 ?rank.
  BIND(xsd:integer(?rank) AS ?rk)
  OPTIONAL { ?book wdt:P840 ?place. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY (?rk) (?placeLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?book"):::projected v5("?place"):::projected v2("?placeLabel"):::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 v3 --"wdt:P1545"--> v4 bind0[/"http://www.w3.org/2001/XMLSchema#integer(?rank)"/] v4 --o bind0 bind0 --as--o v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P840".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end