query-e9ae4781eed8c5a7d0dba0bd91912e94
Query for list of polygons and how many sides they haveBeen trying to make a query that lists all polygons (Q37555) and lists their side count. Not sure how to approach it.. Comments in the query would be welcome :) 18:07, 11 October 2019 (UTC)) talk (MoonyTheDwarf-- : Here is a query proposal.MoonyTheDwarf@
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?itemDescription ?corners {
?item wdt:P279 wd:Q37555 .
?item p:P2670 [ ps:P2670 wd:Q26401; pq:P1114 ?corners ] .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?corners
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?corners"):::projected
v2("?item"):::projected
a1((" "))
c4(["wd:Q26401"]):::iri
c2(["wd:Q37555"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"p:direct/P279"--> c2
a1 --"p:statement/P2670"--> c4
a1 --"p:qualifier/P1114"--> v1
v2 --"p:P2670"--> a1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end