This query returns all classes that are part of a given version of an ontology.
prefix owl: <http://www.w3.org/2002/07/owl#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?class ?label (?definition as ?description) (?termNp as ?np) where { graph npa:graph { ?_ontologyVersionNp_iri npx:introduces ?ontologyVersion . ?_ontologyVersionNp_iri np:hasAssertion ?ontologyVersionNpA . } graph ?ontologyVersionNpA { ?ontologyVersion a owl:Ontology . ?ontologyVersion gen:hasContentIndex ?contentIndex . } graph npa:graph { ?contentIndex np:hasAssertion ?contentIndexA . } graph ?contentIndexA { ?contentIndex npx:includesElement ?termNp . } graph npa:graph { } graph npa:graph { ?termNp dct:created ?date . ?termNp npx:introduces ?class . ?termNp np:hasAssertion ?termNpA . } graph ?termNpA { ?class dct:partOf ?_ontology_multi_iri . optional { ?class rdfs:label ?label . } optional { ?class skos:definition ?definition . } } } order by ?label