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

BASE <https://saref.etsi.org/documentation/>

SELECT <getClasses.rqg>() ?class
WHERE {
  {?class a owl:Class} UNION {?class a rdfs:Class}
  FILTER( ISURI(?class) ) 
} ORDER BY ?class 