PREFIX gesli: <https://gesli.example/ontology#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?brandName ?productName ?routeType ?originLocation ?destinationLocation
       ?etdAtdOnTimeRate ?etaAtaOnTimeRate ?scheduleDelayRate
       ?scheduleChangeRate ?routeChangeRate
       ?averageDepartureDelayHours ?averageArrivalDelayHours
WHERE {
  ?product a/rdfs:subClassOf* gesli:ServiceProduct ;
           gesli:productName ?productName ;
           gesli:routeType ?routeType ;
           gesli:originLocation ?originLocation ;
           gesli:destinationLocation ?destinationLocation ;
           gesli:hasProductPerformanceProfile ?performance .

  OPTIONAL {
    ?product gesli:hasServiceBrand ?brand .
    ?brand gesli:brandName ?brandName .
  }
  OPTIONAL { ?performance gesli:etdAtdOnTimeRate ?etdAtdOnTimeRate . }
  OPTIONAL { ?performance gesli:etaAtaOnTimeRate ?etaAtaOnTimeRate . }
  OPTIONAL { ?performance gesli:scheduleDelayRate ?scheduleDelayRate . }
  OPTIONAL { ?performance gesli:scheduleChangeRate ?scheduleChangeRate . }
  OPTIONAL { ?performance gesli:routeChangeRate ?routeChangeRate . }
  OPTIONAL { ?performance gesli:averageDepartureDelayHours ?averageDepartureDelayHours . }
  OPTIONAL { ?performance gesli:averageArrivalDelayHours ?averageArrivalDelayHours . }
}
ORDER BY ?brandName ?productName
