query-590542e3a90ad47b1a92dd636c5e14f4
Astrolabes ordered by diameter
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:BarChart
SELECT (str(?item) as ?name) ?diam WHERE {
?item wdt:P31 wd:Q164992; p:P2386/psv:P2386 ?valuenode. # astrolabes with a diameter property
?valuenode wikibase:quantityAmount ?length; wikibase:quantityUnit ?unit.
BIND(IF(?unit = wd:Q174728, ?length * 10,?length) as ?diam) # diameter in millimetres (unit is cm or mm)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?item rdfs:label ?itemLabel }
} ORDER BY DESC(?diam)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?diam"):::projected
v2("?item"):::projected
v6("?itemLabel")
v4("?length")
v7("?name")
v5("?unit")
v3("?valuenode")
a1((" "))
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q164992"]):::iri
v2 --"p:direct/P31"--> c2
v2 --"p:P2386"--> a1
a1 --"p:statement/value/P2386"--> v3
v3 --"wikibase:quantityAmount"--> v4
v3 --"wikibase:quantityUnit"--> v5
bind0[/"if(?unit = 'wd:Q174728',?length * '10^^xsd:integer',?length)"/]
v5 --o bind0
v4 --o bind0
bind0 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
v2 --"rdfs:label"--> v6
end
bind1[/"str(?item)"/]
v2 --o bind1
bind1 --as--o v7