What is the {locomotive class} with the {MAX(stroke)} whose {operator} is {Lancashire, Derbyshire and East Coast Railway}  ?
What locomotive class has the most stroke operated by Lancashire, Derbyshire and East Coast Railway?
What is the locomotive class with the most stroke whose operator is Lancashire, Derbyshire and East Coast Railway?
SELECT ?x WHERE { ?x property:stroke ?h . ?x property:operator resource:Lancashire,_Derbyshire_and_East_Coast_Railway . ?x rdf:type ontology:locomotive_class }
select ?ent where {
?ent <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q19832486>.

?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?ent .
?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P2557>.
?statement1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj1.

?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> ?ent .
?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <http://www.wikidata.org/entity/P137> .
?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q6482976> .

}
ORDER BY DESC(?obj1)
LIMIT 5
select ?ent where { ?ent wdt:P31 wd:Q19832486 . ?ent wdt:P2557 ?obj . ?ent wdt:P137 wd:Q6482976 } ORDER BY DESC(?obj)LIMIT 5 
LD&ECR Class A LD&ECR Class D LD&ECR Class B LD&ECR Class C