query-f513b90c6302b9e2a9bc7d88b55cf83b

rq turtle/ttl

TODO

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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?CountryLabel ?Country ?sort where {
  ?item wdt:P1440 "900206".
  ?item p:P1532 [ps:P1532 ?Country].
    BIND(xsd:integer(STRAFTER(STR(?Country),"Q")) as ?sort)
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
    ?item rdfs:label ?itemLabel .
    ?Country rdfs:label ?CountryLabel           
  }
} order by ?sort

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?Country"):::projected v5("?CountryLabel"):::projected v2("?item"):::projected v4("?itemLabel"):::projected v4("?sort"):::projected a1((" ")) c2(["900206"]):::literal c6(["bd:serviceParam"]):::iri c8(["en"]):::literal v2 --"p:direct/P1440"--> c2 a1 --"p:statement/P1532"--> v3 v2 --"p:P1532"--> a1 bind0[/"http://www.w3.org/2001/XMLSchema#integer(substring-after(str(?Country),'Q'))"/] v3 --o bind0 bind0 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 v2 --"rdfs:label"--> v4 v3 --"rdfs:label"--> v5 end