Get the class landscape of an ontology as SVG
has assertion: assertion
has provenance: provenance
has publication info: pubinfo
type: Nanopublication
created: 2026-08-26T09:30:34Z
creator: Tobias Kuhn
license: https://creativecommons.org/publicdomain/zero/1.0/
embeds: Get the class landscape of an ontology as SVG

Get the class landscape of an ontology as SVG
description: Renders the classes of the given ontology or vocabulary as an inline SVG figure: an Euler ('Venn-style') diagram in which every class is one small dot, positioned by which of three sets it belongs to and coloured by its chemical group. The three sets are: whether the class sits in a chemical group (it declares an rdfs:subClassOf other than the vocabulary's top class peh:BioChemEntity), whether it carries a metabolite or isomer link (peh:isMetaboliteOf / peh:isIsomerOf), and whether it has a chemical role (obo:RO_0000087). The three sets are drawn as overlapping rounded rectangles rather than circles, so that each of the resulting regions holds an exactly aligned grid of dots; a class in none of the three sets sits in the surrounding 'universe' frame. Each region is annotated with its own count, each set with its total, and the frame with the overall total. Every dot is a link to the class's part page and carries an SVG title element, so hovering shows the class label together with its group, its metabolite/isomer link and its role identifiers, and clicking opens it. Dot colour encodes the eight largest chemical groups (ranked by number of member classes, resolved at query time rather than hard-coded), with separate shades for a smaller named group and for no group at all; the legend is generated from the same ranking. The class set is exactly the one shown by the 'Get the approved classes of an ontology from space members' query and the corresponding view: the latest non-invalidated definition per class, published by an admin, maintainer or member of the maintaining space, not withdrawn, and approved either explicitly or via the auto-approved helper role. Positions are computed as absolute coordinates from rank sub-selects (the number of same-region classes sorting before this one, by label then URI), never from the order of a group_concat, which RDF4J does not preserve. The colour rank is looked up from a single-row string table rather than joined, because an OPTIO…
license: LICENSE-2.0
type: grlc-query
sparql: 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 gen: <https://w3id.org/kpxl/gen/terms/> prefix peh: <https://w3id.org/peh/terms/> prefix obo: <http://purl.obolibrary.org/obo/> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> select ?svg where { { select (group_concat(?block; separator="") as ?body) (sum(?rcount) as ?total) (sum(if(substr(?region, 1, 1) = "1", ?rcount, 0)) as ?nGroup) (sum(if(substr(?region, 2, 1) = "1", ?rcount, 0)) as ?nLink) (sum(if(substr(?region, 3, 1) = "1", ?rcount, 0)) as ?nRole) where { { select ?region ?x0 ?y0 ?cols (count(?class) as ?rcount) (group_concat(?dot; separator="") as ?dots) where { { select ?class ?label ?region ?parent ?roleIds ?parentLabel (count(?o2) - 1 as ?rank) where { { select ?class ?label ?region ?parent (min(?sortkey_) as ?sortkey) (group_concat(distinct ?roleShort; separator=", ") as ?roleIds) (min(?parentLabel_) as ?parentLabel) where { values ?_ontology_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } values ?_ontology_multi_iri {} graph ?stateG { ?_ontology_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np npx:hasNanopubType owl:Class ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:introduces ?class ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } filte…

sig
has algorithm: RSA
signed by: Tobias Kuhn