rows { options { physical_type: PHYSICAL_STREAM_TYPE_QUADS max_name_table_size: 128 max_prefix_table_size: 16 max_datatype_table_size: 16 logical_type: LOGICAL_STREAM_TYPE_DATASETS version: 2 } } rows { prefix { value: "https://w3id.org/np/" } } rows { name { value: "RAoQjpzGU8R8VGQyjq2XgIZec5I_6wF-Qmf5uEFt0mRd4" } } rows { namespace { name: "this" value { prefix_id: 1 } } } rows { prefix { value: "https://w3id.org/np/RAoQjpzGU8R8VGQyjq2XgIZec5I_6wF-Qmf5uEFt0mRd4/" } } rows { name { } } rows { namespace { name: "sub" value { prefix_id: 2 } } } rows { prefix { value: "http://www.nanopub.org/nschema#" } } rows { namespace { name: "np" value { prefix_id: 3 name_id: 2 } } } rows { prefix { value: "http://purl.org/dc/terms/" } } rows { namespace { name: "dct" value { prefix_id: 4 name_id: 2 } } } rows { prefix { value: "https://w3id.org/np/o/ntemplate/" } } rows { namespace { name: "nt" value { prefix_id: 5 name_id: 2 } } } rows { prefix { value: "http://purl.org/nanopub/x/" } } rows { namespace { name: "npx" value { prefix_id: 6 name_id: 2 } } } rows { prefix { value: "http://www.w3.org/2001/XMLSchema#" } } rows { namespace { name: "xsd" value { prefix_id: 7 name_id: 2 } } } rows { prefix { value: "http://www.w3.org/2000/01/rdf-schema#" } } rows { namespace { name: "rdfs" value { prefix_id: 8 name_id: 2 } } } rows { prefix { value: "https://orcid.org/" } } rows { namespace { name: "orcid" value { prefix_id: 9 name_id: 2 } } } rows { prefix { value: "http://www.w3.org/ns/prov#" } } rows { namespace { name: "prov" value { prefix_id: 10 name_id: 2 } } } rows { prefix { value: "http://xmlns.com/foaf/0.1/" } } rows { namespace { name: "foaf" value { prefix_id: 11 name_id: 2 } } } rows { name { value: "hasAssertion" } } rows { name { value: "assertion" } } rows { name { value: "Head" } } rows { quad { s_iri { prefix_id: 1 name_id: 1 } p_iri { prefix_id: 3 name_id: 3 } o_iri { prefix_id: 2 } g_iri { } } } rows { name { value: "hasProvenance" } } rows { name { value: "provenance" } } rows { quad { p_iri { prefix_id: 3 } o_iri { prefix_id: 2 } } } rows { name { value: "hasPublicationInfo" } } rows { name { value: "pubinfo" } } rows { quad { p_iri { prefix_id: 3 } o_iri { prefix_id: 2 } } } rows { prefix { value: "http://www.w3.org/1999/02/22-rdf-syntax-ns#" } } rows { name { value: "type" } } rows { name { value: "Nanopublication" } } rows { quad { p_iri { prefix_id: 12 } o_iri { prefix_id: 3 } } } rows { name { value: "get-class-landscape-by-group-svg" } } rows { name { value: "description" } } rows { quad { s_iri { prefix_id: 2 } p_iri { prefix_id: 4 } o_literal { lex: "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 four sets it belongs to and colored by its chemical group. The four 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 is a metabolite of another entity (peh:isMetaboliteOf), whether it is an isomer of another entity (peh:isIsomerOf), and whether it has a role (obo:RO_0000087). Metabolite and isomer are disjoint in this data and every isomer is also in a chemical group, so the isomer set is drawn nested inside the chemical-group set; the sets are drawn as overlapping rounded rectangles rather than circles, so that each resulting region holds an exactly aligned grid of dots, and a class in none of the four sets sits in the surrounding \'universe\' frame. Each region is annotated with its own count and each set with its total. The eight largest chemical groups get their own color, ranked at query time by how many classes of the vocabulary they cover, with separate shades for a smaller one and for classes that have none; the legend is generated from the same ranking and gives each one\'s full size. Within every region the dots are ordered by that same ranking before being laid out, so classes sharing a chemical group form a contiguous run of one color rather than being scattered through the region. This query has a sibling that is identical except that it colors and orders by role instead, so the two can be shown side by side; there is also an earlier, denser variant (\'Get the class landscape of an ontology as SVG\') that subdivides the chemical-group and role sets into labelled sub-boxes instead of using color. 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 or isomer link and its role, and clicking opens it. 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 color rank then label then URI), never from the order of a group_concat, which RDF4J does not preserve, and the color rank is looked up from a single-row string table rather than joined, because an OPTIONAL around a sub-select does not reliably left-join on a key bound outside it. The figure carries no heading of its own, since the view it is shown in supplies the title, and its width is given as a percentage so that it fills the width of the panel it is shown in. It is intended for a gen:SvgView, which sanitises and embeds the markup; the SVG uses only the static element subset that survives that sanitisation." } g_iri { prefix_id: 2 name_id: 4 } } } rows { name { value: "license" } } rows { prefix { value: "http://www.apache.org/licenses/" } } rows { name { value: "LICENSE-2.0" } } rows { quad { p_iri { prefix_id: 4 name_id: 14 } o_iri { prefix_id: 13 } } } rows { prefix { value: "https://w3id.org/kpxl/grlc/" } } rows { name { value: "grlc-query" } } rows { quad { p_iri { prefix_id: 12 name_id: 10 } o_iri { prefix_id: 14 name_id: 16 } } } rows { name { value: "label" } } rows { quad { p_iri { prefix_id: 8 } o_literal { lex: "Get the class landscape of an ontology as SVG, colored by chemical group" } } } rows { name { value: "endpoint" } } rows { prefix { value: "https://w3id.org/np/l/nanopub-query-1.1/repo/type/" } } rows { name { value: "e8cc5bb29ec5597303f8f101c65c545dc124ee0df68ce733764b03adc3237184" } } rows { quad { p_iri { prefix_id: 14 } o_iri { prefix_id: 15 } } } rows { name { value: "sparql" } } rows { quad { p_iri { prefix_id: 14 } o_literal { lex: "prefix owl: \nprefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix gen: \nprefix peh: \nprefix obo: \nprefix foaf: \nprefix xsd: \n\nselect ?svg where {\n {\n select (group_concat(?cellBlock; separator=\"\") as ?body)\n (sum(?ccount) as ?total)\n (sum(if(contains(?sets, \"G\"), ?ccount, 0)) as ?nGroup)\n (sum(if(contains(?sets, \"M\"), ?ccount, 0)) as ?nMet)\n (sum(if(contains(?sets, \"I\"), ?ccount, 0)) as ?nIso)\n (sum(if(contains(?sets, \"R\"), ?ccount, 0)) as ?nRole) where {\n {\n select ?sets ?x0 ?y0 ?cols (count(?class) as ?ccount)\n (group_concat(?dot; separator=\"\") as ?dots) where {\n {\n select ?class ?label ?sets ?groupKey ?roleKey ?parentLabel ?ci (count(?o2) - 1 as ?rank) where {\n { select ?class ?label (?sets_ as ?sets) (?groupKey_ as ?groupKey) (?roleKey_ as ?roleKey)\n (?parentLabel_ as ?parentLabel) (?ci_ as ?ci) (min(?sortkey_) as ?sortkey) where {\n values ?_ontology_multi_iri {}\n service {\n select (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n values ?_ontology_multi_iri {}\n graph ?stateG {\n ?_ontology_multi_iri npa:isMaintainedBy? ?space .\n ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt .\n filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))\n ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk .\n }\n }\n }\n graph npa:graph {\n ?np npx:hasNanopubType owl:Class ; npa:hasValidSignatureForPublicKeyHash ?pubkey ;\n dct:created ?date ; npx:introduces ?class ; np:hasAssertion ?a .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n }\n filter(contains(?memberPubkeys, ?pubkey))\n graph ?a { ?class dct:isPartOf|dct:partOf ?_ontology_multi_iri . }\n filter not exists { graph ?a { ?class a gen:WithdrawnTerm } }\n filter not exists {\n graph npa:graph {\n ?np2 npx:hasNanopubType owl:Class ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ;\n dct:created ?date2 ; npx:introduces ?class ; np:hasAssertion ?a2 .\n filter not exists { ?np2x npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }\n }\n filter(contains(?memberPubkeys, ?pubkey2))\n graph ?a2 { ?class dct:isPartOf|dct:partOf ?_ontology_multi_iri . }\n filter(?date2 > ?date || (?date2 = ?date && str(?np2) > str(?np)))\n }\n {\n select (group_concat(distinct ?apV; separator=\" \") as ?approvedNps)\n (group_concat(distinct ?disV; separator=\" \") as ?disapprovedNps) where {\n {\n select ?vTarget (max(concat(str(?vDate), \">\", str(?vNp), \">\", ?vMark)) as ?vWin) where {\n values ?_ontology_multi_iri {}\n service {\n select (group_concat(?vpk; separator=\" \") as ?vMemberPubkeys) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?vStateG . }\n values ?_ontology_multi_iri {}\n graph ?vStateG {\n ?_ontology_multi_iri npa:isMaintainedBy? ?vSpace .\n ?vRi a gen:RoleInstantiation ; npa:forSpace ?vSpace ; npa:forAgent ?vMember ;\n npa:hasRoleType ?vRt .\n filter(?vRt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))\n ?vAcct a npa:AccountState ; npa:agent ?vMember ; npa:pubkey ?vpk .\n }\n }\n }\n service {\n select distinct ?vTarget ?vNp ?vDate ?vPubkey ?vMark where {\n graph npa:graph {\n ?vTarget npx:hasNanopubType owl:Class ; npx:signedBy ?targetAgent .\n ?vNp npx:signedBy ?vAgent ; npa:hasValidSignatureForPublicKeyHash ?vPubkey ;\n dct:created ?vDate ; np:hasAssertion ?vA .\n filter not exists { ?vInv npx:invalidates ?vNp ; npa:hasValidSignatureForPublicKeyHash ?vPubkey . }\n }\n graph ?vA { ?vAgent ?vPred ?vTarget . }\n values ?vPred { npx:approvesOf npx:disapprovesOf }\n filter(?vAgent != ?targetAgent)\n bind(if(?vPred = npx:approvesOf, \"a\", \"d\") as ?vMark)\n }\n }\n filter(contains(?vMemberPubkeys, ?vPubkey))\n } group by ?vTarget\n }\n bind(if(strends(?vWin, \"a\"), str(?vTarget), \"\") as ?apV)\n bind(if(strends(?vWin, \"d\"), str(?vTarget), \"\") as ?disV)\n }\n }\n {\n select (sample(?helperPubkeys_) as ?helperPubkeys) where {\n service {\n select (group_concat(?hpk; separator=\" \") as ?helperPubkeys_) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?hStateG . }\n values ?_ontology_multi_iri {}\n graph ?hStateG {\n ?_ontology_multi_iri npa:isMaintainedBy? ?hSpace .\n ?hRi a gen:RoleInstantiation ; npa:forSpace ?hSpace ; npa:forAgent ?hAgent ;\n gen:hasRole .\n ?hAcct a npa:AccountState ; npa:agent ?hAgent ; npa:pubkey ?hpk .\n }\n }\n }\n }\n }\n bind(contains(concat(\" \", ?approvedNps, \" \"), concat(\" \", str(?np), \" \")) as ?explicitApproved)\n bind(contains(concat(\" \", ?disapprovedNps, \" \"), concat(\" \", str(?np), \" \")) as ?explicitDisapproved)\n bind(contains(?helperPubkeys, ?pubkey) as ?isAutoApproved)\n filter(?explicitApproved || (?isAutoApproved && !?explicitDisapproved))\n optional { graph ?a { ?class rdfs:label ?label . filter(lang(?label) = \"\") } }\n optional { select ?class (min(str(?p)) as ?parent) where {\n values ?_ontology_multi_iri {}\n graph npa:graph { ?pnp npx:hasNanopubType owl:Class ; npx:introduces ?class ; np:hasAssertion ?pa . }\n graph ?pa { ?class dct:isPartOf|dct:partOf ?_ontology_multi_iri ; rdfs:subClassOf ?p .\n filter(?p != peh:BioChemEntity) }\n } group by ?class }\n bind(bound(?parent) as ?g)\n bind(exists { graph ?a { ?class peh:isMetaboliteOf|peh:isIsomerOf ?y } } as ?l)\n bind(exists { graph ?a { ?class obo:RO_0000087 ?ro } } as ?r)\n bind(concat(if(?g,\"1\",\"0\"), if(?l,\"1\",\"0\"), if(?r,\"1\",\"0\")) as ?region)\n optional { graph ?a { ?class obo:RO_0000087 ?roleIri . }\n bind(concat(\"CHEBI:\", replace(replace(str(?roleIri), \"^.*[/#]\", \"\"), \"^CHEBI[_:]\", \"\")) as ?roleKey_) }\n optional {\n select ?class (min(concat(str(?p), \" ~|~ \", coalesce(?pl, \"\"))) as ?parentCombo) where {\n values ?_ontology_multi_iri {}\n graph npa:graph { ?pnp npx:hasNanopubType owl:Class ; npx:introduces ?class ; np:hasAssertion ?pa .\n filter not exists { ?pgx npx:invalidates ?pnp } }\n graph ?pa { ?class dct:isPartOf|dct:partOf ?_ontology_multi_iri ; rdfs:subClassOf ?p .\n filter(?p != peh:BioChemEntity) }\n optional {\n graph npa:graph { ?plnp npx:hasNanopubType owl:Class ; npx:introduces ?p ; np:hasAssertion ?pla . }\n graph ?pla { ?p rdfs:label ?pl . filter(lang(?pl) = \"\") }\n }\n } group by ?class\n }\n bind(strbefore(?parentCombo, \" ~|~ \") as ?groupKey_)\n bind(strafter(?parentCombo, \" ~|~ \") as ?parentLabel_)\n bind(bound(?parentCombo) as ?fg)\n bind(exists { graph ?a { ?class peh:isMetaboliteOf ?y } } as ?fm)\n bind(exists { graph ?a { ?class peh:isIsomerOf ?z } } as ?fi)\n bind(bound(?roleKey_) as ?fr)\n bind(if(!?fg && !?fm && !?fi && !?fr, \"\",\n if(!?fg && ?fm && ?fr, \"MR\",\n if(!?fg && ?fm, \"M\",\n if(!?fg && ?fr, \"R\",\n if(?fg && ?fi, \"GI\",\n if(?fg && ?fm, \"GM\",\n if(?fg && ?fr, \"GR\", \"G\"))))))) as ?sets_)\n { select (group_concat(concat(\"[\", ?k, \">\", str(?idx), \"]\"); separator=\"\") as ?cTab) where { select ?k ?kn ?klabel (count(?k2) - 1 as ?idx) where {\n { select ?k (count(distinct ?lc) as ?kn) (min(?klab) as ?klabel) where {\n values ?_ontology_multi_iri {}\n graph npa:graph { ?lnp npx:hasNanopubType owl:Class ; npx:introduces ?lc ; np:hasAssertion ?la .\n filter not exists { ?lx npx:invalidates ?lnp } }\n graph ?la { ?lc dct:isPartOf|dct:partOf ?_ontology_multi_iri . }\n graph ?la { ?lc rdfs:subClassOf ?lp . filter(?lp != peh:BioChemEntity) }\n bind(str(?lp) as ?k)\n optional {\n graph npa:graph { ?lln npx:hasNanopubType owl:Class ; npx:introduces ?lp ; np:hasAssertion ?lla . }\n graph ?lla { ?lp rdfs:label ?klab . filter(lang(?klab) = \"\") }\n }\n } group by ?k }\n { select (?k as ?k2) (?kn as ?kn2) where { select ?k (count(distinct ?lc) as ?kn) (min(?klab) as ?klabel) where {\n values ?_ontology_multi_iri {}\n graph npa:graph { ?lnp npx:hasNanopubType owl:Class ; npx:introduces ?lc ; np:hasAssertion ?la .\n filter not exists { ?lx npx:invalidates ?lnp } }\n graph ?la { ?lc dct:isPartOf|dct:partOf ?_ontology_multi_iri . }\n graph ?la { ?lc rdfs:subClassOf ?lp . filter(?lp != peh:BioChemEntity) }\n bind(str(?lp) as ?k)\n optional {\n graph npa:graph { ?lln npx:hasNanopubType owl:Class ; npx:introduces ?lp ; np:hasAssertion ?lla . }\n graph ?lla { ?lp rdfs:label ?klab . filter(lang(?klab) = \"\") }\n }\n } group by ?k } }\n filter(?kn2 > ?kn || (?kn2 = ?kn && ?k2 <= ?k))\n } group by ?k ?kn ?klabel } }\n bind(coalesce(xsd:integer(strbefore(strafter(?cTab, concat(\"[\", ?groupKey_, \">\")), \"]\")), 99) as ?ci0_)\n bind(if(?ci0_ = 99, 99, if(?ci0_ < 8, ?ci0_, 8)) as ?ci_)\n bind(concat(if(?ci_ < 10, \"0\", \"\"), str(?ci_), \"~\", lcase(coalesce(?label, \"zzzz\")), \"~\", str(?class)) as ?sortkey_)\n} group by ?class ?label ?sets_ ?groupKey_ ?roleKey_ ?parentLabel_ ?ci_ }\n { select (?class as ?o2) (?sets as ?osets) (?sortkey as ?osortkey) where { select ?class (?sets_ as ?sets) (min(?sortkey_) as ?sortkey) where {\n values ?_ontology_multi_iri {}\n service {\n select (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n values ?_ontology_multi_iri {}\n graph ?stateG {\n ?_ontology_multi_iri npa:isMaintainedBy? ?space .\n ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt .\n filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))\n ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk .\n }\n }\n }\n graph npa:graph {\n ?np npx:hasNanopubType owl:Class ; npa:hasValidSignatureForPublicKeyHash ?pubkey ;\n dct:created ?date ; npx:introduces ?class ; np:hasAssertion ?a .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n }\n filter(contains(?memberPubkeys, ?pubkey))\n graph ?a { ?class dct:isPartOf|dct:partOf ?_ontology_multi_iri . }\n filter not exists { graph ?a { ?class a gen:WithdrawnTerm } }\n filter not exists {\n graph npa:graph {\n ?np2 npx:hasNanopubType owl:Class ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ;\n dct:created ?date2 ; npx:introduces ?class ; np:hasAssertion ?a2 .\n filter not exists { ?np2x npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }\n }\n filter(contains(?memberPubkeys, ?pubkey2))\n graph ?a2 { ?class dct:isPartOf|dct:partOf ?_ontology_multi_iri . }\n filter(?date2 > ?date || (?date2 = ?date && str(?np2) > str(?np)))\n }\n {\n select (group_concat(distinct ?apV; separator=\" \") as ?approvedNps)\n (group_concat(distinct ?disV; separator=\" \") as ?disapprovedNps) where {\n {\n select ?vTarget (max(concat(str(?vDate), \">\", str(?vNp), \">\", ?vMark)) as ?vWin) where {\n values ?_ontology_multi_iri {}\n service {\n select (group_concat(?vpk; separator=\" \") as ?vMemberPubkeys) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?vStateG . }\n values ?_ontology_multi_iri {}\n graph ?vStateG {\n ?_ontology_multi_iri npa:isMaintainedBy? ?vSpace .\n ?vRi a gen:RoleInstantiation ; npa:forSpace ?vSpace ; npa:forAgent ?vMember ;\n npa:hasRoleType ?vRt .\n filter(?vRt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))\n ?vAcct a npa:AccountState ; npa:agent ?vMember ; npa:pubkey ?vpk .\n }\n }\n }\n service {\n select distinct ?vTarget ?vNp ?vDate ?vPubkey ?vMark where {\n graph npa:graph {\n ?vTarget npx:hasNanopubType owl:Class ; npx:signedBy ?targetAgent .\n ?vNp npx:signedBy ?vAgent ; npa:hasValidSignatureForPublicKeyHash ?vPubkey ;\n dct:created ?vDate ; np:hasAssertion ?vA .\n filter not exists { ?vInv npx:invalidates ?vNp ; npa:hasValidSignatureForPublicKeyHash ?vPubkey . }\n }\n graph ?vA { ?vAgent ?vPred ?vTarget . }\n values ?vPred { npx:approvesOf npx:disapprovesOf }\n filter(?vAgent != ?targetAgent)\n bind(if(?vPred = npx:approvesOf, \"a\", \"d\") as ?vMark)\n }\n }\n filter(contains(?vMemberPubkeys, ?vPubkey))\n } group by ?vTarget\n }\n bind(if(strends(?vWin, \"a\"), str(?vTarget), \"\") as ?apV)\n bind(if(strends(?vWin, \"d\"), str(?vTarget), \"\") as ?disV)\n }\n }\n {\n select (sample(?helperPubkeys_) as ?helperPubkeys) where {\n service {\n select (group_concat(?hpk; separator=\" \") as ?helperPubkeys_) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?hStateG . }\n values ?_ontology_multi_iri {}\n graph ?hStateG {\n ?_ontology_multi_iri npa:isMaintainedBy? ?hSpace .\n ?hRi a gen:RoleInstantiation ; npa:forSpace ?hSpace ; npa:forAgent ?hAgent ;\n gen:hasRole .\n ?hAcct a npa:AccountState ; npa:agent ?hAgent ; npa:pubkey ?hpk .\n }\n }\n }\n }\n }\n bind(contains(concat(\" \", ?approvedNps, \" \"), concat(\" \", str(?np), \" \")) as ?explicitApproved)\n bind(contains(concat(\" \", ?disapprovedNps, \" \"), concat(\" \", str(?np), \" \")) as ?explicitDisapproved)\n bind(contains(?helperPubkeys, ?pubkey) as ?isAutoApproved)\n filter(?explicitApproved || (?isAutoApproved && !?explicitDisapproved))\n optional { graph ?a { ?class rdfs:label ?label . filter(lang(?label) = \"\") } }\n optional { select ?class (min(str(?p)) as ?parent) where {\n values ?_ontology_multi_iri {}\n graph npa:graph { ?pnp npx:hasNanopubType owl:Class ; npx:introduces ?class ; np:hasAssertion ?pa . }\n graph ?pa { ?class dct:isPartOf|dct:partOf ?_ontology_multi_iri ; rdfs:subClassOf ?p .\n filter(?p != peh:BioChemEntity) }\n } group by ?class }\n bind(bound(?parent) as ?g)\n bind(exists { graph ?a { ?class peh:isMetaboliteOf|peh:isIsomerOf ?y } } as ?l)\n bind(exists { graph ?a { ?class obo:RO_0000087 ?ro } } as ?r)\n bind(concat(if(?g,\"1\",\"0\"), if(?l,\"1\",\"0\"), if(?r,\"1\",\"0\")) as ?region)\n optional { graph ?a { ?class obo:RO_0000087 ?roleIri . }\n bind(concat(\"CHEBI:\", replace(replace(str(?roleIri), \"^.*[/#]\", \"\"), \"^CHEBI[_:]\", \"\")) as ?roleKey_) }\n optional {\n select ?class (min(concat(str(?p), \" ~|~ \", coalesce(?pl, \"\"))) as ?parentCombo) where {\n values ?_ontology_multi_iri {}\n graph npa:graph { ?pnp npx:hasNanopubType owl:Class ; npx:introduces ?class ; np:hasAssertion ?pa .\n filter not exists { ?pgx npx:invalidates ?pnp } }\n graph ?pa { ?class dct:isPartOf|dct:partOf ?_ontology_multi_iri ; rdfs:subClassOf ?p .\n filter(?p != peh:BioChemEntity) }\n optional {\n graph npa:graph { ?plnp npx:hasNanopubType owl:Class ; npx:introduces ?p ; np:hasAssertion ?pla . }\n graph ?pla { ?p rdfs:label ?pl . filter(lang(?pl) = \"\") }\n }\n } group by ?class\n }\n bind(strbefore(?parentCombo, \" ~|~ \") as ?groupKey_)\n bind(strafter(?parentCombo, \" ~|~ \") as ?parentLabel_)\n bind(bound(?parentCombo) as ?fg)\n bind(exists { graph ?a { ?class peh:isMetaboliteOf ?y } } as ?fm)\n bind(exists { graph ?a { ?class peh:isIsomerOf ?z } } as ?fi)\n bind(bound(?roleKey_) as ?fr)\n bind(if(!?fg && !?fm && !?fi && !?fr, \"\",\n if(!?fg && ?fm && ?fr, \"MR\",\n if(!?fg && ?fm, \"M\",\n if(!?fg && ?fr, \"R\",\n if(?fg && ?fi, \"GI\",\n if(?fg && ?fm, \"GM\",\n if(?fg && ?fr, \"GR\", \"G\"))))))) as ?sets_)\n { select (group_concat(concat(\"[\", ?k, \">\", str(?idx), \"]\"); separator=\"\") as ?cTab) where { select ?k ?kn ?klabel (count(?k2) - 1 as ?idx) where {\n { select ?k (count(distinct ?lc) as ?kn) (min(?klab) as ?klabel) where {\n values ?_ontology_multi_iri {}\n graph npa:graph { ?lnp npx:hasNanopubType owl:Class ; npx:introduces ?lc ; np:hasAssertion ?la .\n filter not exists { ?lx npx:invalidates ?lnp } }\n graph ?la { ?lc dct:isPartOf|dct:partOf ?_ontology_multi_iri . }\n graph ?la { ?lc rdfs:subClassOf ?lp . filter(?lp != peh:BioChemEntity) }\n bind(str(?lp) as ?k)\n optional {\n graph npa:graph { ?lln npx:hasNanopubType owl:Class ; npx:introduces ?lp ; np:hasAssertion ?lla . }\n graph ?lla { ?lp rdfs:label ?klab . filter(lang(?klab) = \"\") }\n }\n } group by ?k }\n { select (?k as ?k2) (?kn as ?kn2) where { select ?k (count(distinct ?lc) as ?kn) (min(?klab) as ?klabel) where {\n values ?_ontology_multi_iri {}\n graph npa:graph { ?lnp npx:hasNanopubType owl:Class ; npx:introduces ?lc ; np:hasAssertion ?la .\n filter not exists { ?lx npx:invalidates ?lnp } }\n graph ?la { ?lc dct:isPartOf|dct:partOf ?_ontology_multi_iri . }\n graph ?la { ?lc rdfs:subClassOf ?lp . filter(?lp != peh:BioChemEntity) }\n bind(str(?lp) as ?k)\n optional {\n graph npa:graph { ?lln npx:hasNanopubType owl:Class ; npx:introduces ?lp ; np:hasAssertion ?lla . }\n graph ?lla { ?lp rdfs:label ?klab . filter(lang(?klab) = \"\") }\n }\n } group by ?k } }\n filter(?kn2 > ?kn || (?kn2 = ?kn && ?k2 <= ?k))\n } group by ?k ?kn ?klabel } }\n bind(coalesce(xsd:integer(strbefore(strafter(?cTab, concat(\"[\", ?groupKey_, \">\")), \"]\")), 99) as ?ci0_)\n bind(if(?ci0_ = 99, 99, if(?ci0_ < 8, ?ci0_, 8)) as ?ci_)\n bind(concat(if(?ci_ < 10, \"0\", \"\"), str(?ci_), \"~\", lcase(coalesce(?label, \"zzzz\")), \"~\", str(?class)) as ?sortkey_)\n} group by ?class ?sets_ } }\n filter(?osets = ?sets && ?osortkey <= ?sortkey)\n } group by ?class ?label ?sets ?groupKey ?roleKey ?parentLabel ?ci\n }\n bind(\"[CHEBI:25944>pesticide][CHEBI:79314>flame retardant][CHEBI:25442>mycotoxin][CHEBI:73335>ultraviolet filter][CHEBI:24527>herbicide][CHEBI:48318>fragrance][CHEBI:64857>cosmetic][CHEBI:38867>anaesthetic][CHEBI:48357>aprotic solvent]\" as ?rlt)\n bind(coalesce(strbefore(strafter(?rlt, concat(\"[\", ?roleKey, \">\")), \"]\"), \"\") as ?rl0)\n bind(if(?rl0 = \"\", coalesce(?roleKey, \"\"), ?rl0) as ?roleLabel)\n bind(if(?ci = 99, \"#C9C9C9\", if(?ci = 0, \"#3C6DB0\", if(?ci = 1, \"#E07B39\", if(?ci = 2, \"#3F9E5C\", if(?ci = 3, \"#C0392B\", if(?ci = 4, \"#7D6BB5\", if(?ci = 5, \"#8A6A4F\", if(?ci = 6, \"#D46FB8\", if(?ci = 7, \"#B39200\", \"#8A8A8A\"))))))))) as ?fill)\n values (?vsets ?vx0 ?vy0 ?vcols) {\n (\"\" 26 296 106) (\"M\" 64 54 42) (\"MR\" 382 54 6) (\"R\" 432 54 42)\n (\"GM\" 158 126 30) (\"GR\" 432 126 30) (\"G\" 162 162 68) (\"GI\" 170 234 40)\n }\n filter(?vsets = ?sets)\n bind(?vx0 as ?x0) bind(?vy0 as ?y0) bind(?vcols as ?cols)\n bind(floor(?rank / ?cols) as ?row)\n bind(?x0 + (?rank - ?cols * ?row) * 7 as ?cx)\n bind(?y0 + ?row * 7 as ?cy)\n bind(concat(\n replace(replace(replace(coalesce(?label, \"(no label)\"), \"&\", \"&\"), \"<\", \"<\"), \">\", \">\"),\n if(coalesce(?parentLabel, \"\") = \"\", \"\", concat(\" | group: \", replace(replace(replace(?parentLabel, \"&\", \"&\"), \"<\", \"<\"), \">\", \">\"))),\n if(contains(?sets, \"M\"), \" | metabolite\", \"\"),\n if(contains(?sets, \"I\"), \" | isomer\", \"\"),\n if(?roleLabel = \"\", \"\", concat(\" | role: \", replace(replace(replace(?roleLabel, \"&\", \"&\"), \"<\", \"<\"), \">\", \">\")))\n ) as ?tip)\n bind(concat(\'\',\n ?tip, \'\') as ?dot)\n } group by ?sets ?x0 ?y0 ?cols\n }\n bind(concat(?dots,\n \'n = \', str(?ccount), \'\') as ?cellBlock)\n }\n }\n {\n select (group_concat(?leg; separator=\"\") as ?legend) (sample(?ltitle) as ?legendTitle) where {\n { select ?k ?kn ?klabel (count(?k2) - 1 as ?idx) where {\n { select ?k (count(distinct ?lc) as ?kn) (min(?klab) as ?klabel) where {\n values ?_ontology_multi_iri {}\n graph npa:graph { ?lnp npx:hasNanopubType owl:Class ; npx:introduces ?lc ; np:hasAssertion ?la .\n filter not exists { ?lx npx:invalidates ?lnp } }\n graph ?la { ?lc dct:isPartOf|dct:partOf ?_ontology_multi_iri . }\n graph ?la { ?lc rdfs:subClassOf ?lp . filter(?lp != peh:BioChemEntity) }\n bind(str(?lp) as ?k)\n optional {\n graph npa:graph { ?lln npx:hasNanopubType owl:Class ; npx:introduces ?lp ; np:hasAssertion ?lla . }\n graph ?lla { ?lp rdfs:label ?klab . filter(lang(?klab) = \"\") }\n }\n } group by ?k }\n { select (?k as ?k2) (?kn as ?kn2) where { select ?k (count(distinct ?lc) as ?kn) (min(?klab) as ?klabel) where {\n values ?_ontology_multi_iri {}\n graph npa:graph { ?lnp npx:hasNanopubType owl:Class ; npx:introduces ?lc ; np:hasAssertion ?la .\n filter not exists { ?lx npx:invalidates ?lnp } }\n graph ?la { ?lc dct:isPartOf|dct:partOf ?_ontology_multi_iri . }\n graph ?la { ?lc rdfs:subClassOf ?lp . filter(?lp != peh:BioChemEntity) }\n bind(str(?lp) as ?k)\n optional {\n graph npa:graph { ?lln npx:hasNanopubType owl:Class ; npx:introduces ?lp ; np:hasAssertion ?lla . }\n graph ?lla { ?lp rdfs:label ?klab . filter(lang(?klab) = \"\") }\n }\n } group by ?k } }\n filter(?kn2 > ?kn || (?kn2 = ?kn && ?k2 <= ?k))\n } group by ?k ?kn ?klabel }\n bind(\"chemical groups\" as ?ltitle)\n filter(?idx < 8)\n bind(20 + (?idx - 3 * floor(?idx / 3)) * 258 as ?lx)\n bind(390 + floor(?idx / 3) * 17 as ?ly)\n bind(if(if(?idx < 8, ?idx, 8) = 99, \"#C9C9C9\", if(if(?idx < 8, ?idx, 8) = 0, \"#3C6DB0\", if(if(?idx < 8, ?idx, 8) = 1, \"#E07B39\", if(if(?idx < 8, ?idx, 8) = 2, \"#3F9E5C\", if(if(?idx < 8, ?idx, 8) = 3, \"#C0392B\", if(if(?idx < 8, ?idx, 8) = 4, \"#7D6BB5\", if(if(?idx < 8, ?idx, 8) = 5, \"#8A6A4F\", if(if(?idx < 8, ?idx, 8) = 6, \"#D46FB8\", if(if(?idx < 8, ?idx, 8) = 7, \"#B39200\", \"#8A8A8A\"))))))))) as ?lfill)\n bind(concat(\'\',\n \'\', replace(replace(replace(?klabel, \"&\", \"&\"), \"<\", \"<\"), \">\", \">\"), \' (\', str(?kn), \')\') as ?leg)\n }\n }\n bind(concat(\n \'\',\n \'Each dot is one class of the vocabulary, placed by which of the four sets it belongs to \',\n \'and colored by its chemical group.\',\n \'\',\n \'\',\n \'\',\n \'\',\n \'\',\n \'\',\n \'metabolite (\', str(?nMet), \')\',\n \'role (\', str(?nRole), \')\',\n \'isomer\',\n \'in a chemical group (\', str(?nGroup), \')\',\n \'all classes in this vocabulary (\', str(?total), \')\',\n ?body,\n \'\', ?legendTitle, \'\',\n ?legend,\n \'\',\n \'\', \"another chemical group\", \'\',\n \'\',\n \'\', \"no chemical group\", \'\',\n \'\') as ?svg)\n}" } } } rows { name { value: "wasAttributedTo" } } rows { name { value: "0000-0002-1267-0234" } } rows { quad { s_iri { prefix_id: 2 name_id: 4 } p_iri { prefix_id: 10 name_id: 21 } o_iri { prefix_id: 9 } g_iri { prefix_id: 2 name_id: 7 } } } rows { name { value: "name" } } rows { quad { s_iri { prefix_id: 9 name_id: 22 } p_iri { prefix_id: 11 } o_literal { lex: "Tobias Kuhn" } g_iri { prefix_id: 2 name_id: 9 } } } rows { name { value: "created" } } rows { datatype { value: "http://www.w3.org/2001/XMLSchema#dateTime" } } rows { quad { s_iri { prefix_id: 1 name_id: 1 } p_iri { prefix_id: 4 name_id: 24 } o_literal { lex: "2026-08-26T14:22:40Z" datatype: 1 } } } rows { name { value: "creator" } } rows { quad { p_iri { } o_iri { prefix_id: 9 name_id: 22 } } } rows { prefix { value: "https://creativecommons.org/publicdomain/zero/1.0/" } } rows { quad { p_iri { prefix_id: 4 name_id: 14 } o_iri { prefix_id: 16 name_id: 2 } } } rows { name { value: "embeds" } } rows { quad { p_iri { prefix_id: 6 name_id: 26 } o_iri { prefix_id: 2 name_id: 12 } } } rows { name { value: "supersedes" } } rows { name { value: "RAwTTlk1cWxh9rdw8uYX9DbaPFZ7Px1w2ftimfPbSqoIM" } } rows { quad { p_iri { prefix_id: 6 name_id: 27 } o_iri { prefix_id: 1 } } } rows { quad { p_iri { prefix_id: 8 name_id: 17 } o_literal { lex: "Get the class landscape of an ontology as SVG, colored by chemical group" } } } rows { name { value: "wasCreatedFromProvenanceTemplate" } } rows { name { value: "RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU" } } rows { quad { p_iri { prefix_id: 5 name_id: 29 } o_iri { prefix_id: 1 } } } rows { name { value: "wasCreatedFromPubinfoTemplate" } } rows { name { value: "RACJ58Gvyn91LqCKIO9zu1eijDQIeEff28iyDrJgjSJF8" } } rows { quad { p_iri { prefix_id: 5 } o_iri { prefix_id: 1 } } } rows { name { value: "RAoTD7udB2KtUuOuAe74tJi1t3VzK0DyWS7rYVAq1GRvw" } } rows { quad { o_iri { } } } rows { name { value: "RAukAcWHRDlkqxk7H2XNSegc1WnHI569INvNr-xdptDGI" } } rows { quad { o_iri { } } } rows { name { value: "wasCreatedFromTemplate" } } rows { name { value: "RAEFAt-QcFK0ZhqfvlsmS10BnzGJA0xwOICZXkO-ai87k" } } rows { quad { p_iri { prefix_id: 5 } o_iri { prefix_id: 1 } } } rows { name { value: "sig" } } rows { name { value: "hasAlgorithm" } } rows { quad { s_iri { prefix_id: 2 } p_iri { prefix_id: 6 } o_literal { lex: "RSA" } } } rows { name { value: "hasPublicKey" } } rows { quad { p_iri { } o_literal { lex: "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB" } } } rows { name { value: "hasSignature" } } rows { quad { p_iri { } o_literal { lex: "qblvuqsceZ+FqapzLeCxQ1DxjD/4mzk6NtfNmu8ti+87oDBJRvTKFWnXVIIb4BQfJQxOX+Cr73Pwz7Fbd52ka9DA6fIUOZXzYYjRrmGzdG6MDLxwMC1s0KnSfA2C0w2mfOOPyn8Hb83NP5YlZ5zkzy9EeCG+u+BN2x9OdpXDxbk=" } } } rows { name { value: "hasSignatureTarget" } } rows { quad { p_iri { } o_iri { prefix_id: 1 name_id: 1 } } } rows { name { value: "signedBy" } } rows { quad { p_iri { prefix_id: 6 name_id: 42 } o_iri { prefix_id: 9 name_id: 22 } } }