Consommation des avions

De ESCR
Aller à la navigation Aller à la recherche

Cette page sert à afficher le nombre d'avions produits par chaque pays.

Objectif

Aujourd'hui, les constructeurs d'avions ne cessent de produire de nouveaux types d'avions (Boeing,Airbus ...), ces derniers peuvent varier selon la taille, le but (commercial, indistruel ...) et leur consommations. Cependant, cela impacte notre environnement écologique.

Le but principal de cette application est de montrer les pays qui ont produis le plus d'avions.

Définition de votre graphe de connaissances

Schema

Diagramme de classes ou modèle RDF (comme vue en cours)

Schéma RDF

Vocabulaire

Base

BASE <https://data.escr.fr/wiki/Consommation_des_avions#>

Préfixes

PREFIX ex: <http://www.example.org/>
PREFIX bd: <http://www.bigdata.com/rdf#> 
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
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 xsd: <http://www.w3.org/2001/XMLSchema#>

Classes

Aircraft
<Aircraft> rdf:type rdfs:Class .
Airplane
<Airplane> rdf:type rdfs:Class .
<Airplane> rdfs:subClassOf <Aircraft>.
Engine
<Engine> rdf:type rdfs:Class .
<Engine> rdfs:subClassOf <Airplane>.

Propriétés

country
<country> rdf:type rdf:Property.
  • Cette propriété définit le pays de fabrication de l'avion.
poweredBy
<poweredBy> rdf:type rdf:Property;
            rdfs:domain <Engine>.
  • Cette propriété définit le moteur de l'avion.
consumption
<consumption> rdf:type rdf:Property.
  • Cette propriété définit la consommation du moteur de l'avion.

Exemple d'un jeu de données

wd:Q2107964 <consumption> "22.1"^^xsd:decimal .

Requêtes

A retester lundi :

BASE <https://data.escr.fr/wiki/Consommation_des_avions#>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX bd: <http://www.bigdata.com/rdf#> 
PREFIX wikibase: <http://wikiba.se/ontology#> 
PREFIX wdt: <http://www.wikidata.org/prop/direct/> 
PREFIX wd: <http://www.wikidata.org/entity/>

select ?avion  ?imageAvion ?imageMotor 
		?avionLabel ?countryLabel ?avionDescription
where {
  ?motor <consumption> ?consommation .
  
    SERVICE <https://query.wikidata.org/sparql> {
       ?avion wdt:P31/wdt:P279* wd:Q15056993 ;
              wdt:P516 ?motor .
      
      OPTIONAL {
			?avion rdfs:label ?avionLabel .
        	FILTER (langMatches(lang(?avionLabel), "en"))	
      }
      OPTIONAL {
			?avion rdfs:label ?avionDescription .
        	FILTER (langMatches(lang(?avionDescription), "en"))	
      }

      OPTIONAL {
			?avion wdt:P18 ?imageAvion .
        }
      OPTIONAL {
			?avion wdt:P495 ?country .
			?country rdfs:label ?countryLabel .
        	FILTER (langMatches(lang(?countryLabel), "en"))	
        }
      OPTIONAL {
        	?motor  wdt:P176 ?manufacturer  .
        }
        OPTIONAL {
	  		?motor  wdt:P18 ?imageMotor .
        }
    }
} 
LIMIT 100
# colstyle=col1_img_max-width:150px;col2_img_max-width:150px

Vérification que le vocabulaire est bien chargé :

Démonstration

width=50