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

SELECT ?customer ?customerName ?industry ?routeName ?repeatPurchaseCount ?quoteWinRate
       ?overdueDays ?notificationRequirement ?documentRequirement ?exceptionResponseRequirement
       ?customerPriceSensitivity ?customerTimeSensitivity ?customerReliabilitySensitivity
WHERE {
  ?customer a/rdfs:subClassOf* gesli:Customer ;
            rdfs:label ?customerName .
  OPTIONAL {
    ?customer gesli:hasTradeProfile ?tradeProfile .
    OPTIONAL { ?tradeProfile gesli:industry ?industry . }
    OPTIONAL { ?tradeProfile gesli:routeName ?routeName . }
    OPTIONAL { ?tradeProfile gesli:repeatPurchaseCount ?repeatPurchaseCount . }
    OPTIONAL { ?tradeProfile gesli:quoteWinRate ?quoteWinRate . }
    OPTIONAL { ?tradeProfile gesli:customerPriceSensitivity ?customerPriceSensitivity . }
    OPTIONAL { ?tradeProfile gesli:customerTimeSensitivity ?customerTimeSensitivity . }
    OPTIONAL { ?tradeProfile gesli:customerReliabilitySensitivity ?customerReliabilitySensitivity . }
  }
  OPTIONAL {
    ?customer gesli:hasCreditProfile ?creditProfile .
    OPTIONAL { ?creditProfile gesli:overdueDays ?overdueDays . }
  }
  OPTIONAL {
    ?customer gesli:hasServiceProfile ?serviceProfile .
    OPTIONAL { ?serviceProfile gesli:notificationRequirement ?notificationRequirement . }
    OPTIONAL { ?serviceProfile gesli:documentRequirement ?documentRequirement . }
    OPTIONAL { ?serviceProfile gesli:exceptionResponseRequirement ?exceptionResponseRequirement . }
  }
}
ORDER BY ?customerName

