@prefix this: . @prefix sub: . @prefix np: . @prefix dct: . @prefix nt: . @prefix npx: . @prefix xsd: . @prefix rdfs: . @prefix orcid: . @prefix prov: . @prefix foaf: . sub:Head { this: a np:Nanopublication; np:hasAssertion sub:assertion; np:hasProvenance sub:provenance; np:hasPublicationInfo sub:pubinfo . } sub:assertion { sub:list-space-roles a ; dct:description "Lists the roles assigned in a given space as a table: each role (linked, labelled by its title/label), its schema:name, and a count of how many distinct users of the space hold that role. The built-in Admin role is always included as the first row. Also returns the role-assignment template (for the assign-user action) and the source nanopublication."; dct:license ; rdfs:label "List space roles"; ; """prefix rdfs: prefix dct: prefix np: prefix npa: prefix schema: prefix gen: select ?role (sample(?rlbl) as ?role_label) (sample(?rname) as ?name) (count(distinct ?member) as ?users) (sample(?rtmpl) as ?roleAssignmentTemplate) (sample(?npX) as ?np) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } values ?_space_multi_iri {} { bind( as ?role) bind(0 as ?sortkey) bind(\"Built-in admin role\" as ?rlbl) bind(\"admin\" as ?rname) bind( as ?rtmpl) bind(gen:hasAdmin as ?prop) } union { graph ?g { ?ra a gen:RoleAssignment ; npa:forSpace ?_space_multi_iri ; gen:hasRole ?role ; npa:viaNanopub ?npX . } graph npa:graph { ?npX dct:created ?dateX . } bind(1 as ?sortkey) graph npa:spacesGraph { ?roleDecl a npa:RoleDeclaration ; npa:role ?role ; npa:viaNanopub ?role_np . } graph npa:graph { ?role_np np:hasAssertion ?role_a . } optional { graph ?role_a { ?role rdfs:label ?rl1 } } optional { graph ?role_a { ?role dct:title ?rt1 } } optional { graph ?role_a { ?role schema:name ?rn1 } } optional { graph ?role_a { ?role gen:hasRoleAssignmentTemplate ?rtmpl } } bind(coalesce(?rl1, ?rt1, ?rn1) as ?rlbl) bind(?rn1 as ?rname) optional { { graph npa:spacesGraph { ?roleDecl gen:hasRegularProperty ?prop } } union { graph npa:spacesGraph { ?roleDecl gen:hasInverseProperty ?prop } } } } optional { graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?member . } optional { graph ?g { ?ri (npa:regularProperty|npa:inverseProperty) ?riPropS } } optional { graph npa:spacesGraph { ?ri (npa:regularProperty|npa:inverseProperty) ?riPropX } } bind(coalesce(?riPropS, ?riPropX) as ?riProp) filter(bound(?prop) && ?riProp = ?prop) } } group by ?role ?sortkey order by ?sortkey desc(max(?dateX))""" . } sub:provenance { sub:assertion prov:wasAttributedTo orcid:0000-0002-1267-0234 . } sub:pubinfo { orcid:0000-0002-1267-0234 foaf:name "Tobias Kuhn" . this: dct:created "2026-06-11T08:16:19Z"^^xsd:dateTime; dct:creator orcid:0000-0002-1267-0234; dct:license ; npx:embeds sub:list-space-roles; npx:supersedes ; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB"; npx:hasSignature "YhSVtgkMedePfTS7+AV2s6vYvsycvk6HyV2+N/C/CUINGN2t69Ai+jNiTHbuwgNqRNxPBCKw4re3VM3H11CQBekC06dq5IEc2iMrojU6pT1uLj2aTfy6YUYY+g6Zzhb1cRirrFthO17tj3m5n+3Sgm9KC080N5c6DBgXkePe5Ng="; npx:hasSignatureTarget this:; npx:signedBy orcid:0000-0002-1267-0234 . }