. "Returns basic key-value facts about a given space (type, start and end date for time-limited spaces, and the root-definition nanopub), taken from its latest non-invalidated space-declaration nanopub signed by an admin of the space. Each property and value is rendered as a link to its defining IRI where applicable. Both columns use the '_noheader' convention so the redundant header row is dropped." . . "Get space info" . . "prefix rdf: \nprefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix schema: \nprefix gen: \n\nselect distinct ?Property_noheader ?Property_label ?Value_noheader ?Value_label where {\n values ?_space_multi_iri {}\n service {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n graph ?stateG {\n ?ri a gen:RoleInstantiation ; npa:inverseProperty gen:hasAdmin ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?admin .\n ?acct a npa:AccountState ; npa:agent ?admin ; npa:pubkey ?pubkey .\n }\n }\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np np:hasAssertion ?a .\n }\n graph ?a { ?_space_multi_iri a gen:Space . }\n optional { graph ?a { ?_space_multi_iri a ?typeIri . filter(?typeIri != gen:Space) } }\n optional { graph ?a { ?_space_multi_iri schema:startDate ?startVal } }\n optional { graph ?a { ?_space_multi_iri schema:endDate ?endVal } }\n values (?key ?Property_noheader ?Property_label) {\n (\"Type\" rdf:type \"Type:\")\n (\"Start date\" schema:startDate \"Start date:\")\n (\"End date\" schema:endDate \"End date:\")\n (\"Root definition\" gen:hasRootDefinition \"Root definition:\")\n }\n bind(if(?key=\"Type\", ?typeIri, if(?key=\"Start date\", str(?startVal), if(?key=\"End date\", str(?endVal), ?np))) as ?Value_noheader)\n filter(bound(?Value_noheader))\n bind(if(?key=\"Type\", replace(str(?typeIri),\"^.*/\",\"\"), if(?key=\"Root definition\", substr(strafter(str(?np), \"/np/\"), 1, 10), \"\")) as ?Value_label)\n}\norder by (if(?key=\"Type\",1,if(?key=\"Start date\",2,if(?key=\"End date\",3,4))))" . . "Lists the view displays declared for a resource, for the About page: standalone view displays and the views contributed by assigned presets (marked with the preset). Filtered to declarations signed by an admin or maintainer of the owning space, or by the affected user themselves. Shows each view, its active/deactivated status, the contributing preset (if any), the signer, the date, and the source nanopub." . . "List view displays" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix gen: \n\nselect ?view ?view_label\n (if(bound(?displayMode) && contains(str(?displayMode), \"Deactivated\"), \"deactivated\", \"active\") as ?status)\n ?deactivateView ?preset ?preset_label ?user ?date ?np (\"^\" as ?np_label) where {\n values ?_resource_multi_iri {}\n service {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n {\n graph ?stateG {\n ?_resource_multi_iri npa:isMaintainedBy? ?space .\n ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ;\n (npa:inverseProperty|npa:regularProperty) ?roleProp .\n ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey .\n }\n optional {\n graph npa:spacesGraph {\n ?rd a npa:RoleDeclaration ; npa:forSpace ?space ;\n npa:hasRoleType gen:MaintainerRole ;\n (npa:inverseProperty|npa:regularProperty) ?roleProp .\n bind(true as ?isMaintainer)\n }\n }\n filter(?roleProp = gen:hasAdmin || bound(?isMaintainer))\n } union {\n graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . }\n }\n }\n {\n graph npa:graph {\n ?np npx:hasNanopubType gen:ViewDisplay ;\n npa:hasValidSignatureForPublicKeyHash ?pubkey ;\n dct:created ?date ;\n npx:embeds ?display ;\n np:hasAssertion ?a .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n optional { ?np npx:signedBy ?user }\n }\n graph ?a {\n ?display gen:isDisplayOfView ?view ;\n gen:isDisplayFor ?_resource_multi_iri .\n optional {\n values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay }\n ?display a ?displayMode .\n }\n }\n }\n union\n {\n select ?view ?displayMode ?preset ?preset_label ?user ?date ?np ?pubkey ?_resource_multi_iri {\n service {\n graph npa:graph {\n ?np npx:hasNanopubType gen:PresetAssignment ;\n npa:hasValidSignatureForPublicKeyHash ?pubkey ;\n dct:created ?date ;\n npx:embeds ?assignment ;\n np:hasAssertion ?a .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n optional { ?np npx:signedBy ?user }\n }\n graph ?a {\n ?assignment gen:isAssignmentFor ?_resource_multi_iri ;\n gen:isAssignmentOfPreset ?preset .\n optional {\n values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment }\n ?assignment a ?displayMode .\n }\n }\n graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . }\n graph ?pa {\n ?preset a gen:Preset .\n optional { ?preset rdfs:label ?preset_label . }\n { ?preset gen:hasTopLevelView ?view } union { ?preset gen:hasView ?view }\n }\n }\n }\n }\n optional {\n service {\n graph npa:graph { ?vnp npx:embeds ?view ; np:hasAssertion ?va . }\n graph ?va { ?view dct:title ?view_label . }\n }\n }\n bind(if(bound(?displayMode) && contains(str(?displayMode), \"Deactivated\"), \"\", str(?view)) as ?deactivateView)\n}\norder by desc(?date)" . . "Lists the maintained resources of a given space (from the spaces repo) with a link to the source nanopublication. Label comes from each resource's declaration assertion. Ordered alphabetically by label." . . "List maintained resources of a space" . . "prefix np: \nprefix npa: \nprefix gen: \nprefix rdfs: \n\nselect ?resource ?resource_label ?np (\"^\" as ?np_label) where {\n {\n select ?resource\n (sample(?label) as ?resource_label)\n (sample(?viaNp) as ?np)\n where {\n values ?_space_multi_iri {}\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }\n graph ?g { ?_space_multi_iri npa:hasMaintainedResource ?resource . }\n optional { graph ?ag { ?resource a gen:MaintainedResource ; rdfs:label ?label . } }\n optional { graph npa:spacesGraph { ?d a npa:MaintainedResourceDeclaration ; npa:resourceIri ?resource ; npa:maintainerSpace ?_space_multi_iri ; npa:viaNanopub ?viaNp } }\n }\n group by ?resource\n }\n}\norder by lcase(str(?resource_label))" . . "Lists the members of a given space together with their highest role tier (admin, maintainer, or member, in that order) and links to the role-assignment nanopubs (labelled by the specific role name, preferring schema:name). Observer-tier roles are excluded. When the same role is assigned to the same person by multiple nanopubs, only the latest one is linked." . . "List space members" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix gen: \nprefix schema: \n\nselect ?member ?tier ?role_assignments_multi_iri ?role_assignments_label_multi where {\n {\n select ?member\n (if(min(?rank)=1,\"Admin\",if(min(?rank)=2,\"Maintainer\",\"Member\")) as ?tier)\n (min(?rank) as ?rankMin)\n (group_concat(?latestNp; separator=\" \") as ?role_assignments_multi_iri)\n (group_concat(?roleLabel; separator=\"\\n\") as ?role_assignments_label_multi)\n where {\n {\n select ?member ?roleProp\n (min(?rank0) as ?rank)\n (sample(?roleLabel0) as ?roleLabel)\n (strafter(max(concat(coalesce(str(?dateNp),\"\"), \" \", str(?grantNp))), \" \") as ?latestNp)\n where {\n values ?_space_multi_iri {}\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }\n graph ?g {\n ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?member ; npa:viaNanopub ?grantNp .\n }\n bind(exists { graph ?g { ?ri npa:inverseProperty gen:hasAdmin } } as ?isAdmin)\n optional { graph npa:spacesGraph { ?ri (npa:regularProperty|npa:inverseProperty) ?ropExt } }\n optional { graph ?g { ?ri (npa:regularProperty|npa:inverseProperty) ?ropState } }\n bind(coalesce(?ropExt,?ropState) as ?roleProp)\n bind(exists { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:hasRoleType gen:MaintainerRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } as ?isMaintainer)\n bind(exists { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:hasRoleType gen:MemberRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } as ?isMember)\n bind(if(?isAdmin,1,if(?isMaintainer,2,if(?isMember,3,0))) as ?rank0)\n optional { graph npa:graph { ?grantNp dct:created ?dateNp } }\n optional {\n graph npa:spacesGraph { ?rd2 a npa:RoleDeclaration ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp ; npa:viaNanopub ?roleNp ; npa:role ?role . }\n graph npa:graph { ?roleNp np:hasAssertion ?role_a . }\n optional { graph ?role_a { ?role schema:name ?rlS } }\n optional { graph ?role_a { ?role rdfs:label ?rlA } }\n optional { graph ?role_a { ?role dct:title ?rlB } }\n bind(coalesce(?rlS,?rlA,?rlB) as ?rl)\n }\n bind(if(?isAdmin,coalesce(?rl,\"admin\"),coalesce(?rl,\"role\")) as ?roleLabel0)\n }\n group by ?member ?roleProp\n }\n filter(?rank > 0)\n }\n group by ?member\n }\n}\norder by ?rankMin ?member" . . . "List space observers" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix gen: \nprefix schema: \n\nselect ?member ?role_assignments_multi_iri ?role_assignments_label_multi where {\n {\n select ?member\n (max(?higher) as ?maxHigher)\n (group_concat(?latestNp; separator=\" \") as ?role_assignments_multi_iri)\n (group_concat(?roleLabel; separator=\"\\n\") as ?role_assignments_label_multi)\n where {\n {\n select ?member ?roleProp\n (max(?higher0) as ?higher)\n (sample(?roleLabel0) as ?roleLabel)\n (strafter(max(concat(coalesce(str(?dateNp),\"\"), \" \", str(?grantNp))), \" \") as ?latestNp)\n where {\n values ?_space_multi_iri {}\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }\n graph ?g {\n ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?member ; npa:viaNanopub ?grantNp .\n }\n bind(exists { graph ?g { ?ri npa:inverseProperty gen:hasAdmin } } as ?isAdmin)\n optional { graph npa:spacesGraph { ?ri (npa:regularProperty|npa:inverseProperty) ?ropExt } }\n optional { graph ?g { ?ri (npa:regularProperty|npa:inverseProperty) ?ropState } }\n bind(coalesce(?ropExt,?ropState) as ?roleProp)\n bind(exists { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:hasRoleType gen:MaintainerRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } as ?isMaintainer)\n bind(exists { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:hasRoleType gen:MemberRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } as ?isMember)\n bind(if(?isAdmin||?isMaintainer||?isMember,1,0) as ?higher0)\n optional { graph npa:graph { ?grantNp dct:created ?dateNp } }\n optional {\n graph ?g { ?raRole a gen:RoleAssignment ; npa:forSpace ?_space_multi_iri ; gen:hasRole ?role . }\n graph npa:spacesGraph { ?rd2 a npa:RoleDeclaration ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp ; npa:viaNanopub ?roleNp ; npa:role ?role . }\n graph npa:graph { ?roleNp np:hasAssertion ?role_a . }\n optional { graph ?role_a { ?role schema:name ?rlS } }\n optional { graph ?role_a { ?role rdfs:label ?rlA } }\n optional { graph ?role_a { ?role dct:title ?rlB } }\n bind(coalesce(?rlS,?rlA,?rlB) as ?rl)\n }\n bind(coalesce(?rl,\"role\") as ?roleLabel0)\n }\n group by ?member ?roleProp\n }\n }\n group by ?member\n having (max(?higher) = 0)\n }\n}\norder by ?member" . . "Lists the sub-spaces of a given space (from the spaces repo) with their type and a link to the source nanopublication. Type and label come from each sub-space's root-definition assertion. Ordered alphabetically by label." . . "List sub-spaces of a space" . . "prefix np: \nprefix npa: \nprefix gen: \nprefix rdfs: \n\nselect ?subspace ?subspace_label ?type ?np (\"^\" as ?np_label) where {\n {\n select ?subspace\n (sample(?label) as ?subspace_label)\n (coalesce(sample(?typeName), \"\") as ?type)\n (sample(?rootNp) as ?np)\n where {\n values ?_space_multi_iri {}\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }\n graph ?g { ?_space_multi_iri npa:hasSubSpace ?subspace . }\n graph ?ag {\n ?subspace a gen:Space ; rdfs:label ?label .\n optional { ?subspace a ?typeIri . filter(?typeIri != gen:Space) }\n }\n bind(if(bound(?typeIri), strafter(str(?typeIri), \"terms/\"), \"\") as ?typeName)\n optional { graph npa:spacesGraph { ?ref a npa:SpaceRef ; npa:spaceIri ?subspace ; npa:rootNanopub ?rootNp } }\n }\n group by ?subspace\n }\n}\norder by lcase(str(?subspace_label))" . . "Returns the description (dct:description) of a given space, taken from its latest non-invalidated space-declaration nanopub that was signed by an admin of the space, as a single paragraph (content + source nanopub)." . . "Get space description" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix gen: \n\nselect ?content ?np where {\n values ?_space_multi_iri {}\n service {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n graph ?stateG {\n ?ri a gen:RoleInstantiation ; npa:inverseProperty gen:hasAdmin ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?admin .\n ?acct a npa:AccountState ; npa:agent ?admin ; npa:pubkey ?pubkey .\n }\n }\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np dct:created ?date ; np:hasAssertion ?a .\n }\n graph ?a {\n ?_space_multi_iri a gen:Space ; dct:description ?content .\n }\n}\norder by desc(?date)\nlimit 1" . . "This query lists the roles assigned in a given space, with a human-readable label, the source nanopublication, and the template for assigning a user to the role." . . "List space roles" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix schema: \nprefix gen: \n\nselect distinct ?role (coalesce(?roleLabel, ?roleTitle, ?roleName) as ?role_label) ?roleAssignmentTemplate ?np (\"^\" as ?np_label) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }\n values ?_space_multi_iri {}\n graph ?g {\n ?ra a gen:RoleAssignment ;\n npa:forSpace ?_space_multi_iri ;\n gen:hasRole ?role ;\n npa:viaNanopub ?np .\n }\n graph npa:graph {\n ?np dct:created ?date .\n }\n graph npa:spacesGraph {\n ?roleDecl a npa:RoleDeclaration ;\n npa:role ?role ;\n npa:viaNanopub ?role_np .\n }\n graph npa:graph { ?role_np np:hasAssertion ?role_a . }\n optional { graph ?role_a { ?role rdfs:label ?roleLabel } }\n optional { graph ?role_a { ?role dct:title ?roleTitle } }\n optional { graph ?role_a { ?role schema:name ?roleName } }\n optional { graph ?role_a { ?role gen:hasRoleAssignmentTemplate ?roleAssignmentTemplate } }\n}\norder by desc(?date)" . . "Returns the introduction nanopublications of a given user (creation date, key location, declared public-key hashes), plus session-relative action targets from the viewer's local key (?__LOCALPUBKEY_multi) and site URL (?__SITEURL_multi): conditional retract/derive targets that are owner-gated (?_user_iri = ?__CURRENTUSER_multi_iri) and computed against the same notion of a 'local introduction' as the UI: an introduction SIGNED BY the local key, DECLARING the local key, whose local-key declaration has no location or matches the site URL (nanobench->nanodash). retract_target fires on a local introduction when there is more than one (duplicate cleanup); derive_target fires on a non-local introduction when there are zero local introductions. The retract/derive/local columns are action-mapping data (hidden from display by the result builders). The keys column annotates each declared key hash with its trust-approval status, federated from the trust repo: a checkmark when the key is loaded/approved for the user, a warning sign otherwise." . . "Get user introductions" . . "prefix np: \nprefix npx: \nprefix npa: \nprefix dct: \n\nselect (max(?date0) as ?date) (sample(str(?keyLocation)) as ?location)\n (group_concat(distinct ?keyAnnotated; separator=\", \") as ?keys) ?np (\"^\" as ?np_label)\n (if(max(?isOwner) > 0 && max(?signedByLocal) > 0 && sum(?localDeclOk) > 0 && ?localCount > 1, str(?np), \"\") as ?retract_target)\n (if(max(?isOwner) > 0 && (max(?signedByLocal) = 0 || sum(?localDeclOk) = 0) && ?localCount = 0 && max(?lpkBound) > 0, str(?np), \"\") as ?derive_target)\n (sample(?lpk) as ?local_pubkey) (sample(?lpkShort) as ?local_pubkey_short)\n (sample(?siteUrl) as ?site_url)\nwhere {\n values ?__LOCALPUBKEY_multi {}\n values ?__SITEURL_multi {}\n values ?__CURRENTUSER_multi_iri {}\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?introPubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?introPubkey . }\n ?np dct:created ?date0 .\n ?np np:hasAssertion ?a .\n }\n graph ?a {\n ?keydeclaration npx:declaredBy ?_user_iri .\n ?keydeclaration npx:hasPublicKey ?pubkey .\n optional { ?keydeclaration npx:hasKeyLocation ?keyLocation . }\n bind(substr(sha256(?pubkey), 1, 10) as ?keyHash)\n bind(lcase(sha256(str(?pubkey))) as ?keyHashFull)\n }\n bind(if(exists {\n service {\n graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?tg . }\n graph ?tg { ?acct npa:agent ?_user_iri ; npa:pubkey ?keyHashFull ; npa:trustStatus npa:loaded . }\n }\n }, concat(\"✅ \", ?keyHash), concat(\"⚠️ \", ?keyHash)) as ?keyAnnotated)\n bind(coalesce(if(str(?pubkey) = str(?__LOCALPUBKEY_multi), 1, 0), 0) as ?isLocal)\n bind(if(?isLocal = 1 && (!bound(?keyLocation) || coalesce(str(?keyLocation) = str(?__SITEURL_multi), false) || coalesce(replace(str(?keyLocation), \"nanobench\", \"nanodash\") = str(?__SITEURL_multi), false)), 1, 0) as ?localDeclOk)\n bind(coalesce(if(str(?introPubkey) = str(?__LOCALPUBKEY_multi), 1, 0), 0) as ?signedByLocal)\n bind(if(bound(?__LOCALPUBKEY_multi), 1, 0) as ?lpkBound)\n bind(coalesce(if(?_user_iri = ?__CURRENTUSER_multi_iri, 1, 0), 0) as ?isOwner)\n bind(coalesce(str(?__LOCALPUBKEY_multi), \"\") as ?lpk)\n bind(if(strlen(?lpk) >= 45, concat(substr(?lpk, 1, 1), \"..\", substr(?lpk, 41, 5), \"..\"), \"\") as ?lpkShort)\n bind(coalesce(str(?__SITEURL_multi), \"\") as ?siteUrl)\n {\n select (count(distinct ?lnp) as ?localCount) where {\n values ?__LOCALPUBKEY_multi {}\n values ?__SITEURL_multi {}\n graph npa:graph {\n ?lnp npa:hasValidSignatureForPublicKey ?lsign .\n filter not exists { ?lnpx npx:invalidates ?lnp ; npa:hasValidSignatureForPublicKey ?lsign . }\n ?lnp np:hasAssertion ?la .\n }\n graph ?la {\n ?lkd npx:declaredBy ?_user_iri ; npx:hasPublicKey ?lpubkey .\n optional { ?lkd npx:hasKeyLocation ?lloc . }\n }\n filter(coalesce(str(?lsign) = str(?__LOCALPUBKEY_multi), false))\n filter(coalesce(str(?lpubkey) = str(?__LOCALPUBKEY_multi), false))\n filter(!bound(?lloc) || coalesce(str(?lloc) = str(?__SITEURL_multi), false) || coalesce(replace(str(?lloc), \"nanobench\", \"nanodash\") = str(?__SITEURL_multi), false))\n }\n }\n}\ngroup by ?np ?localCount\norder by desc(max(?date0))" . . "Returns the member roles attached to the given space(s): trust-state-validated gen:RoleAssignments from the current space-state graph of the spaces repo (/repo/spaces), joined to their RoleDeclaration for the role's regular/inverse properties (space-separated), role tier (npa:hasRoleType), plus the role's label/name/title and role-assignment template. Pass one or more space IRIs." . . "Get space roles" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix schema: \nprefix gen: \n\nselect ?role ?roleLabel ?roleName ?roleTitle ?roleAssignmentTemplate ?roleType\n (group_concat(distinct ?reg; separator=\" \") as ?regularProperties)\n (group_concat(distinct ?inv; separator=\" \") as ?inverseProperties)\n ?ra_np where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }\n values ?_space_multi_iri {}\n graph ?g {\n ?ra a gen:RoleAssignment ;\n npa:forSpace ?_space_multi_iri ;\n gen:hasRole ?role ;\n npa:viaNanopub ?ra_np .\n }\n graph npa:spacesGraph {\n ?roleDecl a npa:RoleDeclaration ;\n npa:role ?role ;\n npa:viaNanopub ?role_np .\n optional { ?roleDecl gen:hasRegularProperty ?reg }\n optional { ?roleDecl gen:hasInverseProperty ?inv }\n optional { ?roleDecl npa:hasRoleType ?roleType }\n }\n graph npa:graph { ?role_np np:hasAssertion ?role_a . }\n optional { graph ?role_a { ?role rdfs:label ?roleLabel } }\n optional { graph ?role_a { ?role dct:title ?roleTitle } }\n optional { graph ?role_a { ?role schema:name ?roleName } }\n optional { graph ?role_a { ?role gen:hasRoleAssignmentTemplate ?roleAssignmentTemplate } }\n} group by ?role ?roleLabel ?roleName ?roleTitle ?roleAssignmentTemplate ?roleType ?ra_np" . . "This query returns the details of all FIP declarations, including schema:version for R-FIP declarations." . . "Get FIP declaration details" . . "prefix rdfs: \nprefix fip: \nprefix dct: \nprefix dce: \nprefix npa: \nprefix npx: \nprefix np: \nprefix dcat: \nprefix schema: \n\nselect ?decl_np ?community ?c ?question ?q ?sort ?nochoice ?decl ?rel ?resource_id_used ?startdate ?enddate ?date ?version where {\n graph npa:graph {\n ?decl_np npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?decl_np_x npx:invalidates ?decl_np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?decl_np npx:hasNanopubType fip:FIP-Declaration .\n ?decl_np dct:created ?date .\n ?decl_np np:hasAssertion ?assertion .\n }\n graph ?assertion {\n ?decl a fip:FIP-Declaration .\n ?decl fip:refers-to-question ?question .\n {\n { ?decl fip:declares-current-use-of ?resource_id_used . bind(fip:declares-current-use-of as ?rel) }\n union\n { ?decl fip:declares-planned-use-of ?resource_id_used . bind(fip:declares-planned-use-of as ?rel) }\n union\n { ?decl fip:declares-planned-replacement-of ?resource_id_used . bind(fip:declares-planned-replacement-of as ?rel) }\n union\n { ?decl fip:declares-replacement-from ?resource_id_used . bind(fip:declares-replacement-from as ?rel) }\n union\n { ?decl fip:declares-replacement-to ?resource_id_used . bind(fip:declares-replacement-to as ?rel) }\n }\n # grlc gives an error for some reason if these two optional statements are at the end of the graph block:\n optional { ?decl dcat:startDate ?startdate . }\n optional { ?decl dcat:endDate ?enddate . }\n ?decl fip:declared-by ?community .\n optional { ?decl schema:version ?version . }\n }\n bind (replace(str(?community), \".*[#/]\", \"\") as ?c)\n bind (replace(str(?supercommunity), \".*[#/]\", \"\") as ?sc)\n bind (replace(str(?question), \"^.*-([^-MD]+(-[MD]+)?)$\", \"$1\") as ?q)\n bind (concat(replace(?q, \"F|M\", \"0\"), \"x\") as ?sort)\n bind (\"\" as ?nochoice)\n}" . . "This query returns a list of all FIP communities that have supercommunities." . . "Get FIP supercommunities" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix fip: \n\nselect distinct ?community (group_concat(distinct ?supercommunity; separator=\" \") as ?supercommunities) (group_concat(distinct ?sc; separator=\" \") as ?sc) where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?np npx:hasNanopubType fip:FAIR-Implementation-Community .\n ?np (npx:introduces|npx:describes) ?community .\n ?np np:hasAssertion ?a .\n }\n graph ?a {\n ?community dct:isPartOf ?supercommunity .\n }\n optional {\n graph npa:graph {\n ?disapproval np:hasAssertion ?da .\n ?disapproval npa:hasValidSignatureForPublicKey ?dpubkey .\n filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . }\n }\n graph {\n ?dpubkeys npx:hasPublicKey ?dpubkey .\n }\n graph ?da {\n ?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np .\n }\n } filter(!bound(?disapproval)) # for some reason this is much faster than \"filter not exists\"\n bind(replace(str(?supercommunity), \".*[#/]\", \"\") as ?sc)\n} group by ?community" . . "Returns the views to display for a given resource: both standalone view displays and the views contributed by assigned presets (issue #302), unioned and ordered by date so latest-wins override resolution holds across both. Filtered server-side to declarations signed by an admin or maintainer of the owning space, or by the affected user themselves (for an agent's own page). Each referenced view is resolved to its latest version by following the npx:supersedes chain: among the version tree's current heads (nanopubs that are themselves neither superseded nor validly retracted via npx:invalidates), the most recent is chosen, so ?view is the latest non-retracted view definition (no separate latest-version lookup needed by the client). Choosing a current head rather than the max-timestamp node makes resolution robust to backdated supersedes and to retracted versions. Preset-derived rows have an unbound ?display and carry the resolved ?view plus the assignment's activation mode. The view-version resolution is wrapped in a run-once sub-SELECT so the cross-repo lookup is evaluated once for the whole view set rather than once per referenced view." . . "Get view displays" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix gen: \n\nselect distinct ?display ?view (coalesce(?viewKindOptional, ?view) as ?viewKind)\n ?label ?displayType ?displayMode ?np ?pubkey ?date where {\n values ?_resource_multi_iri {}\n service {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n {\n graph ?stateG {\n ?_resource_multi_iri npa:isMaintainedBy? ?space .\n ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ;\n (npa:inverseProperty|npa:regularProperty) ?roleProp .\n ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey .\n }\n optional {\n graph npa:spacesGraph {\n ?rd a npa:RoleDeclaration ; npa:forSpace ?space ;\n npa:hasRoleType gen:MaintainerRole ;\n (npa:inverseProperty|npa:regularProperty) ?roleProp .\n bind(true as ?isMaintainer)\n }\n }\n filter(?roleProp = gen:hasAdmin || bound(?isMaintainer))\n } union {\n graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . }\n }\n }\n {\n # branch (a): standalone view displays — LOCAL pattern on the endpoint repo\n graph npa:graph {\n ?np npx:hasNanopubType gen:ViewDisplay .\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np dct:created ?date .\n ?np npx:embeds ?display .\n ?np np:hasAssertion ?a .\n optional { ?np rdfs:label ?label }\n }\n graph ?a {\n ?display gen:isDisplayOfView ?refView .\n ?display gen:isDisplayFor ?_resource_multi_iri .\n optional { values ?displayType { gen:PartLevelViewDisplay gen:TopLevelViewDisplay } ?display a ?displayType . }\n optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . }\n }\n }\n union\n {\n # branch (b): preset-supplied views — wrapped in a sub-SELECT so the remote\n # service does not collapse branch (a). ?display stays unbound.\n select ?refView ?label ?displayType ?displayMode ?np ?pubkey ?date ?_resource_multi_iri {\n service {\n graph npa:graph {\n ?np npx:hasNanopubType gen:PresetAssignment .\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np dct:created ?date .\n ?np npx:embeds ?assignment .\n ?np np:hasAssertion ?a .\n optional { ?np rdfs:label ?label }\n }\n graph ?a {\n ?assignment gen:isAssignmentFor ?_resource_multi_iri .\n ?assignment gen:isAssignmentOfPreset ?presetRef .\n optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . }\n }\n graph npa:graph { ?presetNp npx:embeds ?presetRef ; np:hasAssertion ?pa . }\n graph ?pa {\n ?presetRef a gen:Preset .\n { ?presetRef gen:hasTopLevelView ?refView . bind(gen:TopLevelViewDisplay as ?displayType) }\n union { ?presetRef gen:hasView ?refView . bind(gen:PartLevelViewDisplay as ?displayType) }\n }\n }\n }\n }\n # Resolve each referenced view to its latest version: the current head of its\n # supersedes version tree (a nanopub itself neither superseded nor validly\n # retracted via npx:invalidates), most recent among heads on a fork. Wrapped in\n # a run-once sub-SELECT so this cross-repo service is evaluated once for the\n # whole view set rather than once per referenced view -- the per-view federation\n # round-trips were the dominant cost of earlier versions.\n optional {\n service {\n select distinct ?refView ?latestView ?viewKindOptional where {\n graph npa:graph { ?rnp npx:embeds ?refView ; np:hasAssertion ?ra . }\n graph ?ra { ?refView a gen:ResourceView . }\n optional {\n ?vnp npx:embeds ?refView .\n ?latestNp (npx:supersedes|^npx:supersedes)* ?vnp ; dct:created ?ldate ; npx:embeds ?latestView ; np:hasAssertion ?va .\n filter not exists { ?supNp npx:supersedes ?latestNp . }\n filter not exists { ?invNp npx:invalidates ?latestNp ; npa:hasValidSignatureForPublicKeyHash ?invPk . }\n filter not exists {\n ?other (npx:supersedes|^npx:supersedes)* ?vnp ; dct:created ?odate .\n filter not exists { ?supNp2 npx:supersedes ?other . }\n filter not exists { ?invNp2 npx:invalidates ?other ; npa:hasValidSignatureForPublicKeyHash ?invPk2 . }\n filter(?odate > ?ldate)\n }\n graph ?va { ?latestView a gen:ResourceView . optional { ?latestView dct:isVersionOf ?viewKindOptional . } }\n }\n }\n }\n }\n bind(coalesce(?latestView, ?refView) as ?view)\n}\norder by desc(?date)" . . "Lists the view displays declared for a resource, for the About page: standalone view displays and the views contributed by assigned presets (marked with the preset). Filtered to declarations signed by an admin or maintainer of the owning space, or by the affected user themselves. Each referenced view is resolved to its latest version (following the npx:supersedes chain): among the version tree's current heads (nanopubs that are themselves neither superseded nor validly retracted via npx:invalidates), the most recent is chosen, so the latest non-retracted view definition, title, and structural position are shown. Choosing a current head rather than the max-timestamp node makes resolution robust to backdated supersedes and to retracted versions. Results are ordered by structural position (the page ordering key) and then by view kind, replicating the order the views appear on the page. Shows each view, its title, its structural position, its active/deactivated status, the contributing preset (if any), the signer, the date, and the source nanopub. The view-version resolution is wrapped in a run-once sub-SELECT so the cross-repo lookup is evaluated once for the whole view set rather than once per referenced view." . . "List view displays" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix gen: \n\nselect ?view ?view_label ?structuralPosition\n (if(bound(?displayMode) && contains(str(?displayMode), \"Deactivated\"), \"deactivated\", \"active\") as ?status)\n ?preset ?preset_label ?user ?date ?np (\"^\" as ?np_label) where {\n values ?_resource_multi_iri {}\n service {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n {\n graph ?stateG {\n ?_resource_multi_iri npa:isMaintainedBy? ?space .\n ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ;\n (npa:inverseProperty|npa:regularProperty) ?roleProp .\n ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey .\n }\n optional {\n graph npa:spacesGraph {\n ?rd a npa:RoleDeclaration ; npa:forSpace ?space ;\n npa:hasRoleType gen:MaintainerRole ;\n (npa:inverseProperty|npa:regularProperty) ?roleProp .\n bind(true as ?isMaintainer)\n }\n }\n filter(?roleProp = gen:hasAdmin || bound(?isMaintainer))\n } union {\n graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . }\n }\n }\n {\n graph npa:graph {\n ?np npx:hasNanopubType gen:ViewDisplay ;\n npa:hasValidSignatureForPublicKeyHash ?pubkey ;\n dct:created ?date ;\n npx:embeds ?display ;\n np:hasAssertion ?a .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n optional { ?np npx:signedBy ?user }\n }\n graph ?a {\n ?display gen:isDisplayOfView ?refView ;\n gen:isDisplayFor ?_resource_multi_iri .\n optional {\n values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay }\n ?display a ?displayMode .\n }\n }\n }\n union\n {\n select ?refView ?displayMode ?preset ?preset_label ?user ?date ?np ?pubkey ?_resource_multi_iri {\n service {\n graph npa:graph {\n ?np npx:hasNanopubType gen:PresetAssignment ;\n npa:hasValidSignatureForPublicKeyHash ?pubkey ;\n dct:created ?date ;\n npx:embeds ?assignment ;\n np:hasAssertion ?a .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n optional { ?np npx:signedBy ?user }\n }\n graph ?a {\n ?assignment gen:isAssignmentFor ?_resource_multi_iri ;\n gen:isAssignmentOfPreset ?preset .\n optional {\n values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment }\n ?assignment a ?displayMode .\n }\n }\n graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . }\n graph ?pa {\n ?preset a gen:Preset .\n optional { ?preset rdfs:label ?preset_label . }\n { ?preset gen:hasTopLevelView ?refView } union { ?preset gen:hasView ?refView }\n }\n }\n }\n }\n # Resolve each referenced view to its latest version: the current head of its\n # supersedes version tree (a nanopub itself neither superseded nor validly\n # retracted via npx:invalidates), most recent among heads on a fork. Wrapped in\n # a run-once sub-SELECT so this cross-repo service is evaluated once for the\n # whole view set rather than once per referenced view -- the per-view federation\n # round-trips were the dominant cost of earlier versions.\n optional {\n service {\n select distinct ?refView ?latestView ?view_label ?structuralPosition ?viewKind where {\n graph npa:graph { ?rnp npx:embeds ?refView ; np:hasAssertion ?ra . }\n graph ?ra { ?refView a gen:ResourceView . }\n optional {\n ?vnp npx:embeds ?refView .\n ?latestNp (npx:supersedes|^npx:supersedes)* ?vnp ; dct:created ?ldate ; npx:embeds ?latestView ; np:hasAssertion ?va .\n filter not exists { ?supNp npx:supersedes ?latestNp . }\n filter not exists { ?invNp npx:invalidates ?latestNp ; npa:hasValidSignatureForPublicKeyHash ?invPk . }\n filter not exists {\n ?other (npx:supersedes|^npx:supersedes)* ?vnp ; dct:created ?odate .\n filter not exists { ?supNp2 npx:supersedes ?other . }\n filter not exists { ?invNp2 npx:invalidates ?other ; npa:hasValidSignatureForPublicKeyHash ?invPk2 . }\n filter(?odate > ?ldate)\n }\n graph ?va { ?latestView dct:title ?view_label . optional { ?latestView gen:hasStructuralPosition ?structuralPosition . } optional { ?latestView dct:isVersionOf ?viewKind . } }\n }\n }\n }\n }\n bind(coalesce(?latestView, ?refView) as ?view)\n}\norder by ?structuralPosition coalesce(?viewKind, ?view) ?date" . . "This query returns the use cases described for a given entity (a Space or Maintained Resource)." . . "Get use cases for a resource" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix gen: \nprefix nt: \n\nselect ?usecase ?usecase_label ?comment ?subject ?subject_label ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npx:hasNanopubType gen:isUseCaseFor .\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np np:hasAssertion ?a .\n ?np np:hasPublicationInfo ?pi .\n }\n values ?_entity_multi_iri {}\n graph ?a {\n ?usecase gen:isUseCaseFor ?_entity_multi_iri .\n optional { ?usecase rdfs:label ?usecase_label . }\n optional { ?usecase rdfs:comment ?comment . }\n optional { ?usecase dct:subject ?subject . }\n }\n optional { graph ?pi { ?subject nt:hasLabelFromApi ?subject_label . } }\n}" . . "Lists the presets assigned to a resource, for the About page, filtered to assignments signed by an admin or maintainer of the owning space, or by the affected user themselves: each assigned preset, the resource type it applies to, its active/deactivated status, the signer, the date, and the source nanopub." . . "List preset assignments" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix gen: \n\nselect ?preset ?preset_label ?appliesTo ?appliesTo_label\n (if(bound(?mode) && contains(str(?mode), \"Deactivated\"), \"deactivated\", \"active\") as ?status)\n ?user ?date ?np (\"^\" as ?np_label) where {\n values ?_resource_multi_iri {}\n service {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n {\n graph ?stateG {\n ?_resource_multi_iri npa:isMaintainedBy? ?space .\n ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ;\n (npa:inverseProperty|npa:regularProperty) ?roleProp .\n ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey .\n }\n optional {\n graph npa:spacesGraph {\n ?rd a npa:RoleDeclaration ; npa:forSpace ?space ;\n npa:hasRoleType gen:MaintainerRole ;\n (npa:inverseProperty|npa:regularProperty) ?roleProp .\n bind(true as ?isMaintainer)\n }\n }\n filter(?roleProp = gen:hasAdmin || bound(?isMaintainer))\n } union {\n graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . }\n }\n }\n graph npa:graph {\n ?np npx:hasNanopubType gen:PresetAssignment ;\n npa:hasValidSignatureForPublicKeyHash ?pubkey ;\n dct:created ?date ;\n npx:embeds ?assignment ;\n np:hasAssertion ?a .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n optional { ?np npx:signedBy ?user }\n }\n graph ?a {\n ?assignment gen:isAssignmentFor ?_resource_multi_iri ;\n gen:isAssignmentOfPreset ?preset .\n optional {\n values ?mode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment }\n ?assignment a ?mode .\n }\n }\n optional {\n graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . }\n graph ?pa {\n optional { ?preset rdfs:label ?preset_label . }\n optional { ?preset gen:appliesToInstancesOf ?appliesTo . }\n }\n }\n}\norder by desc(?date)" . . "This query returns basic profile properties of a given user: the most recent default license and profile picture, one per row, each with its source nanopublication." . . "Get user profile info" . . "prefix np: \nprefix npx: \nprefix npa: \nprefix dct: \nprefix schema: \nprefix kpxl_terms: \n\nselect ?property ?value ?np (\"^\" as ?np_label) where {\n {\n select (\"Default license\" as ?property) ?value ?np where {\n graph npa:graph {\n ?np np:hasAssertion ?a .\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np dct:created ?date .\n }\n graph ?a { ?_user_iri kpxl_terms:hasDefaultLicense ?value . }\n }\n order by desc(?date)\n limit 1\n }\n union\n {\n select (\"Profile picture\" as ?property) ?value ?np where {\n graph npa:graph {\n ?np np:hasAssertion ?a .\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np dct:created ?date .\n }\n graph ?a { ?_user_iri schema:image ?value . }\n }\n order by desc(?date)\n limit 1\n }\n}\norder by ?property" . . "Given a resource, this query returns the glossary of terms it references: SKOS concepts linked from the resource via dct:references. Each row reports the term (identified by its Wikidata URI) with its preferred label, the human-readable definition, and a link to the nanopublication that defines the concept." . . "Get glossary for a resource" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix skos: \n\nselect distinct (?concept as ?term) ?term_label ?definition ?np (\"^\" as ?np_label) where {\n graph npa:graph { ?np np:hasAssertion ?a . }\n graph ?a {\n ?_resource_iri dct:references ?concept .\n ?concept a skos:Concept ;\n rdfs:label ?term_label ;\n skos:definition ?definition .\n }\n graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pk . }\n filter not exists { graph npa:graph { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pk . } }\n}\norder by ?term_label" . . "Returns a list of all events related to the Three Point FAIRification Framework (3PFF), with multi-value fields pre-rendered as HTML anchor strings. Organizer and facilitator links use the agent's display name (resolved from the trust repository) as anchor text, falling back to the URI's local name. Variant of get-3pff-events intended for consumption by clients (e.g. nanopub-table with data-bind-html) that cannot split space-separated URI lists on their own." . . "Get 3PFF Events (HTML)" . . "prefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix xsd: \nprefix dct: \nprefix prov: \nprefix foaf: \nprefix tpff: \nprefix schema: \n\nselect\n (?event as ?Event_ID)\n (?eventShortName as ?Event_ID__label)\n (?eventLongName as ?Event_Name)\n (?eventDate as ?Date)\n (concat(\"\", group_concat(distinct concat(\n \"\",\n coalesce(?eventOrganizerName, replace(str(?eventOrganizer), \"^.*[/#]\", \"\")),\n \"\"\n ); separator=\", \"), \"\") as ?Organizers)\n (concat(\"\", group_concat(distinct concat(\n \"\",\n coalesce(?eventFacilitatorName, replace(str(?eventFacilitator), \"^.*[/#]\", \"\")),\n \"\"\n ); separator=\", \"), \"\") as ?Facilitators)\n (concat(\"\", group_concat(distinct concat(\n \"\",\n replace(str(?eventMoreInfoLink), \"^.*[/#]\", \"\"),\n \"\"\n ); separator=\", \"), \"\") as ?More_Info)\n (?np as ?Source)\nwhere {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n ?np dct:created ?npDate .\n ?np dct:creator ?npCreator .\n ?np np:hasAssertion ?assertion .\n ?np npx:introduces ?event .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n }\n graph ?assertion {\n ?event a tpff:3PFF-event .\n ?event rdfs:label ?eventName .\n\n # Date Handling: Check for both predicates\n optional { ?event dct:date ?dateDct . }\n optional { ?event schema:startDate ?dateSchema . }\n bind(coalesce(?dateDct, strBefore(str(?dateSchema), \"T\")) as ?eventDate)\n\n bind(replace(str(?eventName), ' ?\\\\|.*$', '') as ?eventShortName)\n bind(replace(str(?eventName), '^([A-Z0-9]{2,3}).*$', '$1') as ?eventSeries)\n bind(replace(str(?eventName), '^.*\\\\| ?(.*)$', '$1') as ?eventLongName)\n\n optional {\n ?event tpff:has-event-organizer ?eventOrganizer .\n optional {\n service {\n graph npa:graph { npa:hasCurrentTrustState ?organizerTrustState . }\n graph ?organizerTrustState { ?eventOrganizer foaf:name ?eventOrganizerName . }\n }\n }\n }\n optional {\n ?event tpff:has-event-facilitator ?eventFacilitator .\n optional {\n service {\n graph npa:graph { npa:hasCurrentTrustState ?facilitatorTrustState . }\n graph ?facilitatorTrustState { ?eventFacilitator foaf:name ?eventFacilitatorName . }\n }\n }\n }\n optional {\n ?event rdfs:seeAlso ?eventMoreInfoLink .\n }\n }\n}\ngroup by ?event ?eventShortName ?eventLongName ?eventDate ?np\norder by desc(?eventDate)" . . "Given a resource, this query returns the papers it cites via any CiTO relation. For each citation it reports the citation type used (the CiTO property, with a human-readable label), the cited paper's title (linked to its DOI) and publication date (from the paper's bibliographic metadata nanopublication, if any), and a link to the citation nanopublication that asserts the citation. Citations whose cited paper has no bibliographic metadata nanopublication yet are still returned (with empty title and publication date)." . . "Get cited papers for a resource" . . "prefix dct: \nprefix np: \nprefix npa: \nprefix npx: \n\nselect distinct (?citoProp as ?citation_type) ?citation_type_label (?paper as ?title) ?title_label ?publication_date (?citeNp as ?np) (\"^\" as ?np_label) where {\n graph npa:graph { ?citeNp np:hasAssertion ?ca . }\n graph ?ca { ?_resource_iri ?citoProp ?paper . }\n filter(strstarts(str(?citoProp), \"http://purl.org/spar/cito/\"))\n bind(lcase(replace(replace(str(?citoProp), \"http://purl.org/spar/cito/\", \"\"), \"([a-z])([A-Z])\", \"$1 $2\")) as ?citation_type_label)\n filter not exists { graph npa:graph { ?cinv npx:invalidates ?citeNp . } }\n optional {\n graph npa:graph { ?descNp npx:introduces ?paper . ?descNp np:hasAssertion ?pa . }\n graph ?pa { ?paper dct:title ?title_label . }\n optional { graph ?pa { ?paper dct:date ?publication_date . } }\n graph npa:graph { ?descNp npa:hasValidSignatureForPublicKey ?pk . }\n filter not exists { graph npa:graph { ?inv npx:invalidates ?descNp ; npa:hasValidSignatureForPublicKey ?pk . } }\n }\n}\norder by ?citation_type_label ?publication_date ?title_label" . . "Given a resource, this query returns the claims (AIDA sentences) it covers via gen:coversClaim. Each statement links to the AIDA sentence and is labelled with the sentence text." . . "Get claims for a resource" . . "prefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix gen: \n\nselect distinct (?claim as ?statement) ?statement_label ?np (\"^\" as ?np_label) where {\n graph npa:graph { ?np np:hasAssertion ?a . }\n graph ?a {\n ?_resource_iri gen:coversClaim ?claim .\n ?claim a .\n }\n optional { graph npa:graph { ?np rdfs:label ?statement_label . } }\n graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pk . }\n filter not exists { graph npa:graph { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pk . } }\n}\norder by ?statement_label" . . "All observation FDOs about the Alpha Spike RBD variant — real-world occurrence, computational predictions, experimental DMS, and WHO classification — forming the FAIR Digital Twin knowlet for Alpha. Worked example of a single FDT." . . "MAC FDT — Alpha variant digital twin (knowlet)" . . "PREFIX rdfs: \nPREFIX np: \nPREFIX npa: \nPREFIX npx: \nPREFIX dct: \nPREFIX fdof: \nPREFIX mac: \n\nSELECT ?obs ?type ?label WHERE {\n GRAPH npa:graph {\n ?n1 npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists {\n ?np2 npx:invalidates ?n1 ;\n npa:hasValidSignatureForPublicKey ?pubkey .\n }\n ?n1 np:hasAssertion ?a .\n }\n graph ?a {\n ?obs mac:isObservationOf .\n ?obs a ?type .\n FILTER(?type != fdof:FAIRDigitalObject)\n OPTIONAL { ?obs rdfs:label ?label . }\n }\n} ORDER BY ?type" . . "Returns the nanopublications that introduce, describe, or embed the given term, with view-friendly columns (np / np_label and a source column rendered as a '^' explore link). Used by the /explore page as a resource view (the 'Described in nanopublication' list)." . . "Get term descriptions" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \n\nselect ?np ?np_label ?source (\"^\" as ?source_label) where {\n values ?__pubkey_multi {}\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?__pubkey_multi .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?__pubkey_multi . }\n ?np dct:created ?date .\n ?np npx:introduces|npx:describes|npx:embeds ?_term_iri .\n optional { ?np rdfs:label ?np_label . }\n }\n bind(?np as ?source)\n} order by desc(?date)" . . "Returns the instances assigned to the given class, with view-friendly columns (instance / instance_label). Used by the /explore page as a resource view (the 'Has instances' list)." . . "Get instances for class (view)" . . "prefix dct: \nprefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \n\nselect distinct ?instance ?instance_label where {\n graph ?g {\n ?instance a ?_class_iri .\n }\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?np npa:hasGraph ?g .\n ?np np:hasPublicationInfo ?i .\n }\n optional { graph ?g { ?instance rdfs:label ?instanceLabel1 . } }\n optional { graph ?g { ?instance dct:title ?instanceLabel2 . } }\n optional { graph ?i { ?instance rdfs:label ?instanceLabel3 . } }\n optional { graph ?i { ?instance nt:hasLabelFromApi ?instanceLabel4 . } }\n bind(coalesce(?instanceLabel1, ?instanceLabel2, ?instanceLabel3, ?instanceLabel4) as ?instance_label)\n} limit 1000" . . "Returns the instances assigned to the given class, with view-friendly columns (instance / instance_label). Used by the /explore page as a resource view (the 'Has instances' list)." . . "Get instances for class (view)" . . "prefix dct: \nprefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \n\nselect distinct ?instance ?instance_label ?np (\"^\" as ?np_label) where {\n graph ?g {\n ?instance a ?_class_iri .\n }\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?np npa:hasGraph ?g .\n ?np np:hasPublicationInfo ?i .\n }\n optional { graph ?g { ?instance rdfs:label ?instanceLabel1 . } }\n optional { graph ?g { ?instance dct:title ?instanceLabel2 . } }\n optional { graph ?i { ?instance rdfs:label ?instanceLabel3 . } }\n optional { graph ?i { ?instance nt:hasLabelFromApi ?instanceLabel4 . } }\n bind(coalesce(?instanceLabel1, ?instanceLabel2, ?instanceLabel3, ?instanceLabel4) as ?instance_label)\n} limit 1000" . . "Returns the things denoted as parts of the given thing, with view-friendly columns (part / part_label). Used by the /explore page as a resource view (the 'Has parts' list)." . . "Get parts of a thing (view)" . . "prefix dct: \nprefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \n\nselect ?part (sample(?partLabel) as ?part_label) where {\n { graph ?g {\n ?_thing_iri dct:hasPart ?part .\n }\n filter not exists {\n graph npa:graph {\n ?part npx:hasNanopubType npx:NanopubIndex .\n }\n }\n } union\n { graph ?g {\n ?part dct:partOf ?_thing_iri .\n }\n } union\n { graph ?gx {\n ?_thing_iri dct:hasPart ?index .\n }\n graph npa:graph {\n ?index npx:hasNanopubType npx:NanopubIndex .\n ?index np:hasAssertion ?a .\n }\n graph ?a {\n ?index npx:includesElement ?np .\n }\n graph npa:graph {\n ?np npx:introduces ?part .\n }\n }\n graph npa:graph {\n ?np npa:hasGraph ?g .\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?np np:hasPublicationInfo ?i .\n }\n optional { graph ?g { ?part rdfs:label ?partLabel1 . } }\n optional { graph ?g { ?part dct:title ?partLabel2 . } }\n optional { graph ?i { ?part rdfs:label ?partLabel3 . } }\n optional { graph ?i { ?part nt:hasLabelFromApi ?partLabel4 . } }\n optional { graph ?x { ?part rdfs:label ?partLabel5 . } }\n bind(coalesce(?partLabel1, ?partLabel2, ?partLabel3, ?partLabel4, ?partLabel5) as ?partLabel)\n}\ngroup by ?part\nlimit 1000" . . "Returns the things denoted as parts of the given thing, with view-friendly columns (part / part_label). Used by the /explore page as a resource view (the 'Has parts' list)." . . "Get parts of a thing (view)" . . "prefix dct: \nprefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \n\nselect ?part (sample(?partLabel) as ?part_label) ?np (\"^\" as ?np_label) where {\n { graph ?g {\n ?_thing_iri dct:hasPart ?part .\n }\n filter not exists {\n graph npa:graph {\n ?part npx:hasNanopubType npx:NanopubIndex .\n }\n }\n } union\n { graph ?g {\n ?part dct:partOf ?_thing_iri .\n }\n } union\n { graph ?gx {\n ?_thing_iri dct:hasPart ?index .\n }\n graph npa:graph {\n ?index npx:hasNanopubType npx:NanopubIndex .\n ?index np:hasAssertion ?a .\n }\n graph ?a {\n ?index npx:includesElement ?np .\n }\n graph npa:graph {\n ?np npx:introduces ?part .\n }\n }\n graph npa:graph {\n ?np npa:hasGraph ?g .\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?np np:hasPublicationInfo ?i .\n }\n optional { graph ?g { ?part rdfs:label ?partLabel1 . } }\n optional { graph ?g { ?part dct:title ?partLabel2 . } }\n optional { graph ?i { ?part rdfs:label ?partLabel3 . } }\n optional { graph ?i { ?part nt:hasLabelFromApi ?partLabel4 . } }\n optional { graph ?x { ?part rdfs:label ?partLabel5 . } }\n bind(coalesce(?partLabel1, ?partLabel2, ?partLabel3, ?partLabel4, ?partLabel5) as ?partLabel)\n}\ngroup by ?part ?np\nlimit 1000" . . "Returns the classes assigned to the given thing, with view-friendly columns (class / class_label). Used by the /explore page as a resource view (the 'Assigned to' list)." . . "Get the classes assigned to a thing (view)" . . "prefix dct: \nprefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \n\nselect distinct ?class ?class_label ?np (\"^\" as ?np_label) where {\n graph ?g {\n ?_thing_iri a ?class .\n }\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?np npa:hasGraph ?g .\n ?np np:hasPublicationInfo ?i .\n }\n optional { graph ?g { ?class rdfs:label ?classLabel1 . } }\n optional { graph ?g { ?class dct:title ?classLabel2 . } }\n optional { graph ?i { ?class rdfs:label ?classLabel3 . } }\n optional { graph ?i { ?class nt:hasLabelFromApi ?classLabel4 . } }\n bind(coalesce(?classLabel1, ?classLabel2, ?classLabel3, ?classLabel4) as ?class_label)\n} limit 1000" . . "Returns the classes assigned to the given thing, with view-friendly columns (class / class_label). Used by the /explore page as a resource view (the 'Assigned to' list)." . . "Get the classes assigned to a thing (view)" . . "prefix dct: \nprefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \n\nselect distinct ?class ?class_label where {\n graph ?g {\n ?_thing_iri a ?class .\n }\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?np npa:hasGraph ?g .\n ?np np:hasPublicationInfo ?i .\n }\n optional { graph ?g { ?class rdfs:label ?classLabel1 . } }\n optional { graph ?g { ?class dct:title ?classLabel2 . } }\n optional { graph ?i { ?class rdfs:label ?classLabel3 . } }\n optional { graph ?i { ?class nt:hasLabelFromApi ?classLabel4 . } }\n bind(coalesce(?classLabel1, ?classLabel2, ?classLabel3, ?classLabel4) as ?class_label)\n} limit 1000" . . "Returns the assertion templates that use the given URI in their statements, with view-friendly columns (template_iri / template_iri_label). Used by the /explore page as a resource view (the 'Related Templates' list)." . . "Get the templates using given URI (view)" . . "prefix rdf: \nprefix dct: \nprefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \n\nselect distinct ?template_iri ?template_iri_label ?np (\"^\" as ?np_label) where {\n graph ?assertion {\n ?statement ?relation ?_thing_iri .\n values ?relation { rdf:subject rdf:predicate rdf:object nt:possibleValue }\n }\n graph npa:graph {\n ?template_iri npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?template_iri ; npa:hasValidSignatureForPublicKey ?pubkey . }\n filter not exists { ?template_iri npx:hasNanopubType nt:UnlistedTemplate . }\n ?template_iri np:hasAssertion ?assertion .\n optional { ?template_iri rdfs:label ?template_iri_label }\n bind(?template_iri as ?np)\n }\n} limit 1000" . . "Returns the assertion templates that use the given URI in their statements, with view-friendly columns (template_iri / template_iri_label). Used by the /explore page as a resource view (the 'Related Templates' list)." . . "Get the templates using given URI (view)" . . "prefix rdf: \nprefix dct: \nprefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \n\nselect distinct ?template_iri ?template_iri_label where {\n graph ?assertion {\n ?statement ?relation ?_thing_iri .\n values ?relation { rdf:subject rdf:predicate rdf:object nt:possibleValue }\n }\n graph npa:graph {\n ?template_iri npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?template_iri ; npa:hasValidSignatureForPublicKey ?pubkey . }\n filter not exists { ?template_iri npx:hasNanopubType nt:UnlistedTemplate . }\n ?template_iri np:hasAssertion ?assertion .\n optional { ?template_iri rdfs:label ?template_iri_label }\n }\n} limit 1000" . . "Returns the nanopublications that introduce, describe, or embed the given term, with view-friendly columns (np / np_label). Used by the /explore page as a resource view (the 'Described in' list)." . . "Get term descriptions" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \n\nselect ?np ?np_label where {\n values ?__pubkey_multi {}\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?__pubkey_multi .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?__pubkey_multi . }\n ?np dct:created ?date .\n ?np npx:introduces|npx:describes|npx:embeds ?_term_iri .\n optional { ?np rdfs:label ?np_label . }\n }\n} order by desc(?date)" . . "Returns nanopublications referencing the given URI in subject, predicate, or object position, with view-friendly columns (part / subject / predicate / object / published_by / date / np). Used by the /references page as a resource view." . . "Get URI references" . . "prefix np: \nprefix npa: \nprefix npx: \nprefix xsd: \nprefix dct: \n\nselect ?part ?subject ?predicate ?object ?published_by ?date ?np (\"^\" as ?np_label) where {\n graph ?g {\n { { bind(?_ref_iri as ?subject) } union { bind(?_ref_iri as ?predicate) } union { bind(?_ref_iri as ?object) } }\n ?subject ?predicate ?object .\n }\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?__pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?__pubkey . }\n ?np dct:created ?date .\n ?np ?__graphpred_iri ?g .\n values ?__graphpred_iri { np:hasAssertion np:hasProvenance np:hasPublicationInfo }\n }\n bind(strafter(str(?__graphpred_iri), \"#has\") as ?part)\n optional {\n graph npa:graph { ?np np:hasPublicationInfo ?__pig_iri . }\n graph ?__pig_iri { ?np dct:creator ?published_by . }\n }\n} limit 100" . . "Returns one row per known space with its label, type IRI and short type name, ordered alphabetically by space label. Intended for the /spaces table view." . . "Get all spaces" . . "prefix rdfs: \nprefix npa: \nprefix npx: \nprefix gen: \n\nselect ?space_iri (sample(?lbl) as ?space_iri_label) (sample(?t) as ?type) (sample(?tlbl) as ?type_label) where {\n graph npa:spacesGraph {\n ?spaceRef a npa:SpaceRef ; npa:spaceIri ?space_iri .\n ?def a npa:SpaceDefinition ;\n npa:forSpaceRef ?spaceRef ;\n npa:viaNanopub ?np .\n }\n graph npa:graph {\n ?np rdfs:label ?lbl .\n ?np npx:hasNanopubType ?t .\n filter(strstarts(str(?t), \"https://w3id.org/kpxl/gen/terms/\"))\n filter(?t != gen:Space)\n }\n filter not exists { graph npa:graph { ?invNp npx:invalidates ?np . } }\n bind(strafter(str(?t), \"https://w3id.org/kpxl/gen/terms/\") as ?tlbl)\n} group by ?space_iri order by lcase(sample(?lbl))" . . "Returns the latest non-invalidated SpaceDefinition per space from the server-materialised spaces repo, joined to the declaring nanopublication for its label and type. View-friendly columns (space_iri / type_label / np)." . . "Get spaces (v2)" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix gen: \n\nselect ?space_iri ?space_iri_label ?type ?type_label ?date ?np (\"^\" as ?np_label) where {\n graph npa:spacesGraph {\n ?spaceRef a npa:SpaceRef ; npa:spaceIri ?space_iri .\n ?def a npa:SpaceDefinition ;\n npa:forSpaceRef ?spaceRef ;\n npa:viaNanopub ?np ;\n dct:created ?date .\n }\n graph npa:graph {\n ?np rdfs:label ?space_iri_label .\n ?np npx:hasNanopubType ?type .\n filter(strstarts(str(?type), \"https://w3id.org/kpxl/gen/terms/\"))\n filter(?type != gen:Space)\n }\n filter not exists { graph npa:graph { ?invNp npx:invalidates ?np . } }\n bind(strafter(str(?type), \"https://w3id.org/kpxl/gen/terms/\") as ?type_label)\n} order by desc(?date)" . . "Returns all nanopublications that declare a grlc query, with the query IRI, its label, its creator, the creation date, and the nanopublication IRI. Designed for rendering as a list/table view." . . "Get all grlc query nanopubs (v2)" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix grlc: \n\nselect ?query_iri ?query_iri_label ?creator ?date ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkeyhash .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkeyhash . }\n ?np dct:created ?date .\n ?np npx:introduces|npx:embeds ?query .\n ?np np:hasAssertion ?a .\n ?np npx:hasNanopubType grlc:grlc-query .\n optional { ?np rdfs:label ?query_iri_label }\n optional { ?np npx:signedBy ?creator . }\n }\n graph ?a {\n ?query grlc:endpoint ?endpoint .\n filter(strstarts(str(?endpoint), \"https://w3id.org/np/l/nanopub-query\"))\n }\n bind(?query as ?query_iri)\n} order by desc(?date)" . . "Counts of MAC FDT FDOs grouped by their specific type (variants, observations, methods). Bounded summary view of the full catalogue." . . "MAC FDT — catalogue summary by type" . . "PREFIX rdfs: \nPREFIX np: \nPREFIX npa: \nPREFIX npx: \nPREFIX dct: \nPREFIX fdof: \nPREFIX mac: \n\nSELECT ?type (COUNT(?thing) AS ?count) WHERE {\n GRAPH npa:graph {\n ?n1 npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists {\n ?np2 npx:invalidates ?n1 ;\n npa:hasValidSignatureForPublicKey ?pubkey .\n }\n ?n1 np:hasAssertion ?a .\n }\n graph ?a {\n ?thing a fdof:FAIRDigitalObject .\n ?thing a ?type .\n FILTER(?type != fdof:FAIRDigitalObject)\n FILTER(STRSTARTS(STR(?type), \"https://w3id.org/spaces/mac/r/ontology/\"))\n }\n} GROUP BY ?type ORDER BY DESC(?count)" . . "Counts of observation FDOs grouped by the method (computational, experimental, or surveillance) that produced them — demonstrating multi-source decentralized attribution." . . "MAC FDT — observations per method" . . "PREFIX rdfs: \nPREFIX np: \nPREFIX npa: \nPREFIX npx: \nPREFIX dct: \nPREFIX fdof: \nPREFIX mac: \n\nSELECT ?method (COUNT(?obs) AS ?count) WHERE {\n GRAPH npa:graph {\n ?n1 npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists {\n ?np2 npx:invalidates ?n1 ;\n npa:hasValidSignatureForPublicKey ?pubkey .\n }\n ?n1 np:hasAssertion ?a .\n }\n graph ?a {\n ?obs ?methodPred ?method .\n VALUES ?methodPred { mac:hasPredictionMethod mac:hasExperimentalMethod mac:hasSurveillanceMethod }\n }\n} GROUP BY ?method ORDER BY DESC(?count)" . . "Counts of Spike RBD variants grouped by WHO risk designation (VOC / VOI / VUM), via their WHO classification observation FDOs." . . "MAC FDT — variants by WHO classification" . . "PREFIX rdfs: \nPREFIX np: \nPREFIX npa: \nPREFIX npx: \nPREFIX dct: \nPREFIX fdof: \nPREFIX mac: \n\nSELECT ?whoClass (COUNT(?variant) AS ?count) WHERE {\n GRAPH npa:graph {\n ?n1 npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists {\n ?np2 npx:invalidates ?n1 ;\n npa:hasValidSignatureForPublicKey ?pubkey .\n }\n ?n1 np:hasAssertion ?a .\n }\n graph ?a {\n ?obs a mac:WHOVariantClassification .\n ?obs mac:hasWHOClassification ?whoClass .\n ?obs mac:isObservationOf ?variant .\n }\n} GROUP BY ?whoClass ORDER BY DESC(?count)" . . "Returns all users that have published a self-introduction but have no approved (trust-state-loaded) account, with their display name." . . "❓ Non-Approved Users" . . "prefix np: \nprefix npx: \nprefix npa: \nprefix foaf: \n\nselect ?user_iri (sample(?name) as ?user_iri_label) where {\n graph npa:graph {\n ?intronp npa:hasValidSignatureForPublicKey ?pk ; np:hasAssertion ?a .\n filter not exists { ?x npx:invalidates ?intronp ; npa:hasValidSignatureForPublicKey ?pk . }\n }\n graph ?a {\n ?kd npx:declaredBy ?user_iri .\n optional { ?user_iri foaf:name ?name }\n }\n minus {\n service {\n graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?g . }\n graph ?g { ?acct npa:agent ?user_iri ; npa:trustStatus npa:loaded . }\n }\n }\n} group by ?user_iri order by lcase(str(sample(?name)))" . . "Returns all approved (trust-state-loaded) users that are not software agents, with their display name." . . "👤 Human Users" . . "prefix np: \nprefix npx: \nprefix npa: \nprefix foaf: \n\nselect ?user_iri (sample(?name) as ?user_iri_label) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?g . }\n graph ?g { ?acct a npa:AccountState ; npa:agent ?user_iri ; npa:trustStatus npa:loaded . }\n service {\n graph ?a { ?kd npx:declaredBy ?user_iri . }\n filter not exists { graph ?a2 { ?user_iri a npx:SoftwareAgent } }\n optional { graph ?a { ?user_iri foaf:name ?name } }\n }\n} group by ?user_iri order by lcase(str(sample(?name)))" . . "Returns all approved (trust-state-loaded) users that are software agents, with their display name." . . "🤖 Software Agents" . . "prefix np: \nprefix npx: \nprefix npa: \nprefix foaf: \n\nselect ?user_iri (sample(?name) as ?user_iri_label) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?g . }\n graph ?g { ?acct a npa:AccountState ; npa:agent ?user_iri ; npa:trustStatus npa:loaded . }\n service {\n graph ?a { ?kd npx:declaredBy ?user_iri . }\n filter exists { graph ?a2 { ?user_iri a npx:SoftwareAgent } }\n optional { graph ?a { ?user_iri foaf:name ?name } }\n }\n} group by ?user_iri order by lcase(str(sample(?name)))" . . "Returns the trust-state-validated (agent, public-key-hash) pairs for the given agent(s), from npa:AccountState in the current space-state graph of the spaces repo (/repo/spaces). Pass one or more agent IRIs (e.g. ORCIDs)." . . "Get agent pubkey hashes" . . "prefix npa: \n\nselect distinct (?_agent_multi_iri as ?agent) ?pkh where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }\n values ?_agent_multi_iri {}\n graph ?g {\n ?acct a npa:AccountState ;\n npa:agent ?_agent_multi_iri ;\n npa:pubkey ?pkh .\n }\n}" . . "Returns the trust-state-validated (agent, public-key-hash) pairs of the given space(s)' admins, by joining the admin RoleInstantiations to npa:AccountState in the current space-state graph of the spaces repo (/repo/spaces). Pass one or more space IRIs." . . "Get space admin pubkey hashes" . . "prefix npa: \nprefix gen: \n\nselect distinct ?agent ?pkh where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }\n values ?_space_multi_iri {}\n graph ?g {\n ?ri a gen:RoleInstantiation ;\n npa:inverseProperty gen:hasAdmin ;\n npa:forSpace ?_space_multi_iri ;\n npa:forAgent ?agent .\n ?acct a npa:AccountState ;\n npa:agent ?agent ;\n npa:pubkey ?pkh .\n }\n}" . . "Returns the admins of the given space(s): the trust-state-validated admin RoleInstantiations (npa:inverseProperty gen:hasAdmin) from the current space-state graph of the spaces repo (/repo/spaces), with each admin agent and the nanopublication that instantiated the role. Pass one or more space IRIs (e.g. a space and its alternative IDs)." . . "Get space admins" . . "prefix npa: \nprefix gen: \n\nselect distinct ?agent ?np (\"^\" as ?np_label) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }\n values ?_space_multi_iri {}\n graph ?g {\n ?ri a gen:RoleInstantiation ;\n npa:inverseProperty gen:hasAdmin ;\n npa:forSpace ?_space_multi_iri ;\n npa:forAgent ?agent ;\n npa:viaNanopub ?np .\n }\n}" . . "Returns the non-admin member RoleInstantiations of the given space(s) from the extraction graph (npa:spacesGraph) of the spaces repo (/repo/spaces): each member agent, the nanopublication that instantiated the membership, and the role's regular/inverse predicate. Admin RIs are excluded and invalidated nanopubs are filtered out. The caller is expected to gate members by role-predicate match. Pass one or more space IRIs." . . "Get space members" . . "prefix npa: \nprefix npx: \nprefix gen: \n\nselect ?member ?regProp ?invProp ?np (\"^\" as ?np_label) where {\n values ?_space_multi_iri {}\n graph npa:spacesGraph {\n ?ri a gen:RoleInstantiation ;\n npa:forSpace ?_space_multi_iri ;\n npa:forAgent ?member ;\n npa:viaNanopub ?np .\n optional { ?ri npa:regularProperty ?regProp }\n optional { ?ri npa:inverseProperty ?invProp }\n filter not exists { ?ri npa:inverseProperty gen:hasAdmin }\n }\n filter not exists { graph npa:graph { ?invNp npx:invalidates ?np . } }\n}" . . "Returns server-validated maintained resources (npa:isMaintainedBy) from the current space-state graph of the spaces repo (/repo/spaces), with each resource's maintainer space, declaring nanopublication, label, optional namespace, and date. Only the current-state declarations are returned." . . "Get maintained resources from spaces repo" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix gen: \n\nselect ?resource ?space ?label ?namespace ?date ?np (\"^\" as ?np_label) where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }\n graph ?g { ?resource npa:isMaintainedBy ?space . }\n graph npa:spacesGraph {\n ?d a npa:MaintainedResourceDeclaration ;\n npa:resourceIri ?resource ;\n npa:maintainerSpace ?space ;\n npa:viaNanopub ?np ;\n dct:created ?date .\n }\n graph npa:graph {\n ?np np:hasAssertion ?a .\n optional { ?np rdfs:label ?label }\n }\n optional { graph ?a { ?resource gen:hasNamespace ?namespace } }\n} order by desc(?date)" . . "Returns all child/parent space pairs (npa:isSubSpaceOf) from the current space-state graph of the server-materialised spaces repo (/repo/spaces)." . . "Get sub-space links" . . "prefix npa: \n\nselect ?child ?parent where {\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . }\n graph ?g { ?child npa:isSubSpaceOf ?parent . }\n}" . . "Returns all provenance-event claims (Colonial Collections nanopubs typed #ProvenanceEventVersion1) describing a CIDOC-CRM E10_Transfer_of_Custody. Columns: event type (Getty AAT) and its label, affected object (with short label), narrative text and its language, attributed community group, individual creator, and date. Sorted from most recent first." . . "Get Colonial Collections provenance events" . . "prefix rdf: \nprefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix xsd: \nprefix dct: \nprefix prov: \nprefix crm: \n\nselect ?event_type ?event_type_label ?source ?source_label ?narrative ?lang ?group ?group_label ?creator ?creator_label ?date ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?pubkey ;\n dct:created ?datetime ;\n np:hasAssertion ?ag ;\n np:hasProvenance ?pg ;\n np:hasPublicationInfo ?pig .\n filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }\n filter not exists { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n }\n bind(substr(str(?datetime), 1, 10) as ?date)\n graph ?pig {\n ?np a .\n }\n graph ?ag {\n ?ev a crm:E10_Transfer_of_Custody .\n optional {\n ?ev crm:P2_has_type ?event_type .\n optional { ?event_type rdfs:label ?event_type_label }\n }\n optional {\n ?ev crm:P30_transferred_custody_of ?source .\n bind(substr(replace(str(?source), \"^.*/\", \"\"), 1, 8) as ?source_label)\n }\n optional {\n ?ev crm:P67i_is_referred_to_by ?ling .\n ?ling crm:P190_has_symbolic_content ?narrative_lit .\n bind(str(?narrative_lit) as ?narrative)\n bind(lang(?narrative_lit) as ?lang)\n }\n }\n optional {\n graph ?pg {\n ?ag prov:wasAttributedTo ?creator .\n optional { ?creator rdfs:label ?creator_label }\n optional {\n ?creator prov:actedOnBehalfOf ?group .\n optional { ?group rdfs:label ?group_label }\n }\n }\n }\n}\norder by desc(?datetime)" . . "Returns all Web Annotations (oa:Annotation) contained in Colonial Collections nanopubs, together with their specific content subtype, the scope (which field of the target object the annotation refines), the source object (with a short label derived from its identifier), the body text and its language, the community group on whose behalf the annotation was made, the individual creator, and the creation date. Sorted from most recent first." . . "Get Colonial Collections annotations" . . "prefix rdf: \nprefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix xsd: \nprefix dct: \nprefix oa: \nprefix prov: \n\nselect ?subtype ?subtype_label ?scope ?scope_label ?source ?source_label ?body ?lang ?group ?group_label ?creator ?creator_label ?date ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?pubkey ;\n dct:created ?datetime ;\n np:hasAssertion ?ag ;\n np:hasProvenance ?pg ;\n np:hasPublicationInfo ?pig .\n filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }\n filter not exists { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n }\n bind(substr(str(?datetime), 1, 10) as ?date)\n graph ?pig {\n ?np a ?subtype .\n filter(strstarts(str(?subtype), \"https://n2t.net/ark:/27023/9819f32405815dc7f2e0ecd9d8a9e604#\") && str(?subtype) != \"https://n2t.net/ark:/27023/9819f32405815dc7f2e0ecd9d8a9e604#Nanopub\")\n bind(strafter(str(?subtype), \"#\") as ?subtype_label)\n }\n graph ?ag {\n ?anno a oa:Annotation ;\n oa:hasBody ?b ;\n oa:hasTarget ?t .\n ?b rdf:value ?body_lit .\n bind(str(?body_lit) as ?body)\n bind(lang(?body_lit) as ?lang)\n optional {\n ?t oa:hasScope ?scope .\n bind(if(contains(str(?scope), \"#\"), strafter(str(?scope), \"#\"), str(?scope)) as ?scope_label)\n }\n optional {\n ?t oa:hasSource ?source .\n bind(substr(replace(str(?source), \"^.*/\", \"\"), 1, 8) as ?source_label)\n }\n }\n optional {\n graph ?pg {\n ?ag prov:wasAttributedTo ?creator .\n optional { ?creator rdfs:label ?creator_label }\n optional {\n ?creator prov:actedOnBehalfOf ?group .\n optional { ?group rdfs:label ?group_label }\n }\n }\n }\n}\norder by desc(?datetime)" . . "Returns all agenda items belonging to the given event, with label, description, related spaces, links, creator, and nanopub link." . . "Get agenda items for event" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix schema: \nprefix gen: \n\nselect ?item ?item_label ?description (group_concat(distinct str(?space); separator=\" \") as ?spaces_multi_iri) (group_concat(distinct concat('link'); separator=\", \") as ?link) ?creator ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }\n ?np dct:created ?npdate .\n ?np dct:creator ?creator .\n ?np np:hasAssertion ?a .\n ?np npx:introduces ?item .\n }\n values ?_event_multi_iri {}\n graph ?a {\n ?item a gen:AgendaItem .\n ?item dct:isPartOf ?_event_multi_iri .\n optional { ?item rdfs:label ?item_label . }\n optional { ?item dct:description ?description . }\n optional { ?item schema:about ?space . }\n optional { ?item rdfs:seeAlso ?link . }\n }\n}\ngroup by ?item ?item_label ?description ?creator ?np ?npdate\norder by asc(?npdate)" . . "Returns all status updates belonging to the given event, with label, description, concerned spaces, links, creator, and nanopub link." . . "Get status updates for event" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix schema: \nprefix gen: \n\nselect ?item ?item_label ?description (group_concat(distinct str(?space); separator=\" \") as ?spaces_multi_iri) (group_concat(distinct concat('link'); separator=\", \") as ?link) ?creator ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }\n ?np dct:created ?npdate .\n ?np dct:creator ?creator .\n ?np np:hasAssertion ?a .\n ?np npx:introduces ?item .\n }\n values ?_event_multi_iri {}\n graph ?a {\n ?item a gen:StatusUpdate .\n ?item dct:isPartOf ?_event_multi_iri .\n ?item schema:about ?space .\n optional { ?item rdfs:label ?item_label . }\n optional { ?item dct:description ?description . }\n optional { ?item rdfs:seeAlso ?link . }\n }\n}\ngroup by ?item ?item_label ?description ?creator ?np ?npdate\norder by asc(?npdate)" . . "Will list all Snakemake report registrations created by this template: https://w3id.org/np/RAsmNjwvzjYfc8Hson0gyjSL6Oov3nZZEfRy7TOFtO5I8 - will need update if the template updates." . . "Snakemake Report Registrations" . . "PREFIX np: \r\nPREFIX npa: \r\nPREFIX npx: \r\nPREFIX dct: \r\n\r\nSELECT DISTINCT ?np ?date\r\nWHERE {\r\n # any triple (any graph) where the template appears as object\r\n ?np ?p .\r\n # get its creation date (admin graph)\r\n GRAPH npa:graph { ?np dct:created ?date }\r\n}\r\nLIMIT 100" . . "Will return all workflow registered with https://w3id.org/np/RAOT7z3RA0XYlHIikne8rfUUYZrtHyrzXBD1HpI_GvcRk - might need updates from time to time." . . "Snakemake Workflow Registrations" . . "PREFIX np: \r\nPREFIX npa: \r\nPREFIX npx: \r\nPREFIX dct: \r\n\r\nSELECT DISTINCT ?np ?date\r\nWHERE {\r\n # any triple (any graph) where the template appears as object\r\n ?np ?p .\r\n # get its creation date (admin graph)\r\n GRAPH npa:graph { ?np dct:created ?date }\r\n}\r\nLIMIT 100" . . "This query returns the sub-resources of a Space or Maintained Resource." . . "Get sub-resources of Space or Maintained Resource" . . "prefix rdfs: \r\nprefix dct: \r\nprefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix gen: \r\n\r\nselect ?resource ?resource_label ?entity_main_type ?np where {\r\n graph npa:graph {\r\n values ?entity_main_type { gen:Space gen:MaintainedResource }\r\n ?np npx:hasNanopubType ?entity_main_type .\r\n ?np npx:introduces ?resource .\r\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\r\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\r\n ?np dct:created ?date .\r\n ?np np:hasAssertion ?a .\r\n filter not exists {\r\n ?np2 npx:introduces ?resource .\r\n ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 .\r\n filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }\r\n ?np2 dct:created ?date2 .\r\n filter( ?date2 > ?date )\r\n }\r\n }\r\n graph ?a {\r\n { {\r\n values ?_super_resource_multi_iri {}\r\n ?resource a ?entity_main_type .\r\n filter(strstarts(str(?resource), concat(str(?_super_resource_multi_iri), \"/\")))\r\n bind(substr(str(?resource), strlen(str(?_super_resource_multi_iri)) + 2, strlen(str(?resource)) - strlen(str(?_super_resource_multi_iri)) - 1) as ?suffix)\r\n filter(!contains(?suffix, \"/\"))\r\n } union {\r\n values ?_super_resource_multi_iri {}\r\n ?resource a gen:Space .\r\n ?resource dct:isPartOf ?_super_resource_multi_iri .\r\n } union {\r\n values ?_super_resource_multi_iri {}\r\n ?resource a gen:MaintainedResource .\r\n ?resource gen:isMaintainedBy ?_super_resource_multi_iri .\r\n } }\r\n filter exists { ?resource a ?__resource_type_iri }\r\n ?resource rdfs:label ?resource_label .\r\n }\r\n} order by ?resource_label" . . "Returns all resource-to-archive-URL relations (Wikidata P1065), with the source nanopublication and creation timestamp, ordered by latest first." . . "Get archive URLs" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix wd: \n\nselect ?resource ?archive_url ?date ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }\n ?np np:hasAssertion ?a .\n ?np dct:created ?date .\n }\n graph ?a {\n ?resource wd:P1065 ?archive_url .\n }\n} order by desc(?date)" . . "lists all nanopubs mentioning the Snakemake Workflow Management System" . . "Snakemake Mentionings" . . "PREFIX np: \r\nPREFIX dct: \r\nPREFIX npa: \r\nPREFIX npx: \r\nprefix kpxl: \r\nSELECT DISTINCT ?np ?assertion ?p ?o \r\nWHERE {\r\n ?np a np:Nanopublication ;\r\n np:hasAssertion ?assertion .\r\n\r\n GRAPH ?assertion {\r\n ?s ?p ?o .\r\n\r\n FILTER (\r\n isLiteral(?o) &&\r\n REGEX(STR(?o), \"snakemake\", \"i\")\r\n )\r\n }\r\n}\r\n\r\n#LIMIT 100" . . "Lists all significant persons (wd:P3342) for NFDI consortiums (wd:Q98270496), sorted by creation date (latest first)." . . "Get significant persons for NFDI consortiums" . . "prefix rdf: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \nprefix wd: \n\nselect ?consortium ?consortium_label ?person ?date ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np np:hasAssertion ?a .\n ?np np:hasPublicationInfo ?pi .\n ?np dct:created ?date .\n }\n graph ?a {\n ?consortium a wd:Q98270496 ;\n wd:P3342 ?person .\n }\n optional {\n graph ?pi { ?consortium nt:hasLabelFromApi ?api_label . }\n bind(if(contains(?api_label, \" - \"), strbefore(?api_label, \" - \"), ?api_label) as ?consortium_label)\n }\n}\norder by desc(?date)" . . "This query allows for searching for resources (FERs etc.) together with the info about whether GO FAIR qualified them." . . "Find GO FAIR qualified things" . . "prefix rdfs: \r\nprefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix xsd: \r\nprefix dct: \r\nprefix fip: \r\nprefix prov: \r\n\r\nselect distinct ?thing ?label ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np (group_concat(distinct ?recommender; separator=\" \") as ?recommenders) (group_concat(distinct ?recommendation_np; separator=\" \") as ?recommendation_nps) (count(distinct ?recommender) as ?recommender_count) (sample(?fairAssessmentLevel) as ?fairAssessmentLevel) (sample(?fairAssessmentLevelNp) as ?fairAssessmentLevelNp) where {\r\n graph npa:graph {\r\n npa:hasValidSignatureForPublicKey ?curators_np_pk .\r\n ?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk .\r\n filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . }\r\n ?latest_curators_np np:hasAssertion ?latest_curators_assertion .\r\n }\r\n graph npa:networkGraph {\r\n ?latest_curators_np (npx:supersedes)* .\r\n filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np }\r\n }\r\n \r\n graph npa:graph {\r\n ?np npx:hasNanopubType ?__type_iri .\r\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\r\n optional { ?retraction npx:retracts ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\r\n optional { ?newversion npx:supersedes ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\r\n ?np (npx:introduces|npx:describes) ?thing .\r\n ?np rdfs:label ?label .\r\n ?np dct:description ?description .\r\n ?np dct:created ?date .\r\n filter(str(?date) > \"2022\")\r\n }\r\n bind(concat(\" \",lcase(str(?label)),\" \",lcase(str(?description)),\" \") as ?text)\r\n filter( contains(?text, lcase(str(?_searchterm))) )\r\n\r\n optional {\r\n graph npa:graph {\r\n ?disapproval npa:hasValidSignatureForPublicKey ?dpubkey .\r\n }\r\n graph ?latest_curators_assertion {\r\n ?dpubkeys npx:hasPublicKey ?dpubkey .\r\n }\r\n graph npa:graph {\r\n filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . }\r\n ?disapproval np:hasAssertion ?da .\r\n }\r\n graph ?da {\r\n ?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np .\r\n }\r\n } filter(!bound(?disapproval)) # Faster than \"filter not exists\" for some reason\r\n\r\n optional {\r\n graph npa:graph {\r\n ?recommendation_np npx:hasNanopubType fip:recommended-by .\r\n ?recommendation_np npa:hasValidSignatureForPublicKey ?rpubkey .\r\n filter not exists { ?recommendation_np_x npx:invalidates ?recommendation_np ; npa:hasValidSignatureForPublicKey ?rpubkey . }\r\n ?recommendation_np np:hasAssertion ?ra .\r\n ?recommendation_np np:hasProvenance ?rp .\r\n }\r\n graph ?ra {\r\n ?thing fip:recommended-by ?recommender .\r\n }\r\n graph ?rp {\r\n ?ra prov:wasDerivedFrom ?rfip_np .\r\n }\r\n graph npa:graph {\r\n ?rfip_np npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile .\r\n ?rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey .\r\n ?latest_rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey .\r\n filter not exists { ?latest_rfip_npx npx:invalidates ?latest_rfip_np ; npa:hasValidSignatureForPublicKey ?rfip_pubkey . }\r\n }\r\n graph npa:networkGraph {\r\n ?latest_rfip_np (npx:supersedes)* ?rfip_np .\r\n }\r\n graph ?rfip_qa {\r\n ?rfip_qualifier npx:qualifies ?latest_rfip_np .\r\n }\r\n graph npa:graph {\r\n ?rfip_qualification_np np:hasAssertion ?rfip_qa .\r\n ?rfip_qualification_np npx:hasNanopubType npx:qualifies .\r\n ?rfip_qualification_np npa:hasValidSignatureForPublicKey ?rfip_qpubkey .\r\n filter not exists { ?rfip_qualification_np_x npx:invalidates ?rfip_qualification_np ; npa:hasValidSignatureForPublicKey ?rfip_qpubkey . }\r\n }\r\n graph ?latest_curators_assertion {\r\n ?rfip_qpubkeys npx:hasPublicKey ?rfip_qpubkey .\r\n }\r\n }\r\n optional {\r\n graph npa:graph {\r\n ?qualification_np npx:hasNanopubType npx:qualifies .\r\n ?qualification_np npa:hasValidSignatureForPublicKey ?qpubkey .\r\n }\r\n graph ?latest_curators_assertion {\r\n ?qpubkeys npx:hasPublicKey ?qpubkey .\r\n }\r\n graph npa:graph {\r\n filter not exists { ?qualification_np_x npx:invalidates ?qualification_np ; npa:hasValidSignatureForPublicKey ?qpubkey . }\r\n ?qualification_np np:hasAssertion ?qa .\r\n }\r\n graph ?qa {\r\n ?qualifier npx:qualifies ?np .\r\n }\r\n }\r\n\r\n optional {\r\n graph npa:graph {\r\n ?fairAssessmentLevelNp npx:hasNanopubType fip:has-FAIR-assessment .\r\n ?fairAssessmentLevelNp npa:hasValidSignatureForPublicKey ?lpubkey .\r\n }\r\n graph ?latest_curators_assertion {\r\n ?lpubkeys npx:hasPublicKey ?lpubkey .\r\n }\r\n graph npa:graph {\r\n filter not exists { ?fairAssessmentLevelNp_x npx:invalidates ?fairAssessmentLevelNp ; npa:hasValidSignatureForPublicKey ?lpubkey . }\r\n ?fairAssessmentLevelNp np:hasAssertion ?la .\r\n }\r\n graph ?la {\r\n ?thing fip:has-FAIR-assessment ?fairAssessmentLevel .\r\n }\r\n } filter(!bound(?levelNp)) # Faster than \"filter not exists\" for some reason\r\n\r\n}\r\ngroup by ?thing ?label ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np\r\norder by desc(?recommender_count) asc(?label)" . . "This query returns all RO-Crate nanopubs. Including the old and new type." . . "Get all RO-Crate nanopubs" . . "prefix rdfs: \r\nprefix dct: \r\nprefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix kpxl: \r\n\r\n# find all ro-crates, with old and new nanopub type\r\nselect distinct ?rocrate ?date ?np where { \r\n graph npa:graph {\r\n {?np npx:hasNanopubType kpxl:RoCrateNanopub .} union {?np npx:hasNanopubType npx:RoCrateNanopub .}\r\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkeyhash .\r\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyhash . }\r\n ?np dct:created ?date .\r\n ?np npx:introduces ?rocrate .\r\n ?np npx:signedBy ?agent_iri .\r\n }\r\n}\r\norder by desc(?date)" . . "This query allows for searching for resources (FERs etc.) together with the info about whether GO FAIR qualified them." . . "Find GO FAIR qualified things (only valid entries)" . . "prefix rdfs: \r\nprefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix xsd: \r\nprefix dct: \r\nprefix fip: \r\nprefix prov: \r\n\r\nselect distinct ?thing ?label ?description ?np ?date ?pubkey ?qualifier ?qualification_np (group_concat(distinct ?recommender; separator=\" \") as ?recommenders) (group_concat(distinct ?recommendation_np; separator=\" \") as ?recommendation_nps) (count(distinct ?recommender) as ?recommender_count) (sample(?fairAssessmentLevel) as ?fairAssessmentLevel) (sample(?fairAssessmentLevelNp) as ?fairAssessmentLevelNp) where {\r\n graph npa:graph {\r\n npa:hasValidSignatureForPublicKey ?curators_np_pk .\r\n ?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk .\r\n filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . }\r\n ?latest_curators_np np:hasAssertion ?latest_curators_assertion .\r\n }\r\n graph npa:networkGraph {\r\n ?latest_curators_np (npx:supersedes)* .\r\n filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np }\r\n }\r\n \r\n graph npa:graph {\r\n ?np npx:hasNanopubType ?__type_iri .\r\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\r\n filter not exists { ?retraction npx:retracts ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\r\n filter not exists { ?newversion npx:supersedes ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\r\n ?np (npx:introduces|npx:describes) ?thing .\r\n ?np rdfs:label ?label .\r\n ?np dct:description ?description .\r\n ?np dct:created ?date .\r\n filter(str(?date) > \"2022\")\r\n }\r\n bind(concat(\" \",lcase(str(?label)),\" \",lcase(str(?description)),\" \") as ?text)\r\n filter( contains(?text, lcase(str(?_searchterm))) )\r\n \r\n optional {\r\n graph npa:graph {\r\n ?disapproval npa:hasValidSignatureForPublicKey ?dpubkey .\r\n }\r\n graph ?latest_curators_assertion {\r\n ?dpubkeys npx:hasPublicKey ?dpubkey .\r\n }\r\n graph npa:graph {\r\n filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . }\r\n ?disapproval np:hasAssertion ?da .\r\n }\r\n graph ?da {\r\n ?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np .\r\n }\r\n } filter(!bound(?disapproval)) # Faster than \"filter not exists\" for some reason\r\n\r\n optional {\r\n graph npa:graph {\r\n ?recommendation_np npx:hasNanopubType fip:recommended-by .\r\n ?recommendation_np npa:hasValidSignatureForPublicKey ?rpubkey .\r\n filter not exists { ?recommendation_np_x npx:invalidates ?recommendation_np ; npa:hasValidSignatureForPublicKey ?rpubkey . }\r\n ?recommendation_np np:hasAssertion ?ra .\r\n ?recommendation_np np:hasProvenance ?rp .\r\n }\r\n graph ?ra {\r\n ?thing fip:recommended-by ?recommender .\r\n }\r\n graph ?rp {\r\n ?ra prov:wasDerivedFrom ?rfip_np .\r\n }\r\n graph npa:graph {\r\n ?rfip_np npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile .\r\n ?rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey .\r\n ?latest_rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey .\r\n filter not exists { ?latest_rfip_npx npx:invalidates ?latest_rfip_np ; npa:hasValidSignatureForPublicKey ?rfip_pubkey . }\r\n }\r\n graph npa:networkGraph {\r\n ?latest_rfip_np (npx:supersedes)* ?rfip_np .\r\n }\r\n graph ?rfip_qa {\r\n ?rfip_qualifier npx:qualifies ?latest_rfip_np .\r\n }\r\n graph npa:graph {\r\n ?rfip_qualification_np np:hasAssertion ?rfip_qa .\r\n ?rfip_qualification_np npx:hasNanopubType npx:qualifies .\r\n ?rfip_qualification_np npa:hasValidSignatureForPublicKey ?rfip_qpubkey .\r\n filter not exists { ?rfip_qualification_np_x npx:invalidates ?rfip_qualification_np ; npa:hasValidSignatureForPublicKey ?rfip_qpubkey . }\r\n }\r\n graph ?latest_curators_assertion {\r\n ?rfip_qpubkeys npx:hasPublicKey ?rfip_qpubkey .\r\n }\r\n }\r\n optional {\r\n graph npa:graph {\r\n ?qualification_np npx:hasNanopubType npx:qualifies .\r\n ?qualification_np npa:hasValidSignatureForPublicKey ?qpubkey .\r\n }\r\n graph ?latest_curators_assertion {\r\n ?qpubkeys npx:hasPublicKey ?qpubkey .\r\n }\r\n graph npa:graph {\r\n filter not exists { ?qualification_np_x npx:invalidates ?qualification_np ; npa:hasValidSignatureForPublicKey ?qpubkey . }\r\n ?qualification_np np:hasAssertion ?qa .\r\n }\r\n graph ?qa {\r\n ?qualifier npx:qualifies ?np .\r\n }\r\n }\r\n\r\n optional {\r\n graph npa:graph {\r\n ?fairAssessmentLevelNp npx:hasNanopubType fip:has-FAIR-assessment .\r\n ?fairAssessmentLevelNp npa:hasValidSignatureForPublicKey ?lpubkey .\r\n }\r\n graph ?latest_curators_assertion {\r\n ?lpubkeys npx:hasPublicKey ?lpubkey .\r\n }\r\n graph npa:graph {\r\n filter not exists { ?fairAssessmentLevelNp_x npx:invalidates ?fairAssessmentLevelNp ; npa:hasValidSignatureForPublicKey ?lpubkey . }\r\n ?fairAssessmentLevelNp np:hasAssertion ?la .\r\n }\r\n graph ?la {\r\n ?thing fip:has-FAIR-assessment ?fairAssessmentLevel .\r\n }\r\n } filter(!bound(?levelNp)) # Faster than \"filter not exists\" for some reason\r\n\r\n}\r\ngroup by ?thing ?label ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np\r\norder by desc(?recommender_count) asc(?label)" . . "This query returns all RO-Crate nanopubs." . . "Get all RO-Crate Nanopubs (new type)" . . "prefix rdfs: prefix dct: prefix np: prefix npa: prefix npx: prefix kpxl: select distinct ?rocrate ?date (?__agent_iri as ?agent) ?np (?__pubkeyhash as ?pubkey) where { graph npa:graph { ?np npx:hasNanopubType kpxl:RoCrateNanopub . ?np npa:hasValidSignatureForPublicKeyHash ?__pubkeyhash . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?__pubkeyhash . } ?np dct:created ?date . ?np npx:introduces ?rocrate . ?np npx:signedBy ?__agent_iri . } } order by desc(?date)" . . "This query returns all RO-Crate nanopubs." . . "Get all RO-Crate Nanopubs (new type)" . . "prefix rdfs: prefix dct: prefix np: prefix npa: prefix npx: prefix kpxl: select distinct ?rocrate ?date (?__agent_iri as ?agent) ?np (?__pubkeyhash as ?pubkey) where { graph npa:graph { ?np npx:hasNanopubType kpxl:RoCrateNanopub . ?np npa:hasValidSignatureForPublicKeyHash ?__pubkeyhash . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?__pubkeyhash . } ?np dct:created ?date . ?np npx:introduces ?rocrate . ?np npx:signedBy ?__agent_iri . } } order by desc(?date)" . . "This query returns all RO-Crate nanopubs." . . "Get all RO-Crate Nanopubs (old type)" . . "prefix rdfs: prefix dct: prefix np: prefix npa: prefix npx: select distinct ?rocrate ?date ?np where { graph npa:graph { ?np npx:hasNanopubType npx:RoCrateNanopub . filter not exists { ?npx npx:invalidates ?np } ?np dct:created ?date . ?np npx:introduces ?rocrate . }}order by desc(?date)" . . "This query returns all RO-Crate nanopubs." . . "Get all RO-Crate Nanopubs (old type)" . . "prefix rdfs: prefix dct: prefix np: prefix npa: prefix npx: select distinct ?rocrate ?date ?np where { graph npa:graph { ?np npx:hasNanopubType npx:RoCrateNanopub . filter not exists { ?npx npx:invalidates ?np } ?np dct:created ?date . ?np npx:introduces ?rocrate . }}order by desc(?date)" . . "This query returns all RO-Crate nanopubs." . . "Get all RO-Crate Nanopubs (old type)" . . "prefix rdfs: prefix dct: prefix np: prefix npa: prefix npx: select distinct ?rocrate ?date ?np where { graph npa:graph { ?np npx:hasNanopubType npx:RoCrateNanopub . filter not exists { ?npx npx:invalidates ?np } ?np dct:created ?date . ?np npx:introduces ?rocrate . }}order by desc(?date)" . . "This query returns the FAQ entries (questions and answers) of an entity, including source nanopub and date. When several nanopubs declare the same FAQ entry, only the most recent one is returned." . . "Get FAQ entries of an entity" . . "prefix rdf: \nprefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix schema: \nprefix gen: \n\nselect ?title ?content ?date ?faq ?np where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np dct:created ?date .\n ?np np:hasAssertion ?a .\n }\n graph ?a {\n ?faq rdf:type schema:Question .\n ?faq rdfs:label ?title .\n ?faq gen:hasContent ?content .\n values ?_resource_multi_iri {}\n ?faq dct:isPartOf ?_resource_multi_iri .\n optional { ?faq gen:hasPositionString ?position }\n }\n filter not exists {\n graph npa:graph {\n ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 .\n filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }\n ?np2 dct:created ?date2 .\n ?np2 np:hasAssertion ?a2 .\n filter (?date2 > ?date)\n }\n graph ?a2 {\n ?faq rdf:type schema:Question .\n }\n }\n}\norder by ?position ?title" . . "This query returns all FIP declarations that are part of the most recent versions of the FIP indexes, as these nanopubs are produced by the FIP Wizard." . . "Get FIP declarations in indexes" . . "prefix rdfs: \r\nprefix fip: \r\nprefix dct: \r\nprefix dce: \r\nprefix npa: \r\nprefix npx: \r\nprefix np: \r\nprefix prov: \r\n\r\nselect ?fip_index ?fip_title ?fip_source ?decl_np where {\r\n graph npa:graph {\r\n ?fip_index npx:hasNanopubType npx:NanopubIndex .\r\n ?fip_index npa:hasValidSignatureForPublicKey ?pubkey .\r\n filter not exists { ?index_np_x npx:invalidates ?fip_index ; npa:hasValidSignatureForPublicKey ?pubkey . }\r\n ?fip_index np:hasAssertion ?index_a .\r\n ?fip_index np:hasPublicationInfo ?index_i .\r\n ?fip_index rdfs:label ?fip_title .\r\n ?fip_index dct:created ?index_date .\r\n ?decl_np npa:hasValidSignatureForPublicKey ?decl_pubkey .\r\n filter not exists { ?decl_np_x npx:invalidates ?decl_np ; npa:hasValidSignatureForPublicKey ?decl_pubkey . }\r\n ?decl_np npx:hasNanopubType fip:FIP-Declaration .\r\n ?decl_np dct:created ?date .\r\n }\r\n graph ?index_a {\r\n ?fip_index npx:includesElement ?decl_np .\r\n }\r\n graph ?index_i {\r\n ?fip_index prov:wasDerivedFrom ?fip_source .\r\n }\r\n filter not exists {\r\n graph npa:graph { # Moving this to a separate graph for performance reasons with RDF4J LMDB engine\r\n # Matching on the title string is an ugly hack:\r\n ?fip_newer_index rdfs:label ?fip_title .\r\n }\r\n graph npa:graph {\r\n ?fip_newer_index npa:hasValidSignatureForPublicKey ?pubkey .\r\n filter not exists { ?fip_newer_index_x npx:invalidates ?fip_newer_index ; npa:hasValidSignatureForPublicKey ?pubkey . }\r\n ?fip_newer_index dct:created ?newer_date .\r\n }\r\n filter(?newer_date > ?index_date).\r\n }\r\n}" . . "Lists all entities that have been annotated by nanopubs containing oa:Annotation, ordered by the number of annotation nanopubs targeting each entity." . . "Get annotated entities" . . "prefix np: \nprefix npa: \nprefix npx: \nprefix oa: \n\nselect ?entity (count(?np) as ?annotation_count)\n (group_concat(str(?np); separator=\" \") as ?nps_multi_iri)\n (group_concat(\"^\"; separator=\"\\n\") as ?nps_label_multi)\nwhere {\n {\n select distinct ?entity ?np where {\n graph npa:graph {\n ?np np:hasAssertion ?a .\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n }\n graph ?a {\n ?annotation a oa:Annotation ;\n oa:hasTarget ?target .\n ?target oa:hasSource ?entity .\n }\n }\n }\n}\ngroup by ?entity\norder by desc(?annotation_count)" . . "This query returns the papers co-authored by team members of a given Space." . . "Get papers for team" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix fabio: \nprefix bibo: \nprefix gen: \n\nselect distinct ?paper ?paper_label ?journal ?journal_label ?publication_date ?np (\"^\" as ?np_label) where {\n values ?_space_multi_iri {}\n graph npa:graph {\n ?mnp npa:hasValidSignatureForPublicKeyHash ?mpubkey .\n filter not exists { ?mnpx npx:invalidates ?mnp ; npa:hasValidSignatureForPublicKeyHash ?mpubkey . }\n ?mnp np:hasAssertion ?ma .\n }\n graph ?ma {\n ?_space_multi_iri gen:hasTeamMember ?author .\n }\n graph npa:graph {\n ?np npx:hasNanopubType fabio:ScholarlyWork .\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np dct:created ?date .\n ?np np:hasAssertion ?a .\n ?np npx:introduces ?paper .\n }\n graph ?a {\n ?paper dct:title ?paper_label .\n ?paper bibo:authorList ?author_list .\n ?paper dct:date ?publication_date .\n ?author_list ?rdfseqpred ?author .\n filter(strstarts(str(?rdfseqpred), \"http://www.w3.org/1999/02/22-rdf-syntax-ns#_\"))\n optional {\n ?paper dct:isPartOf ?journal .\n ?journal dct:title ?journal_label .\n }\n }\n}\norder by desc(?publication_date)" . . "Full-text search over classes that have been declared as FAIR Digital Object (FDO) subclasses in nanopublications. Suitable as an autocomplete lookup source in Nanodash guided-choice placeholders." . . "Full-text search on FDO subclasses" . . "prefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix dct: \nprefix fdof: \n\nselect distinct ?thing ?label ?description ?np ?pubkey ?date where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?np dct:created ?date .\n ?np npx:introduces|npx:describes|npx:embeds ?thing .\n ?np rdfs:label ?label .\n optional { ?np dct:description ?description . }\n ?np np:hasAssertion ?a .\n }\n graph ?a {\n ?thing rdfs:subClassOf fdof:FAIRDigitalObject .\n }\n filter(contains(lcase(str(?label)), lcase(?_query)))\n}\norder by desc(?date)\nlimit 10" . . "Returns the pinned templates for the given resource (Space, agent, or other resource), formatted for list display." . . "Get pinned templates for resource" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \nprefix gen: \n\nselect ?label ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np npx:hasNanopubType gen:hasPinnedTemplate .\n ?np dct:created ?date .\n ?np np:hasAssertion ?a .\n ?np np:hasPublicationInfo ?pi .\n }\n graph ?a {\n values ?_resource_multi_iri {}\n ?_resource_multi_iri gen:hasPinnedTemplate ?template .\n }\n optional { graph ?pi { ?template nt:hasLabelFromApi ?api_label } }\n bind(if(bound(?api_label),\n if(contains(?api_label, \" - \"), strbefore(?api_label, \" - \"), ?api_label),\n str(?template)) as ?rawlabel)\n bind(concat(\"\", ?rawlabel, \"\") as ?label)\n} order by desc(?date)" . . "Returns the pinned queries for the given resource (Space, agent, or other resource), formatted for list display." . . "Get pinned queries for resource" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \nprefix gen: \n\nselect ?label ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np npx:hasNanopubType gen:hasPinnedQuery .\n ?np dct:created ?date .\n ?np np:hasAssertion ?a .\n ?np np:hasPublicationInfo ?pi .\n }\n graph ?a {\n values ?_resource_multi_iri {}\n ?_resource_multi_iri gen:hasPinnedQuery ?query .\n }\n optional { graph ?pi { ?query nt:hasLabelFromApi ?api_label } }\n bind(if(bound(?api_label),\n if(contains(?api_label, \" - \"), strbefore(?api_label, \" - \"), ?api_label),\n str(?query)) as ?rawlabel)\n bind(replace(str(?query), \"https://w3id.org/np/\", \"\") as ?spec_path)\n bind(concat(\"\", ?rawlabel, \"\") as ?label)\n} order by desc(?date)" . . "Returns the grlc query nanopublications created by the given user." . . "Get queries by given user" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix grlc: \n\nselect ?label ?date ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npx:signedBy ?_user_iri .\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkeyhash .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkeyhash . }\n ?np npx:hasNanopubType grlc:grlc-query .\n ?np npx:introduces|npx:embeds ?query .\n ?np dct:created ?date .\n ?np np:hasAssertion ?a .\n }\n graph ?a {\n ?query grlc:endpoint ?endpoint .\n filter(strstarts(str(?endpoint), \"https://w3id.org/np/l/nanopub-query\"))\n optional { ?query rdfs:label ?rawlabel }\n }\n bind(replace(str(?query), \"https://w3id.org/np/\", \"\") as ?spec_path)\n bind(concat(\"\", coalesce(?rawlabel, str(?query)), \"\") as ?label)\n} order by desc(?date)" . . "Returns the assertion templates created by the given user." . . "Get templates by given user" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \n\nselect ?label ?tag ?date ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npx:signedBy ?_user_iri .\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?np npx:hasNanopubType nt:AssertionTemplate .\n ?np dct:created ?date .\n ?np np:hasAssertion ?a .\n }\n graph ?a {\n ?a rdfs:label ?rawlabel .\n optional { ?a nt:hasTag ?tag . }\n filter not exists { ?a a nt:UnlistedTemplate }\n }\n bind(concat(\"\", ?rawlabel, \"\") as ?label)\n} order by desc(?date)" . . "This query allows for searching for resources (FERs etc.) together with the info about whether GO FAIR qualified them." . . "Find GO FAIR qualified vocabularies/ontologies" . . "prefix rdfs: \r\nprefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix xsd: \r\nprefix dct: \r\nprefix fip: \r\nprefix prov: \r\n\r\nselect distinct ?thing ?label ?types ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np (group_concat(distinct ?recommender; separator=\" \") as ?recommenders) (group_concat(distinct ?recommendation_np; separator=\" \") as ?recommendation_nps) (count(distinct ?recommender) as ?recommender_count) (sample(?fairAssessmentLevel) as ?fairAssessmentLevel) (sample(?fairAssessmentLevelNp) as ?fairAssessmentLevelNp) where {\r\n \r\n {\r\n SELECT ?np (GROUP_CONCAT(DISTINCT ?filteredType; separator=\" \") AS ?types) WHERE {\r\n GRAPH npa:graph {\r\n VALUES ?filteredType { fip:Semantic-model fip:Structured-vocabulary }\r\n ?np npx:hasNanopubType ?filteredType .\r\n }\r\n } GROUP BY ?np\r\n }\r\n \r\n graph npa:graph {\r\n npa:hasValidSignatureForPublicKey ?curators_np_pk .\r\n ?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk .\r\n filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . }\r\n ?latest_curators_np np:hasAssertion ?latest_curators_assertion .\r\n }\r\n graph npa:networkGraph {\r\n ?latest_curators_np (npx:supersedes)* .\r\n filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np }\r\n }\r\n \r\n graph npa:graph {\r\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\r\n optional { ?retraction npx:retracts ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\r\n optional { ?newversion npx:supersedes ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\r\n ?np (npx:introduces|npx:describes) ?thing .\r\n ?np rdfs:label ?label .\r\n ?np dct:description ?description .\r\n ?np dct:created ?date .\r\n filter(str(?date) > \"2022\")\r\n }\r\n bind(concat(\" \",lcase(str(?label)),\" \",lcase(str(?description)),\" \") as ?text)\r\n filter( contains(?text, lcase(str(?_searchterm))) )\r\n\r\n optional {\r\n graph npa:graph {\r\n ?disapproval npa:hasValidSignatureForPublicKey ?dpubkey .\r\n }\r\n graph ?latest_curators_assertion {\r\n ?dpubkeys npx:hasPublicKey ?dpubkey .\r\n }\r\n graph npa:graph {\r\n filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . }\r\n ?disapproval np:hasAssertion ?da .\r\n }\r\n graph ?da {\r\n ?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np .\r\n }\r\n } filter(!bound(?disapproval)) # Faster than \"filter not exists\" for some reason\r\n\r\n optional {\r\n optional {\r\n graph npa:graph {\r\n ?recommendation_np npx:hasNanopubType fip:recommended-by .\r\n ?recommendation_np npa:hasValidSignatureForPublicKey ?rpubkey .\r\n filter not exists { ?recommendation_np_x npx:invalidates ?recommendation_np ; npa:hasValidSignatureForPublicKey ?rpubkey . }\r\n ?recommendation_np np:hasAssertion ?ra .\r\n ?recommendation_np np:hasProvenance ?rp .\r\n }\r\n graph ?ra {\r\n ?thing fip:recommended-by ?recommender .\r\n }\r\n graph ?rp {\r\n ?ra prov:wasDerivedFrom ?rfip_np .\r\n }\r\n graph npa:graph {\r\n ?rfip_np npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile .\r\n ?rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey .\r\n ?latest_rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey .\r\n filter not exists { ?latest_rfip_npx npx:invalidates ?latest_rfip_np ; npa:hasValidSignatureForPublicKey ?rfip_pubkey . }\r\n }\r\n graph npa:networkGraph {\r\n ?latest_rfip_np (npx:supersedes)* ?rfip_np .\r\n }\r\n graph ?rfip_qa {\r\n ?rfip_qualifier npx:qualifies ?latest_rfip_np .\r\n }\r\n graph npa:graph {\r\n ?rfip_qualification_np np:hasAssertion ?rfip_qa .\r\n ?rfip_qualification_np npx:hasNanopubType npx:qualifies .\r\n ?rfip_qualification_np npa:hasValidSignatureForPublicKey ?rfip_qpubkey .\r\n filter not exists { ?rfip_qualification_np_x npx:invalidates ?rfip_qualification_np ; npa:hasValidSignatureForPublicKey ?rfip_qpubkey . }\r\n }\r\n graph ?latest_curators_assertion {\r\n ?rfip_qpubkeys npx:hasPublicKey ?rfip_qpubkey .\r\n }\r\n }\r\n graph npa:graph {\r\n ?qualification_np npx:hasNanopubType npx:qualifies .\r\n ?qualification_np npa:hasValidSignatureForPublicKey ?qpubkey .\r\n }\r\n graph ?latest_curators_assertion {\r\n ?qpubkeys npx:hasPublicKey ?qpubkey .\r\n }\r\n graph npa:graph {\r\n filter not exists { ?qualification_np_x npx:invalidates ?qualification_np ; npa:hasValidSignatureForPublicKey ?qpubkey . }\r\n ?qualification_np np:hasAssertion ?qa .\r\n }\r\n graph ?qa {\r\n ?qualifier npx:qualifies ?np .\r\n }\r\n }\r\n\r\n optional {\r\n graph npa:graph {\r\n ?fairAssessmentLevelNp npx:hasNanopubType fip:has-FAIR-assessment .\r\n ?fairAssessmentLevelNp npa:hasValidSignatureForPublicKey ?lpubkey .\r\n }\r\n graph ?latest_curators_assertion {\r\n ?lpubkeys npx:hasPublicKey ?lpubkey .\r\n }\r\n graph npa:graph {\r\n filter not exists { ?fairAssessmentLevelNp_x npx:invalidates ?fairAssessmentLevelNp ; npa:hasValidSignatureForPublicKey ?lpubkey . }\r\n ?fairAssessmentLevelNp np:hasAssertion ?la .\r\n }\r\n graph ?la {\r\n ?thing fip:has-FAIR-assessment ?fairAssessmentLevel .\r\n }\r\n } filter(!bound(?levelNp)) # Faster than \"filter not exists\" for some reason\r\n\r\n}\r\ngroup by ?thing ?label ?types ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np\r\norder by desc(?recommender_count) asc(?label)" . . "This query summarises statistics for the assessed LLM-KG integration papers, returning the average number of described and discussed methods, along with the % of papers that have the source code link in the text." . . "Get summary statistics for assessed LLM-KG papers" . . "PREFIX np: \r\nPREFIX prov: \r\nPREFIX cito: \r\nPREFIX fabio: \r\nPREFIX npx: \r\n\r\nSELECT \r\n(STR(ROUND(AVG(?describedCount) * 100) / 100) AS ?AvgDescribedMethods)\r\n(STR(ROUND(AVG(?discussedCount) * 100) / 100) AS ?AvgDiscussedMethods)\r\n (CONCAT(STR(ROUND((SUM(?hasUrl) / COUNT(?paper)) * 100)), \"%\") AS ?PercentPapersWithSourceCodeURL)\r\nWHERE {\r\n {\r\n SELECT ?paper \r\n (COUNT(DISTINCT ?desc) AS ?describedCount) \r\n (COUNT(DISTINCT ?disc) AS ?discussedCount)\r\n\r\n (MAX(IF(BOUND(?methodUrl), 1, 0)) AS ?hasUrl)\r\n WHERE {\r\n ?np a np:Nanopublication ; \r\n np:hasAssertion ?assertion .\r\n \r\n FILTER NOT EXISTS {\r\n \t\t?newerNp npx:supersedes ?np .\r\n \t\t}\r\n \r\n GRAPH ?assertion {\r\n ?paper a prov:Entity .\r\n \r\n OPTIONAL { \r\n ?paper cito:describes ?desc . \r\n OPTIONAL { ?desc fabio:hasURL ?methodUrl . }\r\n }\r\n\r\n OPTIONAL { ?paper cito:discusses ?disc . }\r\n }\r\n }\r\n GROUP BY ?paper\r\n }\r\n}" . . "This query returns the distribution of unique research papers across the two-tier hierarchy of LLM-KG integration, excluding all superseded assessments." . . "Get counts of assessed LLM-KG papers per assigned category" . . "PREFIX npx: \r\nPREFIX dct: \r\nPREFIX np: \r\nPREFIX prov: \r\nPREFIX cito: \r\n\r\nSELECT ?TopCategory ?Category (STR(COUNT(DISTINCT ?paper)) AS ?PaperCount) (SAMPLE(?np) AS ?Example)\r\nWHERE {\r\n ?np a np:Nanopublication ;\r\n np:hasAssertion ?assertionGraph .\r\n \r\n FILTER NOT EXISTS {\r\n ?newerNp npx:supersedes ?np .\r\n }\r\n \r\n GRAPH ?assertionGraph {\r\n ?paper a prov:Entity ;\r\n cito:describes ?method .\r\n\r\n ?method dct:subject ?catUri ;\r\n ?topUri .\r\n\r\n BIND(REPLACE(STR(?topUri), \"^.*#\", \"\") AS ?TopCategory)\r\n BIND(REPLACE(STR(?catUri), \"^.*#\", \"\") AS ?Category)\r\n }\r\n}\r\nGROUP BY ?TopCategory ?Category\r\nORDER BY ?TopCategory" . . "This query returns the testimonials (about any entity) authored by any of the project leads of the given project." . . "Get testimonials by project leads" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix schema: \nprefix gen: \n\nselect ?author ?author_label ?about ?about_label ?text ?date ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?lead_np np:hasAssertion ?lead_a .\n ?lead_np npa:hasValidSignatureForPublicKeyHash ?lead_pubkey .\n filter not exists { ?lead_npx npx:invalidates ?lead_np ; npa:hasValidSignatureForPublicKeyHash ?lead_pubkey . }\n }\n graph ?lead_a {\n ?_project_iri gen:hasProjectLead ?author .\n }\n graph npa:graph {\n ?np npx:hasNanopubType gen:Testimonial .\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx2 npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np npx:introduces ?testimonial .\n ?np np:hasAssertion ?a .\n ?np dct:created ?date .\n }\n graph ?a {\n ?testimonial dct:description ?text .\n ?testimonial schema:author ?author .\n optional { ?testimonial schema:about ?about . }\n optional { ?author rdfs:label ?author_label . }\n optional { ?about rdfs:label ?about_label . }\n }\n}\norder by desc(?date)" . . "This query returns all classes that specify to be part of a given ontology." . . "Get the classes of an ontology" . . "prefix owl: \r\n prefix rdfs: \r\n prefix dct: \r\n prefix np: \r\n prefix npa: \r\n prefix npx: \r\n prefix skos: \r\n \r\n select ?class ?class_label (?definition as ?description)\r\n (group_concat(distinct str(?superclass); separator=\" \") as ?superclasses_multi_iri) \r\n (group_concat(distinct replace(replace(coalesce(?superclass_lbl, str(?superclass)), \"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\"), \"[\\r\\n]+\", \"\\\\\\\\n\"); separator=\"\\n\") as \r\n ?superclasses_label_multi) \r\n ?np (\"^\" as ?np_label) where { \r\n values ?_ontology_multi_iri {} \r\n graph npa:graph { \r\n ?np npx:hasNanopubType owl:Class .\r\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . \r\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } \r\n ?np dct:created ?date .\r\n ?np npx:introduces ?class . \r\n ?np np:hasAssertion ?a .\r\n } \r\n graph ?a { \r\n ?class dct:partOf ?_ontology_multi_iri .\r\n optional { ?class rdfs:label ?class_label . } \r\n optional { ?class skos:definition ?definition . }\r\n optional { \r\n ?class rdfs:subClassOf ?superclass .\r\n filter(isIRI(?superclass)) \r\n optional { ?superclass rdfs:label ?superclass_lbl . }\r\n } \r\n } \r\n } \r\n group by ?class ?class_label ?definition ?np\r\n order by ?class_label" . . "This query returns all classes that specify to be part of a given ontology." . . "Get the classes of an ontology" . . "prefix owl: \r\n prefix rdfs: \r\n prefix dct: \r\n prefix np: \r\n prefix npa: \r\n prefix npx: \r\n prefix skos: \r\n \r\n select ?class ?class_label (?definition as ?description)\r\n (group_concat(distinct str(?superclass); separator=\" \") as ?superclasses_multi_iri) \r\n (group_concat(distinct replace(replace(coalesce(?superclass_lbl, str(?superclass)), \"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\"), \"[\\r\\n]+\", \"\\\\\\\\n\"); separator=\"\\n\") as \r\n ?superclasses_label_multi) \r\n ?np (\"^\" as ?np_label) \r\n where { \r\n values ?_ontology_multi_iri {}\r\n graph npa:graph { \r\n ?np npx:hasNanopubType owl:Class .\r\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . \r\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } \r\n ?np dct:created ?date .\r\n ?np npx:introduces ?class . \r\n ?np np:hasAssertion ?a .\r\n } \r\n graph ?a { \r\n ?class dct:partOf ?_ontology_multi_iri .\r\n optional { ?class rdfs:label ?class_label . } \r\n optional { ?class skos:definition ?definition . }\r\n optional { \r\n ?class rdfs:subClassOf ?superclass .\r\n filter(isIRI(?superclass)) \r\n optional { ?superclass rdfs:label ?superclass_lbl . }\r\n } \r\n } \r\n } \r\n group by ?class ?class_label ?definition ?np\r\n order by ?class_label" . . "Returns all assertion templates with their label, tag, creator and date, ordered by descending date" . . "Get all templates" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix nt: \n\nselect ?template_iri ?template_iri_label ?tag ?creator ?date where {\n graph npa:graph {\n ?template_iri npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?template_iri ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?template_iri npx:hasNanopubType nt:AssertionTemplate .\n ?template_iri dct:created ?date .\n ?template_iri np:hasAssertion ?a .\n optional { ?template_iri npx:signedBy ?creator . }\n }\n optional { graph ?a { ?a rdfs:label ?template_iri_label } }\n optional { graph ?a { ?a nt:hasTag ?tag . } }\n filter not exists { graph ?a { ?a a nt:UnlistedTemplate } }\n} order by desc(?date)" . . "This query returns the most used assertion templates of the last 30 days, considering the latest versions of these templates." . . "Get the most used templates of the last 30 days" . . "prefix rdfs: \r\nprefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix nt: \r\nprefix dct: \r\n\r\nselect ?template_np ?template_np_label (sum(?npcount) as ?overallcount) {\r\n { select ?used_template_np (count(distinct ?np) as ?npcount) where {\r\n graph npa:graph {\r\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\r\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\r\n ?np np:hasPublicationInfo ?i .\r\n }\r\n graph ?i {\r\n ?np nt:wasCreatedFromTemplate ?used_template_np .\r\n }\r\n } group by ?used_template_np }\r\n bind(uri(concat(\"https://w3id.org/np/l/nanopub-query-1.1/repo/type/\", sha256(str(nt:AssertionTemplate)))) as ?atservice)\r\n { service ?atservice {\r\n graph npa:networkGraph {\r\n ?template_np npx:supersedes* ?used_template_np .\r\n }\r\n graph npa:graph {\r\n ?used_template_np npa:hasValidSignatureForPublicKey ?pubkey .\r\n ?template_np npa:hasValidSignatureForPublicKey ?pubkey .\r\n filter not exists { ?template_npx npx:invalidates ?template_np ; npa:hasValidSignatureForPublicKey ?pubkey . }\r\n ?used_template_np np:hasAssertion ?a .\r\n }\r\n graph ?a {\r\n ?a rdfs:label ?template_np_label .\r\n } \r\n } }\r\n} group by ?template_np ?template_np_label order by desc(?overallcount) limit 10" . . "Returns the latest nanopublications signed by or created by a given user (signed via npx:signedBy, or created via dct:creator if no npx:signedBy is present)." . . "Get latest nanopublications by user" . . "prefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix xsd: \nprefix dct: \n\nselect ?np ?date where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n ?np dct:created ?date .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n filter not exists { ?np npx:hasNanopubType npx:retracts . }\n }\n {\n graph npa:graph {\n ?np npx:signedBy ?_userid_iri .\n }\n } union {\n filter not exists {\n graph npa:graph { ?np npx:signedBy ?anyuser . }\n }\n graph npa:graph {\n ?np dct:creator ?_userid_iri .\n }\n }\n}\norder by desc(?date)\nlimit 100" . . "Returns the latest nanopublications signed by or created by a given user (signed via npx:signedBy, or created via dct:creator if no npx:signedBy is present)." . . "Get latest nanopublications by user" . . "prefix rdfs: \r\nprefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix xsd: \r\nprefix dct: \r\n\r\nselect ?np ?date where {\r\n graph npa:graph {\r\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\r\n ?np dct:created ?date .\r\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\r\n filter not exists { ?np npx:hasNanopubType npx:retracts . }\r\n }\r\n {\r\n graph npa:graph {\r\n ?np npx:signedBy ?_userid_iri .\r\n }\r\n } union {\r\n filter not exists {\r\n graph npa:graph { ?np npx:signedBy ?_userid_iri . }\r\n }\r\n graph npa:graph {\r\n ?np dct:creator ?_userid_iri .\r\n }\r\n }\r\n}\r\norder by desc(?date)\r\nlimit 100" . . "Returns the latest users who have introduced themselves, with the user IRI in the user_iri column for display." . . "Get latest users v2" . . "prefix np: \nprefix npx: \nprefix npa: \nprefix dct: \n\nselect ?user_iri where {\n {\n select ?user_iri (min(?date) as ?mindate) where {\n graph npa:graph {\n ?intronp npa:hasValidSignatureForPublicKey ?introPubkey .\n filter not exists { ?intronpx npx:retracts ?intronp ; npa:hasValidSignatureForPublicKey ?pubkey . }\n filter not exists { ?intronp npx:supersedes ?intronpx . }\n ?intronp dct:created ?date .\n ?intronp np:hasAssertion ?a .\n }\n graph ?a {\n ?keydeclaration npx:declaredBy ?user_iri .\n ?keydeclaration npx:hasPublicKey ?pubkey .\n }\n }\n group by ?user_iri\n }\n}\norder by desc(?mindate)\nlimit 100" . . "This query returns a list of suggested templates to get started, so it can be shown e.g. on Nanodash." . . "Get suggested templates to get started" . . "prefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix dct: \n\nselect ?template_iri ?template_iri_label where {\n graph npa:graph {\n ?np npx:hasNanopubType .\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n filter(?pubkey = \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD4Wj537OijfOWVtsHMznuXKISqBhtGDQZfdO6pbb4hg9EHMcUFGTLbWaPrP783PHv8HMAAPjvEkHLaOHMIknqhaIa5236lfBO3r+ljVdYBElBcLvROmwG+ZGtmPNZf7lMhI15xf5TfoaSa84AFRd5J2EXekK6PhaFQhRm1IpSYtwIDAQAB\")\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?np dct:created ?date .\n ?np np:hasAssertion ?a .\n }\n graph ?a {\n ?template_iri a .\n }\n optional {\n graph npa:graph {\n ?template_iri rdfs:label ?raw_label .\n }\n bind(replace(str(?raw_label), \"^Template: \", \"\") as ?template_iri_label)\n }\n} order by desc(?date)" . . "This query returns a list of suggested templates to get started, so it can be shown e.g. on Nanodash." . . "Get suggested templates to get started" . . "prefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix dct: \n\nselect ?template_iri ?template_iri_label where {\n graph npa:graph {\n ?np npx:hasNanopubType .\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\n ?np dct:created ?date .\n ?np np:hasAssertion ?a .\n }\n graph ?a {\n ?template_iri a .\n optional { ?template_iri rdfs:label ?template_iri_label . }\n }\n} order by desc(?date)" . . "This query returns the 10 creators who created most nanopublications during the last 30 days." . . "Get the top-10 creators of the last 30 days" . . "prefix rdfs: \nprefix np: \nprefix npa: \nprefix npx: \nprefix xsd: \nprefix dct: \nprefix prov: \nprefix foaf: \n\nselect ?user_iri where {\n { graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n ?np dct:creator ?user_iri .\n } }\n union\n {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\n ?np np:hasAssertion ?assertion .\n ?np np:hasProvenance ?prov .\n }\n graph ?prov {\n ?assertion prov:wasAttributedTo ?user_iri .\n }\n }\n filter(?user_iri != )\n filter(?user_iri != )\n filter(!regex(str(?user_iri), '[^A-Za-z0-9-_]RA[A-Za-z0-9-_]{43}$'))\n}\ngroup by ?user_iri\norder by desc(count(distinct ?np))\nlimit 10" . . "This query returns the testimonials about the given entity." . . "Get testimonials about entity" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix schema: \nprefix gen: \n\nselect ?author ?author_label ?text ?date ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npx:hasNanopubType gen:Testimonial .\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np npx:introduces ?testimonial .\n ?np np:hasAssertion ?a .\n ?np dct:created ?date .\n }\n graph ?a {\n ?testimonial dct:description ?text .\n values ?_subject_multi_iri {}\n ?testimonial schema:about ?_subject_multi_iri .\n ?testimonial schema:author ?author .\n optional { ?author rdfs:label ?author_label . }\n }\n}\norder by desc(?date)" . . "This query returns the testimonials by the given author." . . "Get testimonials by author" . . "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix schema: \nprefix gen: \n\nselect ?about ?text ?date ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npx:hasNanopubType gen:Testimonial .\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np npx:introduces ?testimonial .\n ?np np:hasAssertion ?a .\n ?np dct:created ?date .\n }\n graph ?a {\n ?testimonial dct:description ?text .\n ?testimonial schema:author ?_author_iri .\n optional { ?testimonial schema:about ?about . }\n }\n}\norder by desc(?date)" . . "Returns R-FIP declarations: FIP declarations whose community has a Reference-FAIR-Implementation-Profile, matched with the latest R-FIP profile for that community." . . "Get R-FIP declarations in context" . . "prefix rdfs: \nprefix fip: \nprefix dct: \nprefix npa: \nprefix npx: \nprefix np: \nprefix schema: \n\nselect ?fip_index ?fip_title ?decl_np where {\n # Find R-FIP profiles (latest per community)\n graph npa:graph {\n ?fip_index npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile .\n ?fip_index npa:hasValidSignatureForPublicKeyHash ?pkh .\n filter not exists { ?inv npx:invalidates ?fip_index ; npa:hasValidSignatureForPublicKeyHash ?pkh . }\n ?fip_index np:hasAssertion ?rfip_a .\n ?fip_index npx:introduces ?rfip .\n ?fip_index dct:created ?rfip_date .\n }\n graph ?rfip_a {\n ?rfip rdfs:label ?fip_title .\n ?rfip fip:declared-by ?community .\n }\n # Keep only the latest R-FIP profile per community\n filter not exists {\n graph npa:graph {\n ?newer_rfip npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile .\n ?newer_rfip npa:hasValidSignatureForPublicKeyHash ?nkh .\n filter not exists { ?ninv npx:invalidates ?newer_rfip ; npa:hasValidSignatureForPublicKeyHash ?nkh . }\n ?newer_rfip np:hasAssertion ?nra .\n ?newer_rfip dct:created ?newer_date .\n }\n graph ?nra {\n ?nrfip fip:declared-by ?community .\n }\n filter(?newer_date > ?rfip_date)\n }\n\n # Find FIP declarations from these R-FIP communities that have schema:version\n graph npa:graph {\n ?decl_np npx:hasNanopubType fip:FIP-Declaration .\n ?decl_np npa:hasValidSignatureForPublicKey ?dpk .\n filter not exists { ?dinv npx:invalidates ?decl_np ; npa:hasValidSignatureForPublicKey ?dpk . }\n ?decl_np np:hasAssertion ?decl_a .\n }\n graph ?decl_a {\n ?decl fip:declared-by ?community .\n ?decl schema:version ?version .\n }\n}" . . "This query returns the relevant resources for a given entity (e.g. a Space)." . . "Get relevant resources" . . "prefix rdfs: \r\nprefix dct: \r\nprefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix gen: \r\n\r\nselect ?resource ?resource_label ?comment ?np (\"^\" as ?np_label) where {\r\n graph npa:graph {\r\n ?np npx:hasNanopubType gen:isRelevantFor .\r\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\r\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\r\n ?np dct:created ?date .\r\n ?np np:hasAssertion ?a .\r\n optional { ?np rdfs:label ?label }\r\n }\r\n values ?_entity_multi_iri {}\r\n graph ?a {\r\n ?resource gen:isRelevantFor ?_entity_multi_iri .\r\n optional { ?resource rdfs:label ?resource_label . }\r\n optional { ?resource rdfs:comment ?comment . }\r\n }\r\n}" . . "This query returns the paragraphs of an entity (e.g. a space) with their title and content, including source nanopub and date." . . "Get paragraphs of an entity" . . "prefix rdf: \r\nprefix rdfs: \r\nprefix dct: \r\nprefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix schema: \r\nprefix schemas: \r\nprefix gen: \r\n\r\nselect ?title ?content ?date ?np where {\r\n graph npa:graph {\r\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\r\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\r\n ?np dct:created ?date .\r\n ?np dct:creator ?user .\r\n ?np np:hasAssertion ?a .\r\n }\r\n graph ?a {\r\n ?paragraph schema:title|schemas:title ?title .\r\n ?paragraph rdf:type gen:Paragraph .\r\n ?paragraph gen:hasContent ?content .\r\n values ?_resource_multi_iri {}\r\n ?paragraph schema:isPartOf|schemas:isPartOf|schema:about|schemas:about ?_resource_multi_iri .\r\n optional { ?paragraph gen:hasPositionString ?position }\r\n }\r\n}\r\norder by ?position ?title" . . "This query returns all newer versions of a given nanopublication, including those that since have been superseded or retracted." . . "Get all newer versions of this nanopublication" . . "prefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix dct: \r\n\r\nselect ?newerVersion ?date ?retractedBy ?supersededBy where {\r\n graph npa:graph {\r\n ?_np_iri npa:hasValidSignatureForPublicKey ?pubkey .\r\n }\r\n graph npa:networkGraph {\r\n ?newerVersion (npx:supersedes)* ?_np_iri .\r\n }\r\n graph npa:graph {\r\n ?newerVersion npa:hasValidSignatureForPublicKey ?pubkey .\r\n }\r\n optional { graph npa:graph { ?newerVersion dct:created ?date . } }\r\n optional { graph npa:graph { ?retractedBy npx:retracts ?newerVersion ; npa:hasValidSignatureForPublicKey ?pubkey . } }\r\n optional { graph npa:graph { ?supersededBy npx:supersedes ?newerVersion ; npa:hasValidSignatureForPublicKey ?pubkey . } }\r\n}\r\norder by desc(?date) ?newerVersion" . . "This query returns the items a given user has read, covering both schema:ReadAction and paperclub:hasRead nanopubs." . . "Get reads by reader" . . "prefix schema: \nprefix pc: \nprefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix xsd: \n\nselect distinct ?item ?item_label ?date ?comment ?np (\"^\" as ?np_label) where {\n {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np np:hasAssertion ?a .\n ?np dct:created ?created .\n }\n graph ?a {\n ?ra a schema:ReadAction ;\n schema:agent ?_reader_iri ;\n schema:object ?item .\n optional { ?item rdfs:label ?item_label }\n optional { ?ra schema:endTime ?d }\n optional { ?ra rdfs:comment ?comment }\n }\n bind(coalesce(?d, substr(str(?created), 1, 10)) as ?date)\n }\n union\n {\n bind(iri(concat(\"https://w3id.org/np/l/nanopub-query-1.1/repo/type/\", sha256(str(pc:hasRead)))) as ?hasread_repo)\n service ?hasread_repo {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np np:hasAssertion ?a .\n ?np npx:signedBy ?_reader_iri .\n ?np dct:created ?created .\n }\n graph ?a {\n ?_reader_iri pc:hasRead ?item .\n optional { ?item rdfs:comment ?comment }\n }\n }\n bind(substr(str(?created), 1, 10) as ?date)\n }\n} order by desc(?date)" . . "This query returns all thanks, possibly restricted by thanker, thanked, and/or thank reason." . . "Get thanks" . . "prefix rdfs: \r\nprefix dct: \r\nprefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix thank: \r\n\r\nselect (?__thanker_iri as ?thanker) (?__thanked_iri as ?thanked) (?__thankReason_iri as ?thank_reason) ?comment ?date ?np (\"^\" as ?np_label) where {\r\n graph npa:graph {\r\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\r\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\r\n ?np dct:created ?date .\r\n ?np npx:signedBy ?__thanker_iri .\r\n ?np np:hasAssertion ?a .\r\n }\r\n graph ?a {\r\n ?thanks a thank:Thanks .\r\n ?thanks thank:hasThanked ?__thanked_iri .\r\n ?thanks thank:hasThanker ?__thanker_iri .\r\n ?thanks thank:thanksFor ?__thankReason_iri .\r\n optional { ?thanks rdfs:comment ?comment . }\r\n }\r\n}\r\norder by desc(?date)" . . "Returns all 3PFF events for a given user, including the role they had in each event." . . "Get 3PFF events for user" . . "prefix rdfs: \r\nprefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix dct: \r\nprefix tpff: \r\nprefix schema: \r\n\r\nselect ?event ?event_label (sample(?ev_name) as ?event_name) (sample(?ev_date) as ?event_date) ?roles_multi_iri ?roles_label_multi ?np_multi_iri ?np_label_multi where {\r\n {\r\n select ?event (replace(str(?event), \"^.*/\", \"\") as ?event_label) (group_concat(str(?role); separator=\" \") as ?roles_multi_iri) (group_concat(?role_label; separator=\"\\n\") as ?roles_label_multi) (group_concat(str(?latest_np); separator=\" \") as ?np_multi_iri) (group_concat(\"^\"; separator=\"\\n\") as ?np_label_multi) where {\r\n {\r\n select ?event ?role ?role_label (sample(?np) as ?latest_np) where {\r\n values (?role ?role_label) {\r\n (tpff:participatedAsParticipantIn \"Participant\")\r\n (tpff:participatedAsFacilitatorIn \"Facilitator\")\r\n (tpff:participatedAsTrainerIn \"Trainer\")\r\n (tpff:participatedAsFacilitatorAssistantIn \"Facilitator Assistant\")\r\n (tpff:participatedAsTrainerAssistantIn \"Trainer Assistant\")\r\n (tpff:participatedAsImplementerIn \"Implementer\")\r\n (tpff:participatedAsImplementerAspirantIn \"Implementer Aspirant\")\r\n }\r\n graph npa:graph {\r\n ?np npx:hasNanopubType ?role .\r\n ?np dct:creator ?_user_iri .\r\n ?np npa:hasValidSignatureForPublicKeyHash ?pk .\r\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pk . }\r\n ?np np:hasAssertion ?a .\r\n ?np dct:created ?date .\r\n }\r\n graph ?a {\r\n ?_user_iri ?role ?event .\r\n }\r\n filter not exists {\r\n graph npa:graph {\r\n ?np2 npx:hasNanopubType ?role .\r\n ?np2 dct:creator ?_user_iri .\r\n ?np2 npa:hasValidSignatureForPublicKeyHash ?pk2 .\r\n filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pk2 . }\r\n ?np2 np:hasAssertion ?a2 .\r\n ?np2 dct:created ?date2 .\r\n filter(?date2 > ?date)\r\n }\r\n graph ?a2 {\r\n ?_user_iri ?role ?event .\r\n }\r\n }\r\n }\r\n group by ?event ?role ?role_label\r\n }\r\n }\r\n group by ?event\r\n }\r\n graph npa:graph {\r\n ?enp npx:introduces ?event .\r\n ?enp npa:hasValidSignatureForPublicKeyHash ?epk .\r\n filter not exists { ?enpx npx:invalidates ?enp ; npa:hasValidSignatureForPublicKeyHash ?epk . }\r\n ?enp np:hasAssertion ?ea .\r\n }\r\n graph ?ea {\r\n ?event a tpff:3PFF-event .\r\n ?event rdfs:label ?ename .\r\n optional { ?event dct:date ?dateDct . }\r\n optional { ?event schema:startDate ?dateSchema . }\r\n }\r\n bind(coalesce(?dateDct, strBefore(str(?dateSchema), \"T\")) as ?ev_date)\r\n bind(replace(?ename, \"^[^|]*\\\\| ?\", \"\") as ?ev_name)\r\n}\r\ngroup by ?event ?event_label ?roles_multi_iri ?roles_label_multi ?np_multi_iri ?np_label_multi\r\norder by desc(sample(?ev_date))" . . "This query returns the past events the given user has participated in." . . "Get past event participations" . . "prefix wd: \nprefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix gen: \nprefix schema: \nprefix xsd: \n\nselect distinct ?event ?event_label ?date ?np (\"^\" as ?np_label) where {\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n ?np np:hasAssertion ?a .\n }\n graph ?a {\n ?_user_iri wd:P1344 ?event .\n }\n optional {\n bind(iri(concat(\"https://w3id.org/np/l/nanopub-query-1.1/repo/type/\", sha256(str(gen:Space)))) as ?space_repo)\n service ?space_repo {\n graph npa:graph {\n ?nps npx:introduces ?event .\n ?nps npa:hasValidSignatureForPublicKeyHash ?pks .\n filter not exists { ?npsx npx:invalidates ?nps ; npa:hasValidSignatureForPublicKeyHash ?pks . }\n ?nps np:hasAssertion ?as .\n }\n graph ?as {\n ?event rdfs:label ?el .\n optional {\n ?event schema:startDate ?datetime .\n }\n }\n }\n }\n bind(xsd:date(substr(str(?datetime), 0, 11)) as ?date)\n bind(?el as ?event_label)\n filter(?date < xsd:date(substr(str(now()), 0, 11)))\n} order by desc(?date)" . . "This query returns the papers for a given author." . . "Get papers for author" . . "prefix rdfs: \r\nprefix dct: \r\nprefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix fabio: \r\nprefix bibo: \r\n\r\nselect ?paper ?paper_label ?journal ?journal_label ?publication_date ?np (\"^\" as ?np_label) where {\r\n values ?_author_multi_iri {}\r\n graph npa:graph {\r\n ?np npx:hasNanopubType fabio:ScholarlyWork .\r\n ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .\r\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\r\n ?np dct:created ?date .\r\n ?np np:hasAssertion ?a .\r\n ?np npx:introduces ?paper .\r\n }\r\n graph ?a {\r\n ?paper dct:title ?paper_label .\r\n ?paper bibo:authorList ?author_list .\r\n ?paper dct:date ?publication_date .\r\n ?author_list ?rdfseqpred ?_author_multi_iri .\r\n filter(strstarts(str(?rdfseqpred), \"http://www.w3.org/1999/02/22-rdf-syntax-ns#_\"))\r\n optional {\r\n ?paper dct:isPartOf ?journal .\r\n ?journal dct:title ?journal_label .\r\n }\r\n }\r\n}\r\norder by desc(?publication_date)" .