@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:get-spaces-for-agent a ; dct:description "This query returns all the spaces to which the given agent has membership relations"; dct:license ; rdfs:label "Get Spaces for agent"; ; """prefix rdfs: prefix dct: prefix owl: prefix np: prefix npa: prefix npx: prefix gen: prefix schema: select distinct ?space ?role (?roleName as ?role_label) (?link_np as ?source) where { values ?_agent_multi_iri {} { { graph npa:graph { ?spaceRole_np npx:hasNanopubType gen:SpaceMemberRole . ?spaceRole_np npa:hasValidSignatureForPublicKeyHash ?spaceRole_pubkey . filter not exists { ?spaceRole_npx npx:invalidates ?spaceRole_np ; npa:hasValidSignatureForPublicKeyHash ?spaceRole_pubkey . } ?spaceRole_np np:hasAssertion ?spaceRole_a . } graph ?spaceRole_a { ?space gen:hasRole ?role . } } union { bind( as ?role) } } graph ?role_a { ?role a gen:SpaceMemberRole . ?role rdfs:label ?roleLabel . ?role dct:title ?roleTitle . ?role schema:name ?roleName . } graph npa:graph { ?role_np npx:embeds ?role . ?role_np np:hasAssertion ?role_a . } { { graph ?role_a { ?role gen:hasRegularProperty ?reg . } graph ?link_a { ?_agent_multi_iri ?reg ?space . } bind(?reg as ?property) bind(false as ?inverse) } union { graph ?role_a { ?role gen:hasInverseProperty ?inv . } graph ?link_a { ?space ?inv ?_agent_multi_iri . } bind(?inv as ?property) bind(true as ?inverse) } } graph npa:graph { ?link_np np:hasAssertion ?link_a . ?link_np npa:hasValidSignatureForPublicKeyHash ?link_pubkey . filter not exists { ?link_npx npx:invalidates ?link_np ; npa:hasValidSignatureForPublicKeyHash ?link_pubkey . } ?link_np dct:created ?link_date . } } order by desc(?link_date)""" . } 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 "2025-12-01T15:50:53.288Z"^^xsd:dateTime; dct:creator orcid:0000-0002-1267-0234; dct:license ; npx:embeds sub:get-spaces-for-agent; npx:supersedes ; npx:wasCreatedAt ; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD4Wj537OijfOWVtsHMznuXKISqBhtGDQZfdO6pbb4hg9EHMcUFGTLbWaPrP783PHv8HMAAPjvEkHLaOHMIknqhaIa5236lfBO3r+ljVdYBElBcLvROmwG+ZGtmPNZf7lMhI15xf5TfoaSa84AFRd5J2EXekK6PhaFQhRm1IpSYtwIDAQAB"; npx:hasSignature "df7ycdgJTCZ4Sq4p6mzVoVCM/JJ68JwdmPw4Q7S3WTYpGe8l9rJHhDe7RmhtB2Q+Y8r5WQufY2aa4nJ0f7FoWfHN81pInf/qvt1X5vbEXv6V4+Ih0k61B304+cDw7i3GnkxMOdDgHaSnKbm7lbn/c+gP+n1FQUoCjkbxRaC3DHc="; npx:hasSignatureTarget this:; npx:signedBy orcid:0000-0002-1267-0234 . }