query-30aecb920bb10566f8248473a7e6ae92
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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?elev ?unit_label #?unit ?sense ?lexeme ?form_1 ?prepr_1 ?form_2 ?prepr_2
WHERE
{
BIND(wd:Q13428 as ?item)
?item p:P2044/psv:P2044 ?placeElev.
?placeElev wikibase:quantityAmount ?elev.
?placeElev wikibase:quantityUnit ?unit.
?sense wdt:P5137 ?unit .
?lexeme ontolex:sense ?sense .
?lexeme dct:language wd:Q1412 . # Finnish
?lexeme ontolex:lexicalForm ?form_1.
?form_1 wikibase:grammaticalFeature wd:Q110786 .
?form_1 wikibase:grammaticalFeature wd:Q131105 .
?form_1 ontolex:representation ?prepr_1 .
?lexeme ontolex:lexicalForm ?form_2.
?form_2 wikibase:grammaticalFeature wd:Q146786 .
?form_2 wikibase:grammaticalFeature wd:Q131105 .
?form_2 ontolex:representation ?prepr_2 .
BIND(IF(?elev = 1, ?prepr_1, ?prepr_2) AS ?unit_label)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en language
}
Query found at
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2022/11
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/en
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/es
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/fr
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?elev"):::projected
v7("?form_1")
v9("?form_2")
v1("?item"):::projected
v6("?lexeme")
v2("?placeElev")
v8("?prepr_1")
v10("?prepr_2")
v5("?sense")
v4("?unit")
v11("?unit_label"):::projected
a1((" "))
c12(["wd:Q131105"]):::iri
c11(["wd:Q110786"]):::iri
c14(["wd:Q146786"]):::iri
c16(["bd:serviceParam"]):::iri
c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c8(["wd:Q1412"]):::iri
bind0[/"'wd:Q13428'"/]
bind0 --as--o v1
v1 --"p:P2044"--> a1
a1 --"p:statement/value/P2044"--> v2
v2 --"wikibase:quantityAmount"--> v3
v2 --"wikibase:quantityUnit"--> v4
v5 --"p:direct/P5137"--> v4
v6 --"ontolex:sense"--> v5
v6 --"dct:language"--> c8
v6 --"ontolex:lexicalForm"--> v7
v7 --"wikibase:grammaticalFeature"--> c11
v7 --"wikibase:grammaticalFeature"--> c12
v7 --"ontolex:representation"--> v8
v6 --"ontolex:lexicalForm"--> v9
v9 --"wikibase:grammaticalFeature"--> c14
v9 --"wikibase:grammaticalFeature"--> c12
v9 --"ontolex:representation"--> v10
bind1[/"if(?elev = '1^^xsd:integer',?prepr_1,?prepr_2)"/]
v3 --o bind1
v8 --o bind1
v10 --o bind1
bind1 --as--o v11
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c16 --"wikibase:language"--> c18
end