Get trust network overview diagram as SVG
has assertion: assertion
has provenance: provenance
has publication info: pubinfo
type: Nanopublication
created: 2026-08-25T15:08:19Z
creator: Tobias Kuhn
license: https://creativecommons.org/licenses/by/4.0/
embeds: Get trust network overview diagram as SVG

Get trust network overview diagram as SVG
description: Returns a single result row with one 'svg' column holding a complete SVG diagram of the whole trust network of the nanopublication ecosystem, computed entirely from the current trust state. This is the query behind the 'Trust network overview' SVG view (gen:SvgView). Every agent in the trust state is drawn as one equally sized tilted square (a diamond, echoing the profile-picture mask), linking root-relatively (/user?id=...) to that agent's user page. Agents are grouped into horizontal bands by their minimum depth from the trust seed; within a band they are ordered by the number of agents they endorsed, descending, and laid out left-aligned at a fixed spacing, wrapping onto as many rows as the band needs. The highest-endorsing agents therefore sit at the left of each band. A line is drawn for every endorsement between two distinct agents, so the fan below an agent shows the agents it brought into the network. Node color encodes depth, with contested agents in red and skipped (rejected) agents in gray. The diagram carries no title, caption or labels: it is a pure node-and-link rendering meant to sit under the view's own heading, and its height adapts to the number of rows needed. The query reads npa:EndorsementLink nodes (npa:fromAgent / npa:toAgent) together with the npa:AccountState rows of the current trust state, so it needs no federated SERVICE call and no scan of the full repository. Per-pubkey duplicate rows are collapsed to one node per agent, self-endorsements across an agent's own keys are not drawn as edges, and positions come from rank subqueries, so the output is deterministic. The 'resource' parameter is the page the view is shown on; it is not used by the diagram, which always shows the whole network.
license: LICENSE-2.0
type: grlc-query
endpoint: trust
sparql: prefix npa: <http://purl.org/nanopub/admin/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> select (concat( " ", ?edgesvg, ?nodesvg, " ") as ?svg) where { bind(?_resource_iri as ?pageResource) { select (((30 + (?nd - 1) * 60) + ?totalRows * 16 + 20) as ?h) where { { select (sum(?rr) as ?totalRows) (count(*) as ?nd) where { { select ?dh (count(*) as ?ch) where { { select ?aH (min(?dH) as ?depH) where { npa:thisRepo npa:hasCurrentTrustState ?tsH . graph ?tsH { ?stH a npa:AccountState ; npa:agent ?aH ; npa:depth ?dH } } group by ?aH } bind(?depH as ?dh) } group by ?dh } bind(xsd:integer(ceil(?ch / 126)) as ?rr) } } } } { select (group_concat(?eline; separator="") as ?edgesvg) where { { select ?aF ?depF ?outF ((14 + (?rankF - 1 - ?rowF * 126) * 14 + 7) as ?xF) ((30 + (?depF - 1) * 60 + (?rowsBeforeF + ?rowF) * 16) as ?yF) where { { select ?aF ?depF ?outF (count(distinct ?a2F) as ?rankF) where { { select ?aFa (min(?dFa) as ?depFa) (count(distinct ?tFa) as ?outFa) where { npa:thisRepo npa:hasCurrentTrustState ?tsFa . graph ?tsFa { ?stFa a npa:AccountState ; npa:agent ?aFa ; npa:depth ?dFa } optional { graph ?tsFa { ?lFa a npa:EndorsementLink ; npa:fromAgent ?aFa ; npa:toAgent ?tFa } } } group by ?aFa } bind(str(1000 - ?outFa) as ?pnFa) bind(concat(substr(concat("0000", ?pnFa), strlen(?pnFa) + 1), str(?aFa)) as ?kFa) bind(?aFa as ?aF) bind(?depFa as ?depF) bind(?outFa as ?outF) { select ?aFb (min(?dFb) as ?depFb) (count(distinct ?tFb) as ?outFb) where { npa:thisRepo npa:hasCurrentTrustState ?tsFb . graph ?tsFb { ?stFb a npa:AccountState ; npa:agent ?aFb ; npa:depth ?dFb } optional { graph ?tsFb { ?lFb a npa:EndorsementLink ; npa:fromAgent ?aFb ; npa:toAgent ?tFb } } } group by ?aFb } bind(str(1000 - ?outFb) as ?pnFb) bind(concat(substr(concat("0000", ?pnFb), strlen(?pnFb) + 1), str(?aFb)) as ?kFb) bind(?aFb as ?a2F) filter(?depFb = ?depF && ?kFb <= ?kFa) } group by ?aF ?depF ?outF } bind(xsd:integer(floor((?rankF - 1) / 126)) as ?rowF) { select ?depRF (sum(?r2F) as ?rowsB…

sig
has algorithm: RSA
signed by: Tobias Kuhn