What is the {vehicle model} with the {MAX(shelf life)} whose {subclass of} is {spacecraft}  ?
Name the subclass model of spaceship with the greatest service life.
What subclass model of spaceship has the longest shelf life?
SELECT ?v WHERE { ?v rdf:type ontology:spacecraft . ?v property:shelf_life ?o . ?v rdf:type ontology:vehicle_model }
select ?ent where {
?ent <http://www.wikidata.org/entity/P31> <http://wikidata.dbpedia.org/resource/Q29048322>.

?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/P4218>.
?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/P279> .
?statement2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <http://wikidata.dbpedia.org/resource/Q40218> .

}
ORDER BY DESC(?obj1)
LIMIT 5
select ?ent where { ?ent wdt:P31 wd:Q29048322 . ?ent wdt:P4218 ?obj . ?ent wdt:P279 wd:Q40218 } ORDER BY DESC(?obj)LIMIT 5 