Created
November 25, 2019 17:49
-
-
Save mhoangvslev/735c33d99167a6ed0ea616067fb64a88 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX sfce: <https://mhoangvslev.linked.data.world/d/surface-forestire-mondiale-1990-2016/file/surface_forestiere> | |
PREFIX wd: <http://www.wikidata.org/entity> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
PREFIX dbo: <http://dbpedia.org/ontology> | |
PREFIX temp: <https://mhoangvslev.linked.data.world/d/earth-surface-temperature-data/file/temperature_surface.ttl> | |
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | |
PREFIX voc: <https://mmisw.org/ont/~mhoangvslev/SurfaceForestiereVoc/> | |
PREFIX bonheur: <https://mhoangvslev.linked.data.world/d/surface-forestire-mondiale-1990-2016/file/bonheur.ttl> | |
PREFIX dbp: <http://www.dbpedia.org/property/> | |
SELECT DISTINCT ?nomPays ?evolutionSurfaceForet ?evolutionTemp ?rankBonheur ?income | |
FROM sfce: | |
FROM NAMED temp: | |
FROM NAMED bonheur: | |
WHERE{ | |
GRAPH ?g{ | |
SELECT (UCASE(?country) as ?nomPays) ?evolutionTemp | |
WHERE{ | |
#?z dbpedia-owl:locationCountry ?country. | |
{ | |
SELECT DISTINCT ?country (avg(?temperature1990)AS ?avg_temp1990) | |
WHERE{ | |
?b dbpedia-owl:locationCountry ?country. | |
?b hto:Temperature ?temperature1990. | |
?b crm:E50_Date ?date1990. | |
BIND(year(xsd:date(?date1990)) as ?annee1990). | |
FILTER( xsd:integer(?annee1990) = 1990) | |
} | |
GROUP BY ?country ?annee1990 | |
}. | |
{ | |
SELECT DISTINCT ?country (avg(?temperature2013)AS ?avg_temp2013) | |
WHERE{ | |
?c dbpedia-owl:locationCountry ?country. | |
?c hto:Temperature ?temperature2013. | |
?c crm:E50_Date ?date2013. | |
BIND(year(xsd:date(?date2013)) as ?annee2013). | |
FILTER( xsd:integer(?annee2013) = 2013) | |
} | |
GROUP BY ?country ?annee2013 | |
}. | |
BIND((?avg_temp2013 - ?avg_temp1990) AS ?evolutionTemp). | |
} | |
}. | |
{ | |
?x voc:CountryName ?nomPays; | |
voc:Year ?1990; | |
voc:SurfaceForestiere ?surfaceForestiere1990. | |
?y voc:CountryName ?nomPays; | |
voc:Year ?2013; | |
voc:SurfaceForestiere ?surfaceForestiere2016; | |
voc:CountryIncomeGroup ?income. | |
BIND((?surfaceForestiere2016 - ?surfaceForestiere1990) AS ?evolutionSurfaceForet). | |
FILTER( xsd:integer(?1990) = 1990 && xsd:integer(?2013) = 2013). | |
}. | |
GRAPH ?g2{ | |
SELECT (UCASE(?country) as ?nomPays) ?rankBonheur | |
WHERE{ | |
?t dbp:name ?country. | |
?t dbp:rank ?rankBonheur | |
} | |
}. | |
} | |
GROUP BY ?nomPays ?evolutionSurfaceForet ?evolutionTemp ?rankBonheur ?income |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment