query-682abf9a2ac14bee01d381ee0ab1c21d
TODO
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#>
SELECT ?item ?p17Label ?p495Label WHERE {
BIND( xsd:integer( STRAFTER( STR( ?item ), STR( wd:Q ) ) ) AS ?qid )
?item wdt:P31/wdt:P279* wd:Q188451.
OPTIONAL {?item wdt:P17 ?p17.} .
OPTIONAL {?item wdt:P495 ?p495.} .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
order by ?qid
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v3("?p17")
v4("?p495")
v2("?qid")
a1((" "))
c7(["bd:serviceParam"]):::iri
c3(["wd:Q188451"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/"http://www.w3.org/2001/XMLSchema#integer(substring-after(str(?item),str('wd:Q')))"/]
v2 --o bind0
bind0 --as--o v2
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P17".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P495".-> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end