query-cefc4842ceafd17eed2e68815e8c6279
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT DISTINCT ?col_1 ?col_2 WHERE {
?item wdt:P31 wd:Q17051044;
wdt:P131 ?P131;
p:P131 ?P131_1.
?P131_1 ps:P131 ?P131_2.
?P131_2 wdt:P31 wd:Q48336.
BIND(REPLACE(STR(?item), "http://www.wikidata.org/entity/", "") AS ?itemID)
BIND(REPLACE(STR(?P131_1), "http://www.wikidata.org/entity/statement/([Q-q]{1}[0-9]{3,}-)", "") AS ?value)
BIND(CONCAT("-STATEMENT") AS ?col_1)
BIND(CONCAT(STR(?itemID), "$", ?value) AS ?col_2)
}
LIMIT 100
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?P131")
v3("?P131_1")
v4("?P131_2")
v7("?col_1"):::projected
v8("?col_2"):::projected
v1("?item")
v5("?itemID")
v6("?value")
c6(["wd:Q48336"]):::iri
c2(["wd:Q17051044"]):::iri
v1 --"p:direct/P31"--> c2
v1 --"p:direct/P131"--> v2
v1 --"p:P131"--> v3
v3 --"p:statement/P131"--> v4
v4 --"p:direct/P31"--> c6
bind0[/"replace(str(?item),'http://www.wikidata.org/entity/','')"/]
v1 --o bind0
bind0 --as--o v5
bind1[/"replace(str(?P131_1),'http://www.wikidata.org/entity/statement/(#91;Q-q#93;{1}#91;0-9#93;{3,}-)','')"/]
v3 --o bind1
bind1 --as--o v6
bind2[/"concat('-STATEMENT')"/]
bind2 --as--o v7
bind3[/"concat(str(?itemID),'$',?value)"/]
v5 --o bind3
v6 --o bind3
bind3 --as--o v8