query-c4a9afe0f7925d7320bb0abca4ab5cdc
Scatter-plot of diameter against year of creation
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:ScatterChart
SELECT (YEAR(SAMPLE(?date)) as ?year) (SAMPLE(?diam) as ?diam1) (CONCAT(?itemLabel," ",SUBSTR(str(?item),32) ) as ?name) WHERE {
?item wdt:P31 wd:Q164992; wdt:P571 ?date; 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 }
} group by ?item ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?_anon_42b5416610844a34809f33a099ae9de185111"):::projected
v2("?date")
v6("?diam"):::projected
v10("?diam1")
v1("?item"):::projected
v7("?itemLabel"):::projected
v4("?length")
v11("?name")
v5("?unit")
v3("?valuenode")
v9("?year")
a1((" "))
c9(["bd:serviceParam"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q164992"]):::iri
v1 --"p:direct/P31"--> c2
v1 --"p:direct/P571"--> v2
v1 --"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;
c9 --"wikibase:language"--> c11
v1 --"rdfs:label"--> v7
end
bind3[/"sample(?date)"/]
v2 --o bind3
bind3 --as--o v8
bind4[/"year-from-dateTime()"/]
null --o bind4
bind4 --as--o v9
bind5[/"sample(?diam)"/]
v6 --o bind5
bind5 --as--o v10
bind6[/"concat(?itemLabel,' ',substring(str(?item),'32^^xsd:integer'))"/]
v7 --o bind6
v1 --o bind6
bind6 --as--o v11