query-69abbcc366b3d78a7e77148295687032
sailboat class lengths converted to standard SI unit
see https://en.wikibooks.org/wiki/SPARQL/WIKIDATA_Precision,_Units_and_Coordinates#Normalised_units
SELECT ?item ?itemLabel ?length ?unitLabel ?length2 ?conversion ?length_in_m WHERE { ?item wdt:P31/wdt:P279* wd:Q106179098. # sailboat class #?item wdt:P17 wd:Q30. # country USA ?item p:P2043 ?stmnode. # length ?stmnode psv:P2043 ?valuenode. ?valuenode wikibase:quantityAmount ?length. ?valuenode wikibase:quantityUnit ?unit.
# conversion to SI unit ?unit p:P2370 ?unitstmnode. # conversion to SI unit ?unitstmnode psv:P2370 ?unitvaluenode. ?unitvaluenode wikibase:quantityAmount ?conversion. ?unitvaluenode wikibase:quantityUnit wd:Q11573. # meter BIND(?length * ?conversion AS ?length_in_m).
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } ORDER BY DESC(?length_in_m) LIMIT 10000
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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# sailboat class lengths converted to standard SI unit
# see https://en.wikibooks.org/wiki/SPARQL/WIKIDATA_Precision,_Units_and_Coordinates#Normalised_units
SELECT ?item ?itemLabel ?length ?unitLabel ?length2 ?conversion ?length_in_m
WHERE
{
?item wdt:P31/wdt:P279* wd:Q106179098. # sailboat class
#?item wdt:P17 wd:Q30. # country USA
?item p:P2043 ?stmnode. # length
?stmnode psv:P2043 ?valuenode.
?valuenode wikibase:quantityAmount ?length.
?valuenode wikibase:quantityUnit ?unit.
# conversion to SI unit
?unit p:P2370 ?unitstmnode. # conversion to SI unit
?unitstmnode psv:P2370 ?unitvaluenode.
?unitvaluenode wikibase:quantityAmount ?conversion.
?unitvaluenode wikibase:quantityUnit wd:Q11573. # meter
BIND(?length * ?conversion AS ?length_in_m).
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY DESC(?length_in_m)
LIMIT 10000
Query found at
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Sailing/Queries
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Sailing/Queries/Lists_sailboat_class