Get all ontology terms (owl:class) from HPO ontology

Database: 
Statement: 

Get all ontology terms (owl:class) from HPO ontology

Query: 
PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT ?root ?label FROM <http://bioportal.bioontology.org/ontologies/HP> WHERE { ?root a owl:Class . ?root rdfs:label ?label . OPTIONAL { ?root rdfs:subClassOf ?super } } limit 10000