sparql:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?department WHERE {
  <http://ld.company.org/prod-instances/dept-73191> rdfs:label ?department .
}


sparql:
SELECT DISTINCT ?phone WHERE {
  <http://ld.company.org/prod-instances/empl-Baldwin.Dirksen%40company.org> <http://ld.company.org/prod-vocab/phone> ?phone .
}


sparql:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?manager ?managerLabel WHERE {
  BIND(<http://ld.company.org/prod-instances/empl-Waldtraud.Kuttner%40company.org> AS ?manager)
  OPTIONAL { ?manager rdfs:label ?managerLabel }
}


sparql:
SELECT DISTINCT ?email WHERE {
  <http://ld.company.org/prod-instances/empl-Sabrina.Geiger%40company.org> <http://ld.company.org/prod-vocab/email> ?email .
}


sparql:
PREFIX prod-vocab: <http://ld.company.org/prod-vocab/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?agent ?agentLabel WHERE {
  ?agent prod-vocab:areaOfExpertise <http://ld.company.org/prod-instances/prod-cat-Transistor> .
  OPTIONAL { ?agent rdfs:label ?agentLabel . }
}


sparql:
SELECT DISTINCT ?agent ?agentName WHERE {
  ?agent <http://ld.company.org/prod-vocab/areaOfExpertise> <http://ld.company.org/prod-instances/prod-cat-Sensor> .
  OPTIONAL { ?agent <http://www.w3.org/2000/01/rdf-schema#label> ?agentName . }
}


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vocab: <http://ld.company.org/prod-vocab/>

SELECT DISTINCT ?manager WHERE {
  ?manager rdf:type vocab:Employee .
  ?manager vocab:responsibleFor <http://ld.company.org/prod-instances/dept-41622> .
}


sparql:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?department ?departmentLabel WHERE {
  VALUES ?department { <http://ld.company.org/prod-instances/dept-41622> }
  OPTIONAL { ?department rdfs:label ?departmentLabel }
}


sparql:
SELECT DISTINCT ?product ?name
WHERE {
  ?product <http://ld.company.org/prod-vocab/name> ?name .
  FILTER(CONTAINS(LCASE(?name), "sensor switch"))
}


sparql:
PREFIX prod-vocab: <http://ld.company.org/prod-vocab/>
PREFIX dept-inst: <http://ld.company.org/prod-instances/>

SELECT DISTINCT ?employee ?name WHERE {
  ?employee a prod-vocab:Employee .
  ?employee prod-vocab:memberOf dept-inst:dept-85880 .
  ?employee prod-vocab:areaOfExpertise ?expertise .
  ?expertise prod-vocab:name ?expertiseName .
  ?employee prod-vocab:name ?name .
  FILTER(CONTAINS(LCASE(?expertiseName), "network"))
}


sparql:
SELECT DISTINCT ?department
WHERE {
  ?employee a <http://ld.company.org/prod-vocab/Employee> .
  ?employee <http://ld.company.org/prod-vocab/areaOfExpertise> <http://ld.company.org/prod-instances/prod-cat-Transducer> .
  ?employee <http://ld.company.org/prod-vocab/memberOf> ?department .
}


sparql:
SELECT DISTINCT ?supplier ?supplierLabel WHERE {
  ?product <http://ld.company.org/prod-vocab/hasCategory> <http://ld.company.org/prod-instances/prod-cat-Compensator> .
  ?product <http://ld.company.org/prod-vocab/hasSupplier> ?supplier .
  OPTIONAL { ?supplier <http://www.w3.org/2000/01/rdf-schema#label> ?supplierLabel }
}


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT (COUNT(*) AS ?count) WHERE {
    ?supplier rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Supplier> ;
              <http://ld.company.org/prod-vocab/addressCountry> "France" .
  }


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX prod: <http://ld.company.org/prod-vocab/>
PREFIX prodInst: <http://ld.company.org/prod-instances/>

SELECT DISTINCT ?supplier WHERE {
  ?product prod:hasSupplier ?supplier .
  ?product rdf:type ?productType .
  ?productType rdfs:subClassOf* prodInst:prod-cat-Compensator .
  ?supplier prod:country <http://dbpedia.org/resource/France> .
}


sparql:
PREFIX prod: <http://ld.company.org/prod-vocab/>
PREFIX prodInst: <http://ld.company.org/prod-instances/>
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?encoder ?encoderLabel ?supplier ?supplierLabel ?priceValue WHERE {
  ?encoder prod:hasCategory prodInst:prod-cat-Encoder .
  ?encoder prod:hasSupplier ?supplier .
  ?supplier prod:country ?country .
  FILTER(?country IN (dbpedia:France, dbpedia:Germany))
  ?encoder prod:price ?price .
  ?price prod:amount ?priceValue .
  OPTIONAL { ?encoder rdfs:label ?encoderLabel . }
  OPTIONAL { ?supplier rdfs:label ?supplierLabel . }
} ORDER BY ASC(xsd:decimal(?priceValue)) LIMIT 1


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX prod: <http://ld.company.org/prod-vocab/>

ASK {
  ?supplier rdf:type prod:Supplier .
  ?supplier prod:addressLocality "Toulouse" .
}


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX prod-vocab: <http://ld.company.org/prod-vocab/>

SELECT DISTINCT ?supplier ?name WHERE {
  ?supplier rdf:type/rdfs:subClassOf* prod-vocab:Supplier .
  ?supplier prod-vocab:addressLocality "Toulouse" .
  OPTIONAL { ?supplier prod-vocab:name ?name }
}


sparql:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX prod: <http://ld.company.org/prod-vocab/>

SELECT DISTINCT ?product ?label WHERE {
  BIND(<http://ld.company.org/prod-instances/hw-F388-7030185> AS ?product)
  OPTIONAL { ?product rdfs:label ?label }
}


sparql:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?service ?label WHERE {
  BIND(<http://ld.company.org/prod-instances/srv-D215-3449390> AS ?service)
  ?service rdfs:label ?label .
}


sparql:
PREFIX prod: <http://ld.company.org/prod-vocab/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?service ?serviceLabel ?person ?personLabel WHERE {
  ?service a prod:Service .
  ?service prod:price ?price .
  ?service prod:hasProductManager ?person .
  OPTIONAL { ?service rdfs:label ?serviceLabel }
  OPTIONAL { ?person rdfs:label ?personLabel }
}
ORDER BY DESC(?price)
LIMIT 1


sparql:
PREFIX prod: <http://ld.company.org/prod-vocab/>
PREFIX prodinst: <http://ld.company.org/prod-instances/>

SELECT DISTINCT ?coil
WHERE {
  ?coil prod:hasCategory prodinst:prod-cat-Coil .
}
LIMIT 5


sparql:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?product ?productLabel WHERE {
  <http://ld.company.org/prod-instances/hw-U990-5234138> <http://ld.company.org/prod-vocab/compatibleProduct> ?product .
  OPTIONAL { ?product rdfs:label ?productLabel . }
}


sparql:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?product ?productLabel WHERE {
  VALUES ?product {
    <http://ld.company.org/prod-instances/hw-A360-3041803>
    <http://ld.company.org/prod-instances/hw-A509-5571891>
  }
  ?product rdfs:label ?productLabel .
}


sparql:
PREFIX prod: <http://ld.company.org/prod-vocab/>

SELECT DISTINCT ?potentiometer ?name
WHERE {
  BIND(<http://ld.company.org/prod-instances/hw-I893-5009730> AS ?potentiometer) .
  ?potentiometer prod:name ?name .
}


sparql:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX prod-vocab: <http://ld.company.org/prod-vocab/>

SELECT DISTINCT ?coil ?label ?weight ?depth ?height ?width ((?weight / (?depth * ?height * ?width)) AS ?density) WHERE {
  BIND(<http://ld.company.org/prod-instances/hw-N832-1055352> AS ?coil)
  OPTIONAL { ?coil rdfs:label ?label }
  ?coil prod-vocab:weight_g ?weight .
  ?coil prod-vocab:depth_mm ?depth .
  ?coil prod-vocab:height_mm ?height .
  ?coil prod-vocab:width_mm ?width .
} LIMIT 1


sparql:
PREFIX prod: <http://ld.company.org/prod-vocab/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT DISTINCT ?city WHERE {
  ?product rdf:type <http://ld.company.org/prod-instances/prod-cat-LCD> .
  ?product prod:hasSupplier ?supplier .
  ?supplier rdf:type prod:Supplier .
  ?supplier prod:addressCountry "United States" .
  ?supplier prod:addressLocality ?city .
}


sparql:
PREFIX vocab: <http://ld.company.org/prod-vocab/>

SELECT DISTINCT ?employee ?name ?email ?phone WHERE {
  ?employee a vocab:Employee .
  ?employee vocab:name ?name .
  OPTIONAL { ?employee vocab:email ?email . }
  OPTIONAL { ?employee vocab:phone ?phone . }

  FILTER NOT EXISTS {
    ?otherEmployee vocab:hasManager ?employee .
  }
}
ORDER BY ?name


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?service ?serviceLabel WHERE {
  ?service rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Service> .
  OPTIONAL { ?service rdfs:label ?serviceLabel }
} LIMIT 5


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?supplier ?supplierName ?supplierCountry ?price WHERE {
  ?hardware rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Hardware> .
  ?hardware <http://ld.company.org/prod-vocab/price> ?price .
  ?hardware <http://ld.company.org/prod-vocab/hasSupplier> ?supplier .
  ?supplier <http://ld.company.org/prod-vocab/name> ?supplierName .
  ?supplier <http://ld.company.org/prod-vocab/country> ?supplierCountry .
}
ORDER BY DESC(?price)
OFFSET 5
LIMIT 5


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?department ?departmentName (COUNT(*) AS ?numEmployees) WHERE {
  ?agent <http://ld.company.org/prod-vocab/memberOf> ?department .
  ?department rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Department> .
  ?department rdfs:label ?departmentName .
}
GROUP BY ?department ?departmentName
HAVING (COUNT(*) > 5)


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?category ?categoryLabel ?minWeightHardware ?minWeightHardwareLabel ?maxWeightHardware ?maxWeightHardwareLabel ?minWeight ?maxWeight WHERE {
  {
    SELECT DISTINCT ?category (MIN(?weight) AS ?minWeight) (MAX(?weight) AS ?maxWeight) WHERE {
      ?hardware rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Hardware> .
      ?hardware <http://ld.company.org/prod-vocab/hasCategory> ?category .
      ?hardware <http://ld.company.org/prod-vocab/weight_g> ?weight .
    } GROUP BY ?category
  }
  ?minWeightHardware rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Hardware> ;
                    <http://ld.company.org/prod-vocab/hasCategory> ?category ;
                    <http://ld.company.org/prod-vocab/weight_g> ?minWeight .
  ?maxWeightHardware rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Hardware> ;
                    <http://ld.company.org/prod-vocab/hasCategory> ?category ;
                    <http://ld.company.org/prod-vocab/weight_g> ?maxWeight .
  OPTIONAL { ?category rdfs:label ?categoryLabel }
  OPTIONAL { ?minWeightHardware rdfs:label ?minWeightHardwareLabel }
  OPTIONAL { ?maxWeightHardware rdfs:label ?maxWeightHardwareLabel }
}


sparql:
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

PREFIX prod: <http://ld.company.org/prod-vocab/>
SELECT DISTINCT ?supplier (ROUND(AVG(xsd:decimal(?amount))) AS ?averagePriceEUR)
WHERE {
  ?product prod:hasSupplier ?supplier .
  ?product prod:price ?priceEntity .
  ?priceEntity prod:currency "EUR" .
  ?priceEntity prod:amount ?amount .
}
GROUP BY ?supplier


sparql:
PREFIX ld: <http://ld.company.org/prod-vocab/>

ASK WHERE {
  ?emp ld:memberOf ?dept .
  FILTER NOT EXISTS {
    ?otherEmp ld:hasManager ?emp .
  }
}


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?supplier ?name ?addressLocality ?addressCountry ?addressCountryCode WHERE {
    ?supplier rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Supplier> .
    OPTIONAL { ?supplier <http://ld.company.org/prod-vocab/name> ?name } .
    OPTIONAL { ?supplier <http://ld.company.org/prod-vocab/addressLocality> ?addressLocality } .
    OPTIONAL { ?supplier <http://ld.company.org/prod-vocab/addressCountry> ?addressCountry } .
    OPTIONAL { ?supplier <http://ld.company.org/prod-vocab/addressCountryCode> ?addressCountryCode } .
  }


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?product ?compatibleProduct ?priceProduct ?priceCompatibleProduct ?priceDifference WHERE {
  ?product rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Product> .
  ?product <http://ld.company.org/prod-vocab/compatibleProduct> ?compatibleProduct .
  ?product <http://ld.company.org/prod-vocab/price> ?priceProductEntity .
  ?compatibleProduct <http://ld.company.org/prod-vocab/price> ?priceCompatibleEntity .
  ?priceProductEntity <http://ld.company.org/prod-vocab/amount> ?priceProduct .
  ?priceCompatibleEntity <http://ld.company.org/prod-vocab/amount> ?priceCompatibleProduct .
  BIND(?priceProduct - ?priceCompatibleProduct AS ?priceDifference)
}


sparql:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX prod: <http://ld.company.org/prod-vocab/>

SELECT DISTINCT ?agent WHERE {
  ?agent rdf:type/rdfs:subClassOf* prod:Agent .
}
LIMIT 5


sparql:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT DISTINCT ?bom (COUNT(*) AS ?numberOfParts) (SUM(xsd:integer(?quantity)) AS ?totalQuantity)
WHERE {
  ?bom rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/BillOfMaterial> .
  ?bom <http://ld.company.org/prod-vocab/hasBomPart> ?bomPart .
  ?bomPart <http://ld.company.org/prod-vocab/quantity> ?quantity .
}
GROUP BY ?bom
HAVING (SUM(xsd:integer(?quantity)) > 600)
ORDER BY DESC(?totalQuantity)


sparql:
PREFIX prod: <http://ld.company.org/prod-vocab/>
SELECT DISTINCT ?employee ?name WHERE {
  ?employee a prod:Employee .
  ?employee prod:name ?name .
}
LIMIT 5


sparql:
PREFIX prod: <http://ld.company.org/prod-vocab/>

SELECT DISTINCT ?hardware ?width ?height ?depth WHERE {
  ?hardware a prod:Hardware ;
            prod:width_mm ?width ;
            prod:height_mm ?height ;
            prod:depth_mm ?depth .
  FILTER(?width > ?height && ?depth < 50)
}


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?hardware ?hardwareId ?hardwareName WHERE {
  ?hardware rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Hardware> .
  ?hardware <http://ld.company.org/prod-vocab/id> ?hardwareId .
  ?hardware <http://ld.company.org/prod-vocab/name> ?hardwareName .
  FILTER NOT EXISTS {
    ?hardware <http://ld.company.org/prod-vocab/hasProductManager> ?pm .
  }
}


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?manager
       (COUNT(*) AS ?teamSize)
       (COUNT(*) AS ?sameDeptCount)
       ((COUNT(*)*1.0 / COUNT(*)) AS ?percentageSameDept)
WHERE {
  ?manager rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Manager> .
  ?employee <http://ld.company.org/prod-vocab/hasManager> ?manager .
  ?manager <http://ld.company.org/prod-vocab/memberOf> ?managerDept .
  ?employee <http://ld.company.org/prod-vocab/memberOf> ?employeeDept .

  OPTIONAL {
    FILTER(?managerDept = ?employeeDept)
    BIND(?employee AS ?employeeSameDept)
  }
}
GROUP BY ?manager


sparql:
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX prod: <http://ld.company.org/prod-vocab/>

SELECT DISTINCT ?bom (AVG(xsd:decimal(?amount)) AS ?avgUnitCost) WHERE {
  ?bom rdf:type/rdfs:subClassOf* prod:BillOfMaterial .
  ?bom prod:hasBomPart ?bomPart .
  ?bomPart prod:hasPart ?product .
  ?product rdf:type/rdfs:subClassOf* prod:Hardware .
  ?product prod:price ?price .
  ?price prod:amount ?amount .
}
GROUP BY ?bom
ORDER BY DESC(?avgUnitCost)
LIMIT 1


sparql:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?productA ?productALabel ?productB ?productBLabel WHERE {
  ?productA <http://ld.company.org/prod-vocab/compatibleProduct> ?productB .
  ?productB <http://ld.company.org/prod-vocab/compatibleProduct> ?productA .
  FILTER(?productA < ?productB)
  OPTIONAL { ?productA rdfs:label ?productALabel }
  OPTIONAL { ?productB rdfs:label ?productBLabel }
}


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?hardware ?id ?name ?width WHERE {
  ?hardware rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Hardware> .
  ?hardware <http://ld.company.org/prod-vocab/width_mm> ?width .
  ?hardware <http://ld.company.org/prod-vocab/id> ?id .
  ?hardware <http://ld.company.org/prod-vocab/name> ?name .
  FILTER (?width >= 80)
}
ORDER BY DESC(?width)


sparql:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?supplier ?supplierLabel WHERE {
  VALUES ?supplier { <http://ld.company.org/prod-instances/suppl-445081d6-305c-4fb7-b89e-82c86969d4bd> }
  OPTIONAL { ?supplier rdfs:label ?supplierLabel }
}


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX prod: <http://ld.company.org/prod-vocab/>

SELECT DISTINCT ?supplier (AVG(?reliability) AS ?avgReliability) WHERE {
  ?product prod:hasSupplier ?supplier .
  ?product prod:reliabilityIndex ?reliability .
} GROUP BY ?supplier
ORDER BY DESC(?avgReliability)
LIMIT 5


sparql:
SELECT DISTINCT ?country WHERE {
  <http://ld.company.org/prod-instances/bom-17> <http://ld.company.org/prod-vocab/hasBomPart> ?bomPart .
  ?bomPart <http://ld.company.org/prod-vocab/hasPart> ?part .
  ?part <http://ld.company.org/prod-vocab/hasSupplier> ?supplier .
  ?supplier <http://ld.company.org/prod-vocab/addressCountry> ?country .
}


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?bom WHERE {
  ?bom rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/BillOfMaterial> .
  ?bom <http://ld.company.org/prod-vocab/hasBomPart> ?bomPart .
  ?bomPart <http://ld.company.org/prod-vocab/hasPart> ?product .
  ?product <http://ld.company.org/prod-vocab/hasSupplier> ?supplier .
  ?supplier <http://ld.company.org/prod-vocab/addressCountry> "Poland" .
}


sparql:
SELECT DISTINCT (COUNT(DISTINCT ?supplier) AS ?supplierCount) WHERE {
  <http://ld.company.org/prod-instances/hw-K367-1320550> <http://ld.company.org/prod-vocab/compatibleProduct> ?compatibleProduct .
  ?compatibleProduct <http://ld.company.org/prod-vocab/hasSupplier> ?supplier .
}


sparql:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?department ?departmentLabel (COUNT(*) AS ?productCount) WHERE {
  ?department rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Department> .
  ?department <http://ld.company.org/prod-vocab/responsibleFor> ?product .
  ?product rdf:type/rdfs:subClassOf* <http://ld.company.org/prod-vocab/Product> .
  OPTIONAL { ?department rdfs:label ?departmentLabel }
}
GROUP BY ?department ?departmentLabel
ORDER BY DESC(?productCount)
LIMIT 1