query-566b9af219ceb13b89e6cdebe036b681
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?item ?property ?propertyLabel ?value ?valueLabel WHERE
{
{
SELECT DISTINCT ?item WHERE {
VALUES ?type {
wd:Q12443800 # state
wd:Q467745 # union territory
wd:Q515 # city
wd:Q1549591 # big city
}
?item wdt:P31 ?type.
?item wdt:P17 wd:Q668.
} } {?item ?predicate ?value .
?property wikibase:directClaim ?predicate .}
UNION
{?item rdfs:label ?value. filter(lang(?value)="en") BIND(rdfs:label as ?property) }
UNION
{?item schema:description ?value. filter(lang(?value)="en") BIND(schema:description as ?property) }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v3("?predicate")
v6("?property"):::projected
v1("?type")
v4("?value"):::projected
c9(["bd:serviceParam"]):::iri
c3(["wd:Q668"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/VALUES ?type/]
bind0-->v1
bind00(["wd:Q12443800"])
bind00 --> bind0
bind01(["wd:Q467745"])
bind01 --> bind0
bind02(["wd:Q515"])
bind02 --> bind0
bind03(["wd:Q1549591"])
bind03 --> bind0
v2 --"wdt:P31"--> v1
v2 --"wdt:P17"--> c3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
f1[["?value = 'en'"]]
f1 --> v4
v2 --"schema:description"--> v4
bind2[/"'schema:description'"/]
bind2 --as--o v6
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
f3[["?value = 'en'"]]
f3 --> v4
v2 --"rdfs:label"--> v4
bind4[/"'rdfs:label'"/]
bind4 --as--o v6
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 -->v3--> v4
v6 --"wikibase:directClaim"--> v3
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end