query-4ac16d7da291f2a866759ec33efc191d
Information sur les stations météo Request for update to update the stations on Wikidata (export the result in CSV format). MSC Weather Stations to WikidataRequest to be used as argument with the script Requête pour mise à jour pour la mise à jour des stations. MSC Weather Stations to WikidataFonctionne comme argument du le script
Use at
- https://query.wikidata.org/sparql
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX schema: <http://schema.org/>
# Information sur les stations météo du SMC
SELECT ?station ?label_en ?description_en ?label_fr ?description_fr ?instance_of ?coordinate_location ?province_label ?identifiant_WIGOS_de_station ?property_of ?start_date ?end_date ?msc_climate_id ?altitude ?data_interval ?hourly ?h_start ?h_end ?daily ?d_start ?d_end ?monthly ?m_start ?m_end WHERE {
?station (wdt:P31/wdt:P279*) wd:Q190107.
?station wdt:P17 wd:Q16.
?station wdt:P6242 ?MSCID
# Data interval (HLY, DLY, MLY)
OPTIONAL { ?station p:P6339 ?data_interval . }
OPTIONAL { ?station p:P6339 ?d_interval . # there is a P6339 property
?d_interval ps:P6339 wd:Q59657036 . # and it's a daily
?d_interval ps:P6339 ?daily . # and we get its value, in case there are no dates
OPTIONAL { ?d_interval pq:P580 ?d_start .} # might be a start date
OPTIONAL { ?d_interval pq:P582 ?d_end .} # might be an end date
}
OPTIONAL { ?station p:P6339 ?m_interval . # there is a P6339 property
?m_interval ps:P6339 wd:Q59657037 . # and it's monthly
?m_interval ps:P6339 ?monthly . # and we get its value, in case there are no dates
OPTIONAL { ?m_interval pq:P580 ?m_start .} # might be a start date
OPTIONAL { ?m_interval pq:P582 ?m_end .} # might be an end date
}
OPTIONAL { ?station p:P6339 ?h_interval . # there is a P6339 property
?h_interval ps:P6339 wd:Q59657010 . # and it's hourly
?h_interval ps:P6339 ?hourly . # and we get its value, in case there are no dates
OPTIONAL { ?h_interval pq:P580 ?h_start .} # might be a start date
OPTIONAL { ?h_interval pq:P582 ?h_end .} # might be an end date
}
OPTIONAL { ?station wdt:P31 ?instance_of. }
OPTIONAL { ?station wdt:P625 ?coordinate_location. }
OPTIONAL { ?station wdt:P131 ?province_label. }
OPTIONAL { ?station wdt:P4136 ?identifiant_WIGOS_de_station. }
OPTIONAL { ?station wdt:P127 ?property_of. }
OPTIONAL { ?station wdt:P729 ?start_date. }
OPTIONAL { ?station wdt:P3999 ?end_date. }
OPTIONAL { ?station wdt:P6242 ?msc_climate_id. }
OPTIONAL { ?station wdt:P2044 ?altitude. }
# FR/EN description
OPTIONAL { ?station rdfs:label ?label_en. }
OPTIONAL { ?station rdfs:label ?label_fr. }
OPTIONAL { ?station schema:description ?description_en. }
OPTIONAL { ?station schema:description ?description_fr. }
FILTER((LANG(?label_en)) = "en")
FILTER((LANG(?label_fr)) = "fr")
FILTER((LANG(?description_en)) = "en")
FILTER((LANG(?description_fr)) = "fr")
}
ORDER BY(?MSCID)
Query found at
- https://www.wikidata.org/wiki/User_talk:Dirac
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Weather_observations/SPARQL
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Weather_observations/en/SPARQL
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?MSCID")
v28("?altitude"):::projected
v21("?coordinate_location"):::projected
v11("?d_end"):::projected
v8("?d_interval")
v10("?d_start"):::projected
v9("?daily"):::projected
v7("?data_interval"):::projected
v3("?description_en"):::projected
v2("?description_fr"):::projected
v26("?end_date"):::projected
v19("?h_end"):::projected
v16("?h_interval")
v18("?h_start"):::projected
v17("?hourly"):::projected
v23("?identifiant_WIGOS_de_station"):::projected
v20("?instance_of"):::projected
v5("?label_en"):::projected
v4("?label_fr"):::projected
v15("?m_end"):::projected
v12("?m_interval")
v14("?m_start"):::projected
v13("?monthly"):::projected
v27("?msc_climate_id"):::projected
v24("?property_of"):::projected
v22("?province_label"):::projected
v25("?start_date"):::projected
v6("?station"):::projected
a1((" "))
c14(["wd:Q59657037"]):::iri
c11(["wd:Q59657036"]):::iri
c15(["wd:Q59657010"]):::iri
c7(["wd:Q16"]):::iri
c5(["wd:Q190107"]):::iri
f0[["?description_fr = 'fr'"]]
f0 --> v2
f1[["?description_en = 'en'"]]
f1 --> v3
f2[["?label_fr = 'fr'"]]
f2 --> v4
f3[["?label_en = 'en'"]]
f3 --> v5
v6 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c5
v6 --"p:direct/P17"--> c7
v6 --"p:direct/P6242"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:P6339".-> v7
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:P6339".-> v8
v8 --"p:statement/P6339"--> c11
v8 --"p:statement/P6339"--> v9
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v8 -."p:qualifier/P580".-> v10
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v8 -."p:qualifier/P582".-> v11
end
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:P6339".-> v12
v12 --"p:statement/P6339"--> c14
v12 --"p:statement/P6339"--> v13
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v12 -."p:qualifier/P580".-> v14
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v12 -."p:qualifier/P582".-> v15
end
end
subgraph optional7["(optional)"]
style optional7 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:P6339".-> v16
v16 --"p:statement/P6339"--> c15
v16 --"p:statement/P6339"--> v17
subgraph optional8["(optional)"]
style optional8 fill:#bbf,stroke-dasharray: 5 5;
v16 -."p:qualifier/P580".-> v18
end
subgraph optional9["(optional)"]
style optional9 fill:#bbf,stroke-dasharray: 5 5;
v16 -."p:qualifier/P582".-> v19
end
end
subgraph optional10["(optional)"]
style optional10 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:direct/P31".-> v20
end
subgraph optional11["(optional)"]
style optional11 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:direct/P625".-> v21
end
subgraph optional12["(optional)"]
style optional12 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:direct/P131".-> v22
end
subgraph optional13["(optional)"]
style optional13 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:direct/P4136".-> v23
end
subgraph optional14["(optional)"]
style optional14 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:direct/P127".-> v24
end
subgraph optional15["(optional)"]
style optional15 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:direct/P729".-> v25
end
subgraph optional16["(optional)"]
style optional16 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:direct/P3999".-> v26
end
subgraph optional17["(optional)"]
style optional17 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:direct/P6242".-> v27
end
subgraph optional18["(optional)"]
style optional18 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:direct/P2044".-> v28
end
subgraph optional19["(optional)"]
style optional19 fill:#bbf,stroke-dasharray: 5 5;
v6 -."rdfs:label".-> v5
end
subgraph optional20["(optional)"]
style optional20 fill:#bbf,stroke-dasharray: 5 5;
v6 -."rdfs:label".-> v4
end
subgraph optional21["(optional)"]
style optional21 fill:#bbf,stroke-dasharray: 5 5;
v6 -."schema:description".-> v3
end
subgraph optional22["(optional)"]
style optional22 fill:#bbf,stroke-dasharray: 5 5;
v6 -."schema:description".-> v2
end