This query returns FAQ answers or edits contributed by users who are NOT members of the space maintaining the entity: the inverse of the member-gated FAQ views. For each entry only the single latest non-member nanopub is returned, and only when it is newer (by timestamp) than the latest member version of that entry — i.e. the contribution that would win most-recent-wins if its author were a member (a pending suggestion). The member public-key hashes are resolved server-side from the spaces repo (/repo/spaces). override_target holds the suggestion nanopub itself, so a member can override it to accept the suggestion. Placeholder stubs (gen:UnansweredQuestion) are excluded. Get non-member FAQ suggestions for an entity prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix schema: <http://schema.org/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?question ?content ?suggester (sample(?sname) as ?suggester_label) (?np as ?override_target) ?np ("^" as ?np_label) where { service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } values ?_resource_multi_iri {} graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np dct:created ?date . ?np np:hasAssertion ?a . optional { ?np npx:signedBy ?suggester . } } filter(!contains(?memberPubkeys, ?pubkey)) graph ?a { ?faq rdf:type schema:Question . ?faq rdfs:label ?question . ?faq gen:hasContent ?content . values ?_resource_multi_iri {} ?faq dct:isPartOf ?_resource_multi_iri . filter not exists { ?faq rdf:type gen:UnansweredQuestion } } filter not exists { graph npa:graph { ?mnp npa:hasValidSignatureForPublicKeyHash ?mpk2 . filter not exists { ?mx npx:invalidates ?mnp ; npa:hasValidSignatureForPublicKeyHash ?mpk2 . } ?mnp dct:created ?mdate . ?mnp np:hasAssertion ?ma . } filter(contains(?memberPubkeys, ?mpk2)) graph ?ma { ?faq rdf:type schema:Question . } filter(?mdate >= ?date) } filter not exists { graph npa:graph { ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } ?np2 dct:created ?date2 . ?np2 np:hasAssertion ?a2 . } filter(!contains(?memberPubkeys, ?pubkey2)) graph ?a2 { ?faq rdf:type schema:Question . filter not exists { ?faq rdf:type gen:UnansweredQuestion } } filter(?date2 > ?date || (?date2 = ?date && str(?np2) > str(?np))) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> { select ?suggester ?sname where { graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?tg . } graph ?tg { ?suggester foaf:name ?sname . } } } } } group by ?question ?content ?suggester ?np order by ?question This query returns the unanswered FAQ entries of an entity: questions whose most recent declaration is typed as gen:UnansweredQuestion (i.e. still carrying a placeholder instead of a real answer). Questions from everybody are returned (no author filter). Returns the question text as a plain label, plus per-row action target columns: override_target and answer_target both hold the latest nanopub that npx:introduces the entry (the valid Nanodash @override fill target, so the form pre-fills with the entry's own IRI preserved), and mark_unanswered holds the gen:UnansweredQuestion IRI so an 'override...' action can keep the entry marked unanswered while an 'answer...' action turns it into an answered entry. Get unanswered FAQ entries of an entity prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix schema: <http://schema.org/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?question (?introNp as ?override_target) (?introNp as ?answer_target) ("https://w3id.org/kpxl/gen/terms/UnansweredQuestion" as ?mark_unanswered) ?np ("^" as ?np_label) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np dct:created ?date . ?np np:hasAssertion ?a . } graph ?a { ?faq rdf:type schema:Question . ?faq rdf:type gen:UnansweredQuestion . ?faq rdfs:label ?question . values ?_resource_multi_iri {} ?faq dct:isPartOf ?_resource_multi_iri . optional { ?faq gen:hasPositionString ?position } } filter not exists { graph npa:graph { ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } ?np2 dct:created ?date2 . ?np2 np:hasAssertion ?a2 . filter (?date2 > ?date) } graph ?a2 { ?faq rdf:type schema:Question . } } optional { graph npa:graph { ?introNp npx:introduces ?faq ; npa:hasValidSignatureForPublicKeyHash ?ipk ; dct:created ?idate . filter not exists { ?iv npx:invalidates ?introNp ; npa:hasValidSignatureForPublicKeyHash ?ipk . } } filter not exists { graph npa:graph { ?introNp2 npx:introduces ?faq ; npa:hasValidSignatureForPublicKeyHash ?ipk2 ; dct:created ?idate2 . filter not exists { ?iv2 npx:invalidates ?introNp2 ; npa:hasValidSignatureForPublicKeyHash ?ipk2 . } filter(?idate2 > ?idate || (?idate2 = ?idate && str(?introNp2) > str(?introNp))) } } } } order by ?position ?question This query returns the answered FAQ entries (questions and answers) of an entity, including source nanopub and date. Only entries published by an admin, maintainer, or member of the space that maintains the entity are returned; the maintaining space and its validated member public-key hashes are resolved server-side from the spaces repo (/repo/spaces), observers excluded. Entries currently typed as gen:UnansweredQuestion (placeholder stubs) are excluded. When several member-published nanopubs declare the same FAQ entry, only the most recent one is returned. Get FAQ entries of an entity prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix schema: <http://schema.org/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?title ?content ?date ?faq (?np as ?override_target) ?np where { service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } values ?_resource_multi_iri {} graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np dct:created ?date . ?np np:hasAssertion ?a . } filter(contains(?memberPubkeys, ?pubkey)) graph ?a { ?faq rdf:type schema:Question . ?faq rdfs:label ?title . ?faq gen:hasContent ?content . values ?_resource_multi_iri {} ?faq dct:isPartOf ?_resource_multi_iri . filter not exists { ?faq rdf:type gen:UnansweredQuestion } optional { ?faq gen:hasPositionString ?position } } filter not exists { graph npa:graph { ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } ?np2 dct:created ?date2 . ?np2 np:hasAssertion ?a2 . filter (?date2 > ?date) } filter(contains(?memberPubkeys, ?pubkey2)) graph ?a2 { ?faq rdf:type schema:Question . } } } order by ?position ?title Key-value Info table for a biochementity (a chemical entity defined as a subclass of BioChemEntity). Finds the entity's latest defining nanopub ('partid', signed by an owning-resource member pubkey 'pubkey', not invalidated) and shows every field the biochementity template allows: the name (and its Dutch nl-be variant), alternative names, type, superclasses, metabolite/isomer relations, chemical roles, external identifiers, group labels, context-specific aliases, comment, the vocabulary it is part of, and the defining nanopub. Each property is one row with a single value cell: literal values render as text, IRI values render as links labelled by the companion column (linked entities defined on the network show their label). Multi-valued properties are collected into one cell; rows for optional fields are omitted when absent. Get biochementity info prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix schema: <http://schema.org/> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix owl: <http://www.w3.org/2002/07/owl#> prefix obo: <http://purl.obolibrary.org/obo/> prefix pehterms: <https://w3id.org/peh/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> select ?Property_noheader ?Property_label (group_concat(replace(str(?val), '[\r\n]+', ' '); separator='\n') as ?Value_multi_val_noheader) (group_concat(replace(str(?vallabel), '[\r\n]+', ' '); separator='\n') as ?Value_label_multi) where { { select ?ord ?Property_noheader ?Property_label ?val (min(?vallabelRaw) as ?vallabel) where { values ?__pubkey_multi {} graph npa:graph { ?dnp npa:hasValidSignatureForPublicKeyHash ?__pubkey_multi ; (npx:introduces|npx:describes|npx:embeds) ?_partid_iri ; dct:created ?ddate ; np:hasAssertion ?da . filter not exists { ?inv npx:invalidates ?dnp ; npa:hasValidSignatureForPublicKeyHash ?__pubkey_multi . } filter not exists { ?dnp2 npa:hasValidSignatureForPublicKeyHash ?pk2 ; (npx:introduces|npx:describes|npx:embeds) ?_partid_iri ; dct:created ?ddate2 . filter not exists { ?inv2 npx:invalidates ?dnp2 ; npa:hasValidSignatureForPublicKeyHash ?pk2 . } filter(?ddate2 > ?ddate) } } { graph ?da { ?_partid_iri rdfs:label ?v . filter(lang(?v) = '') } bind(1 as ?ord) bind(rdfs:label as ?Property_noheader) bind('Name:' as ?Property_label) bind(str(?v) as ?val) bind('' as ?vallabelRaw) } union { graph ?da { ?_partid_iri rdfs:label ?v . filter(lang(?v) = 'nl-be') } bind(2 as ?ord) bind(rdfs:label as ?Property_noheader) bind('Name (Dutch):' as ?Property_label) bind(str(?v) as ?val) bind('' as ?vallabelRaw) } union { graph ?da { ?_partid_iri schema:alternateName ?v } bind(3 as ?ord) bind(schema:alternateName as ?Property_noheader) bind('Alternative names:' as ?Property_label) bind(if(lang(?v) = 'nl-be', concat(str(?v), ' (nl)'), str(?v)) as ?val) bind('' as ?vallabelRaw) } union { graph ?da { ?_partid_iri rdf:type ?iri } bind(4 as ?ord) bind(rdf:type as ?Property_noheader) bind('Type:' as ?Property_label) bind(str(?iri) as ?val) bind(replace(str(?iri), '^.*[/#]', '') as ?vallabelRaw) } union { graph ?da { ?_partid_iri rdfs:subClassOf ?iri } optional { graph npa:graph { ?vnp npx:introduces ?iri ; np:hasAssertion ?vaa . } graph ?vaa { ?iri rdfs:label ?vlab . filter(lang(?vlab) = '') } } bind(5 as ?ord) bind(rdfs:subClassOf as ?Property_noheader) bind('Subclass of:' as ?Property_label) bind(str(?iri) as ?val) bind(coalesce(?vlab, replace(str(?iri), '^.*[/#]', '')) as ?vallabelRaw) } union { graph ?da { ?_partid_iri pehterms:isMetaboliteOf ?iri } optional { graph npa:graph { ?vnp npx:introduces ?iri ; np:hasAssertion ?vaa . } graph ?vaa { ?iri rdfs:label ?vlab . filter(lang(?vlab) = '') } } bind(6 as ?ord) bind(pehterms:isMetaboliteOf as ?Property_noheader) bind('Is metabolite of:' as ?Property_label) bind(str(?iri) as ?val) bind(coalesce(?vlab, replace(str(?iri), '^.*[/#]', '')) as ?vallabelRaw) } union { graph ?da { ?_partid_iri pehterms:isIsomerOf ?iri } optional { graph npa:graph { ?vnp npx:introduces ?iri ; np:hasAssertion ?vaa . } graph ?vaa { ?iri rdfs:label ?vlab . filter(lang(?vlab) = '') } } bind(7 as ?ord) bind(pehterms:isIsomerOf as ?Property_noheader) bind('Is isomer of:' as ?Property_label) bind(str(?iri) as ?val) bind(coalesce(?vlab, replace(str(?iri), '^.*[/#]', '')) as ?vallabelRaw) } union { graph ?da { ?_partid_iri obo:RO_0000087 ?iri } bind(8 as ?ord) bind(obo:RO_0000087 as ?Property_noheader) bind('Has role:' as ?Property_label) bind(str(?iri) as ?val) bind(replace(str(?iri), '^.*[/#]', '') as ?vallabelRaw) } union { graph ?da { ?_partid_iri skos:exactMatch ?iri } bind(9 as ?ord) bind(skos:exactMatch as ?Property_noheader) bind('External identifiers:' as ?Property_label) bind(str(?iri) as ?val) bind(replace(str(?iri), '^.*/', '') as ?vallabelRaw) } union { graph ?da { ?_partid_iri pehterms:hasGroupLabel ?v } bind(10 as ?ord) bind(pehterms:hasGroupLabel as ?Property_noheader) bind('Group labels:' as ?Property_label) bind(str(?v) as ?val) bind('' as ?vallabelRaw) } union { graph ?da { ?_partid_iri pehterms:hasContextAlias ?ca . } optional { graph ?da { ?ca schema:alternateName ?caName } } optional { graph ?da { ?ca schema:identifier ?caType } } optional { graph ?da { ?ca pehterms:hasContext ?caCtx } } bind(11 as ?ord) bind(pehterms:hasContextAlias as ?Property_noheader) bind('Context aliases:' as ?Property_label) bind(concat(coalesce(str(?caName), '?'), coalesce(concat(' (', str(?caType), ')'), ''), coalesce(concat(' @ ', replace(str(?caCtx), '^.*/', '')), '')) as ?val) bind('' as ?vallabelRaw) } union { graph ?da { ?_partid_iri schema:comment ?v } bind(12 as ?ord) bind(schema:comment as ?Property_noheader) bind('Comment:' as ?Property_label) bind(str(?v) as ?val) bind('' as ?vallabelRaw) } union { graph ?da { ?_partid_iri dct:isPartOf ?iri } optional { graph npa:graph { ?vnp npx:introduces ?iri ; np:hasAssertion ?vaa . } graph ?vaa { ?iri rdfs:label ?vlab . filter(lang(?vlab) = '') } } bind(13 as ?ord) bind(dct:isPartOf as ?Property_noheader) bind('Part of:' as ?Property_label) bind(str(?iri) as ?val) bind(coalesce(?vlab, replace(str(?iri), '^.*[/#]', '')) as ?vallabelRaw) } union { graph npa:graph { ?iri np:hasAssertion ?da . } bind(14 as ?ord) bind(npa:viaNanopub as ?Property_noheader) bind('Defined in:' as ?Property_label) bind(str(?iri) as ?val) bind(substr(replace(str(?iri), '^.*/np/', ''), 1, 10) as ?vallabelRaw) } } group by ?ord ?Property_noheader ?Property_label ?val } } group by ?ord ?Property_noheader ?Property_label order by ?ord This query returns the sub-classes of the given class, restricted to sub-classes that are part of the same space and published by admins, maintainers, or members of that space. Get sub-classes for class (from space members) prefix owl: <http://www.w3.org/2002/07/owl#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?subclass (coalesce(min(?untaggedLabel), min(?anyLabel)) as ?subclass_label) ?date ?np where { # the resource/ontology that the given (parent) class belongs to graph ?pg { ?_class_iri dct:isPartOf ?resource . } # collect the public keys of admins, maintainers, and members of the space maintaining that resource service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select ?resource (group_concat(?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?resource npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } group by ?resource } # sub-classes of the given class, that are part of the same resource and signed by a space member graph ?g { ?subclass rdfs:subClassOf ?_class_iri . ?subclass dct:isPartOf ?resource . } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np npa:hasGraph ?g . ?np np:hasPublicationInfo ?i . ?np dct:created ?date . } filter(contains(?memberPubkeys, ?pubkey)) optional { graph ?g { ?subclass rdfs:label ?subclassLabel1 . } } optional { graph ?g { ?subclass dct:title ?subclassLabel2 . } } optional { graph ?i { ?subclass rdfs:label ?subclassLabel3 . } } optional { graph ?i { ?subclass nt:hasLabelFromApi ?subclassLabel4 . } } bind(coalesce(?subclassLabel1, ?subclassLabel2, ?subclassLabel3, ?subclassLabel4) as ?anyLabel) bind(if(lang(?anyLabel) = "", ?anyLabel, ?noLabel) as ?untaggedLabel) } group by ?subclass ?date ?np order by desc(?date) This query allows for searching for resources (FERs etc.) together with the info about whether GO FAIR qualified them. It performs a Lucene full-text search on labels and descriptions, restricted to FAIR Enabling Resource and FAIR Specification types (optionally narrowed to a single given nanopub type), and excludes retracted/superseded nanopublications, example nanopublications, entries from before 2022, and entries disapproved by the curators. This version merges the functions of the earlier 'Search on FAIR Specifications' and 'FSR lookup' queries. Find GO FAIR qualified things (only valid entries) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix dct: <http://purl.org/dc/terms/> prefix fip: <https://w3id.org/fair/fip/terms/> prefix prov: <http://www.w3.org/ns/prov#> prefix search: <http://www.openrdf.org/contrib/lucenesail#> select 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 { { select distinct ?np where { service <https://w3id.org/np/l/nanopub-query-1.1/repo/text> { { ?np search:matches [ search:query ?_searchterm ; search:property rdfs:label ] . } union { ?np search:matches [ search:query ?_searchterm ; search:property dct:description ] . } } } } graph npa:graph { <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> npa:hasValidSignatureForPublicKey ?curators_np_pk . ?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk . filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . } ?latest_curators_np np:hasAssertion ?latest_curators_assertion . } graph npa:networkGraph { ?latest_curators_np (npx:supersedes)* <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> . filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np } } graph npa:graph { values ?fer_type { fip:FAIR-Specification fip:Data-usage-license fip:Metadata-preservation-policy fip:Persistency-Policy fip:Crosswalk fip:Editor fip:FAIR-Representation-Service fip:Authentication-and-authorization-service fip:Provenance-Tracking-Service fip:Validation-Service fip:Web-API fip:Identifier-service fip:FAIR-Supporting-Software fip:Registry fip:Communication-protocol fip:Knowledge-representation-language fip:Metadata-schema fip:Metadata-data-linking-schema fip:Provenance-model fip:Structured-vocabulary fip:Semantic-model } ?np npx:hasNanopubType ?fer_type . ?np npx:hasNanopubType ?__type_iri . ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?retraction npx:retracts ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?newversion npx:supersedes ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np (npx:introduces|npx:describes) ?thing . ?np rdfs:label ?label . optional { ?np dct:description ?description . } ?np dct:created ?date . filter(str(?date) > "2022") } optional { graph npa:graph { ?disapproval npa:hasValidSignatureForPublicKey ?dpubkey . } graph ?latest_curators_assertion { ?dpubkeys npx:hasPublicKey ?dpubkey . } graph npa:graph { filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . } ?disapproval np:hasAssertion ?da . } graph ?da { ?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np . } } filter(!bound(?disapproval)) # Faster than "filter not exists" for some reason optional { graph npa:graph { ?recommendation_np npx:hasNanopubType fip:recommended-by . ?recommendation_np npa:hasValidSignatureForPublicKey ?rpubkey . filter not exists { ?recommendation_np_x npx:invalidates ?recommendation_np ; npa:hasValidSignatureForPublicKey ?rpubkey . } ?recommendation_np np:hasAssertion ?ra . ?recommendation_np np:hasProvenance ?rp . } graph ?ra { ?thing fip:recommended-by ?recommender . } graph ?rp { ?ra prov:wasDerivedFrom ?rfip_np . } graph npa:graph { ?rfip_np npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile . ?rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey . ?latest_rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey . filter not exists { ?latest_rfip_npx npx:invalidates ?latest_rfip_np ; npa:hasValidSignatureForPublicKey ?rfip_pubkey . } } graph npa:networkGraph { ?latest_rfip_np (npx:supersedes)* ?rfip_np . } graph ?rfip_qa { ?rfip_qualifier npx:qualifies ?latest_rfip_np . } graph npa:graph { ?rfip_qualification_np np:hasAssertion ?rfip_qa . ?rfip_qualification_np npx:hasNanopubType npx:qualifies . ?rfip_qualification_np npa:hasValidSignatureForPublicKey ?rfip_qpubkey . filter not exists { ?rfip_qualification_np_x npx:invalidates ?rfip_qualification_np ; npa:hasValidSignatureForPublicKey ?rfip_qpubkey . } } graph ?latest_curators_assertion { ?rfip_qpubkeys npx:hasPublicKey ?rfip_qpubkey . } } optional { graph npa:graph { ?qualification_np npx:hasNanopubType npx:qualifies . ?qualification_np npa:hasValidSignatureForPublicKey ?qpubkey . } graph ?latest_curators_assertion { ?qpubkeys npx:hasPublicKey ?qpubkey . } graph npa:graph { filter not exists { ?qualification_np_x npx:invalidates ?qualification_np ; npa:hasValidSignatureForPublicKey ?qpubkey . } ?qualification_np np:hasAssertion ?qa . } graph ?qa { ?qualifier npx:qualifies ?np . } } optional { graph npa:graph { ?fairAssessmentLevelNp_ npx:hasNanopubType fip:has-FAIR-assessment . ?fairAssessmentLevelNp_ npa:hasValidSignatureForPublicKey ?lpubkey . filter not exists { ?fairAssessmentLevelNp_x npx:invalidates ?fairAssessmentLevelNp_ ; npa:hasValidSignatureForPublicKey ?lpubkey . } ?fairAssessmentLevelNp_ np:hasAssertion ?la . } graph ?latest_curators_assertion { ?lpubkeys npx:hasPublicKey ?lpubkey . } graph ?la { ?thing fip:has-FAIR-assessment ?fairAssessmentLevel_ . } } } group by ?thing ?label ?description ?np ?date ?pubkey ?qualifier ?qualification_np order by desc(?recommender_count) asc(?label) Returns the version history of a space-governed definition kind (e.g. a template kind or view kind) given as the resource, for display on its maintained-resource page. Each row is a non-invalidated nanopub whose embedded instance declares dct:isVersionOf the given kind, showing its creation date, an 'Open as form' link that opens the version's embedded template in the /publish form (labelled with the version's title), the change note attached to that version's publication info (skos:changeNote, truncated to its first line and at most 50 characters), and its author (signer, with the name resolved from the governing space's trust state where available). The row marked '✓ current' is the current governed winner of the (kind, space) pair -- the newest non-invalidated version signed by a current member+ of the governing space, with the kind validated as maintained by that space (mirroring the get-latest-governed-version resolver and the get-assertion-templates dedup). Governed winners are materialized once in a self-contained sub-select sharing no variables with the outer query, then matched by string containment. The override_target column carries the nanopub URI only for the current row (empty otherwise), so a per-row override action is offered only on the current version. Rows are ordered newest first. Get template kind version history prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix skos: <http://www.w3.org/2004/02/skos/core#> select ?Date ?Open_as_form ?Change_note ?Author ?Author_label ?Status_noheader ?override_target ?np ?np_label where { values ?_resource_multi_iri {} { select (group_concat(?w1; separator="|") as ?winners) where { { select ?gKind ?gSpace (max(concat(str(?gDate), ">", str(?gNp))) as ?maxW) where { graph npa:graph { ?gNp npa:hasValidSignatureForPublicKeyHash ?gPubkeyhash ; dct:created ?gDate ; npx:embeds ?gVersion ; np:hasAssertion ?gA . filter not exists { ?gInv npx:invalidates ?gNp ; npa:hasValidSignatureForPublicKeyHash ?gPubkeyhash . } } graph ?gA { ?gVersion dct:isVersionOf ?gKind ; gen:governedBy ?gSpace . } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?gKind npa:isMaintainedBy ?gSpace ; npa:hasGoverningSpaceRef ?gRef . ?gRi a gen:RoleInstantiation ; npa:forSpace ?gSpace ; npa:forSpaceRef ?gRef ; npa:hasRoleType ?gTier ; npa:forAgent ?gAgent . filter(?gTier = gen:AdminRole || ?gTier = gen:MaintainerRole || ?gTier = gen:MemberRole) ?gAcct a npa:AccountState ; npa:agent ?gAgent ; npa:pubkey ?gPubkeyhash . } } } group by ?gKind ?gSpace } bind(concat(str(?gKind), ">", str(?gSpace), ">", ?maxW) as ?w1) } } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkeyhash ; npx:embeds ?version ; dct:created ?Date ; np:hasAssertion ?a ; np:hasPublicationInfo ?pi . filter not exists { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkeyhash . } optional { ?np npx:signedBy ?Author . } } graph ?a { ?version dct:isVersionOf ?_resource_multi_iri . } optional { graph ?a { ?version rdfs:label ?titleVal } } optional { graph ?a { ?version gen:governedBy ?space } } optional { graph ?pi { ?np skos:changeNote ?noteRaw } } bind(replace(coalesce(?noteRaw, ""), "\r", "") as ?noteNoCr) bind(if(contains(?noteNoCr, "\n"), strbefore(?noteNoCr, "\n"), ?noteNoCr) as ?firstLine) bind(substr(?firstLine, 1, 50) as ?Change_note) bind(concat('<span><a href="/publish?template=', encode_for_uri(str(?version)), '">', coalesce(?titleVal, str(?version)), '</a></span>') as ?Open_as_form) bind(concat("|", coalesce(?winners, ""), "|") as ?wlist) bind(if(bound(?space) && contains(?wlist, concat("|", str(?_resource_multi_iri), ">", str(?space), ">", str(?Date), ">", str(?np), "|")), "✓ current", "") as ?Status_noheader) bind(if(?Status_noheader != "", str(?np), "") as ?override_target) bind(coalesce(?Author, <http://purl.org/nanopub/temp/none>) as ?AuthorSafe) optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?nStateG . } graph ?nStateG { ?AuthorSafe foaf:name ?Author_label . } } } bind("^" as ?np_label) } order by desc(?Date) Returns key-value facts about a space-governed template kind given as the resource, for display on its maintained-resource page: the label, description, tag, governing space, current governed version nanopub (shown as its short artifact code), and its last-modified date and author, all read off the current governed winner of the (kind, space) pair (newest non-invalidated version signed by a current member+ of the governing space, with the kind validated as maintained by that space -- mirroring get-latest-governed-version). It also yields a 'Use this template' row: a root-relative link (/publish?template=...) that opens the current version's template node on the Nanodash /publish page as a fillable form, with the template's title as the link text. Governed winners are materialized once per kind in a self-contained sub-select. Both columns use the '_noheader' convention so the redundant header row is dropped. Get template info prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?Property_noheader ?Value_noheader ?Value_label where { values ?_resource_multi_iri {} { select ?gKind (max(concat(str(?gDate), '>', str(?gNp))) as ?maxW) where { graph npa:graph { ?gNp npa:hasValidSignatureForPublicKeyHash ?gPubkeyhash ; dct:created ?gDate ; npx:embeds ?gVersion ; np:hasAssertion ?gA . filter not exists { ?gInv npx:invalidates ?gNp ; npa:hasValidSignatureForPublicKeyHash ?gPubkeyhash . } } graph ?gA { ?gVersion dct:isVersionOf ?gKind ; gen:governedBy ?gSpace . } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?gKind npa:isMaintainedBy ?gSpace ; npa:hasGoverningSpaceRef ?gRef . ?gRi a gen:RoleInstantiation ; npa:forSpace ?gSpace ; npa:forSpaceRef ?gRef ; npa:hasRoleType ?gTier ; npa:forAgent ?gAgent . filter(?gTier = gen:AdminRole || ?gTier = gen:MaintainerRole || ?gTier = gen:MemberRole) ?gAcct a npa:AccountState ; npa:agent ?gAgent ; npa:pubkey ?gPubkeyhash . } } } group by ?gKind } filter(?gKind = ?_resource_multi_iri) bind(iri(strafter(?maxW, '>')) as ?np) graph npa:graph { ?np npx:embeds ?tmpl ; dct:created ?dateVal ; np:hasAssertion ?a . optional { ?np npx:signedBy ?authorVal . } } graph ?a { ?tmpl dct:isVersionOf ?_resource_multi_iri ; gen:governedBy ?spaceVal . } optional { graph ?a { ?tmpl rdfs:label ?labelVal } } optional { graph ?a { ?tmpl dct:description ?descVal } } optional { graph ?a { ?tmpl nt:hasTag ?tagVal } } bind(concat('<span><a href="/publish?template=', encode_for_uri(str(?tmpl)), '">', coalesce(?labelVal, str(?tmpl)), '</a></span>') as ?formLink) values (?ord ?Property_noheader) { (1 'Label:') (2 'Description:') (3 'Tag:') (4 'Governed by:') (5 'Current version:') (6 'Last modified:') (7 'Last modified by:') (8 'Use this template:') } bind(if(?ord=1, ?labelVal, if(?ord=2, ?descVal, if(?ord=3, ?tagVal, if(?ord=4, ?spaceVal, if(?ord=5, ?np, if(?ord=6, str(?dateVal), if(?ord=7, ?authorVal, if(?ord=8, ?formLink, '')))))))) as ?Value_noheader) filter(bound(?Value_noheader)) bind(if(?ord=5, concat(substr(strafter(str(?np), '/np/'), 1, 10), '…'), '') as ?Value_label) } order by ?ord Get One Health domains per project for a space and its sub-spaces prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix oh: <https://w3id.org/spaces/zonmw/r/onehealth/> select ?project ?project_label (group_concat(distinct str(?domain); separator="\n") as ?domains_multi_iri) (group_concat(distinct ?domain_label; separator="\n") as ?domains_label_multi) (count(distinct ?domain) as ?n_domains) (if(count(distinct ?domain) > 1, "yes", "no") as ?cross_domain) ?np ("^" as ?np_label) where { values ?_space_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(distinct ?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . } values ?_space_multi_iri {} graph ?stateG { ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?npPubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?npPubkey . } filter not exists { ?supNp npx:supersedes ?np . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?pi . } filter(contains(?memberPubkeys, ?npPubkey)) graph ?a { ?project oh:domain ?domain . } filter(?project = ?_space_multi_iri || strstarts(str(?project), concat(str(?_space_multi_iri), "/"))) optional { graph ?pi { ?project nt:hasLabelFromApi ?project_label } } bind(strafter(str(?domain), "https://w3id.org/spaces/zonmw/r/onehealth/") as ?domain_label) } group by ?project ?project_label ?np order by ?project_label Get existing datasets reused per project for a space and its sub-spaces prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix ff: <https://w3id.org/fair/ff/terms/> prefix oh: <https://w3id.org/spaces/zonmw/r/onehealth/> select ?project ?project_label ?dataset ?dataset_label ?publisher (group_concat(distinct str(?domain); separator="\n") as ?domains_multi_iri) (group_concat(distinct ?domain_label; separator="\n") as ?domains_label_multi) ?np ("^" as ?np_label) where { values ?_space_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(distinct ?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . } values ?_space_multi_iri {} graph ?stateG { ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?npPubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?npPubkey . } filter not exists { ?supNp npx:supersedes ?np . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?pi . } filter(contains(?memberPubkeys, ?npPubkey)) graph ?a { ?project ff:reuses ?dataset . ?dataset rdfs:label ?dataset_label . optional { ?dataset dct:publisher ?publisher } optional { ?dataset oh:domain ?domain } } filter(?project = ?_space_multi_iri || strstarts(str(?project), concat(str(?_space_multi_iri), "/"))) optional { graph ?pi { ?project nt:hasLabelFromApi ?project_label } } bind(strafter(str(?domain), "https://w3id.org/spaces/zonmw/r/onehealth/") as ?domain_label) } group by ?project ?project_label ?dataset ?dataset_label ?publisher ?np order by ?project_label ?dataset_label Returns basic key-value facts about a given maintained resource (its description, type, namespace, the space that maintains it, and the currently active declaration nanopub that links the resource to that space), taken from its latest non-invalidated declaration nanopub. Only the most recent valid declaration is considered, so outdated declarations by other signing keys are ignored. Each property and value is rendered as a link to its defining IRI where applicable, and the type can carry multiple values. The namespace is shown as its full URL, trimmed in the middle with an ellipsis beyond 80 characters. Both columns use the '_noheader' convention so the redundant header row is dropped. Get maintained resource info prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?Property_noheader ?Property_label ?Value_noheader ?Value_label where { values ?_resource_multi_iri {} { select ?_resource_multi_iri (max(?cDate) as ?latestDate) where { values ?_resource_multi_iri {} graph npa:graph { ?cnp npx:hasNanopubType gen:MaintainedResource . ?cnp npa:hasValidSignatureForPublicKeyHash ?cPubkey . filter not exists { ?cnpx npx:invalidates ?cnp ; npa:hasValidSignatureForPublicKeyHash ?cPubkey . } ?cnp npx:introduces ?_resource_multi_iri . ?cnp dct:created ?cDate . } } group by ?_resource_multi_iri } graph npa:graph { ?np npx:hasNanopubType gen:MaintainedResource . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np npx:introduces ?_resource_multi_iri . ?np dct:created ?latestDate . ?np np:hasAssertion ?a . } graph ?a { ?_resource_multi_iri a gen:MaintainedResource . } optional { graph ?a { ?_resource_multi_iri dct:description ?descVal } } optional { graph ?a { ?_resource_multi_iri a ?typeIri . filter(?typeIri != gen:MaintainedResource) } } optional { graph ?a { ?_resource_multi_iri gen:hasNamespace ?nsVal } } optional { graph ?a { ?_resource_multi_iri gen:isMaintainedBy ?spaceVal } } bind(strlen(str(?nsVal)) as ?nsLen) bind(if(?nsLen > 80, concat(substr(str(?nsVal), 1, 38), '...', substr(str(?nsVal), ?nsLen - 37)), str(?nsVal)) as ?nsDisp) bind(concat('<span>', ?nsDisp, '</span>') as ?nsAnchor) values (?key ?Property_noheader ?Property_label) { ('Description' dct:description 'Description:') ('Type' rdf:type 'Type:') ('Namespace' gen:hasNamespace 'Namespace:') ('Maintained by' gen:isMaintainedBy 'Maintained by:') ('Declaration' npa:viaNanopub 'Declaration:') } bind(if(?key='Type', ?typeIri, if(?key='Namespace', ?nsAnchor, if(?key='Description', str(?descVal), if(?key='Maintained by', ?spaceVal, ?np)))) as ?Value_noheader) filter(bound(?Value_noheader)) bind(if(?key='Type', replace(str(?typeIri), '^.*[/#]', ''), '') as ?Value_label) } order by (if(?key='Description', 1, if(?key='Type', 2, if(?key='Namespace', 3, if(?key='Maintained by', 4, 5))))) Get informal / public-engagement outputs per project for a space and its sub-spaces prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix ff: <https://w3id.org/fair/ff/terms/> prefix prov: <http://www.w3.org/ns/prov#> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?project ?project_label ?kind ?output ?output_label ?author_label ?np ("^" as ?np_label) where { values ?_space_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(distinct ?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . } values ?_space_multi_iri {} graph ?stateG { ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?npPubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?npPubkey . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?pi . } filter(contains(?memberPubkeys, ?npPubkey)) graph ?a { ?project ?rel ?output . values ?rel { ff:has-blog-post ff:has-media-coverage ff:has-social-post ff:has-podcast ff:has-discussion } optional { ?output rdfs:label ?output_label } } filter(?project = ?_space_multi_iri || strstarts(str(?project), concat(str(?_space_multi_iri), "/"))) bind(strafter(str(?rel), "https://w3id.org/fair/ff/terms/has-") as ?kind) optional { graph ?pi { ?project nt:hasLabelFromApi ?project_label } } optional { graph ?a { ?output prov:wasAttributedTo ?author } graph ?pi { ?author foaf:name ?author_label } } } order by ?project_label ?kind ?output_label Returns the existing datasets a given project reused as input (via ff:reuses), with each dataset's title, custodian/publisher, and One Health domain(s), restricted to links authored by a member, maintainer, or admin of the project's space. Get reused datasets for project prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix ff: <https://w3id.org/fair/ff/terms/> prefix oh: <https://w3id.org/spaces/zonmw/r/onehealth/> select ?dataset ?dataset_label ?publisher (group_concat(distinct str(?domain); separator="\n") as ?domains_multi_iri) (group_concat(distinct ?domain_label; separator="\n") as ?domains_label_multi) ?np ("^" as ?np_label) where { values ?_project_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . } values ?_project_multi_iri {} graph ?stateG { ?_project_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?roleType . filter(?roleType in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?npPubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?npPubkey . } filter not exists { ?supNp npx:supersedes ?np . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?pi . } filter(contains(?memberPubkeys, ?npPubkey)) graph ?a { ?_project_multi_iri ff:reuses ?dataset . ?dataset rdfs:label ?dataset_label . optional { ?dataset dct:publisher ?publisher } optional { ?dataset oh:domain ?domain } } bind(strafter(str(?domain), "https://w3id.org/spaces/zonmw/r/onehealth/") as ?domain_label) } group by ?dataset ?dataset_label ?publisher ?np order by ?dataset_label Returns the assertion templates created by the given user. Supports both template identity shapes: for templates with embedded identity (anchored via the npx:embeds triple), the label, tags, and publish link are based on the embedded template node (the IRI external references should carry); for legacy templates, the nanopub URI is used and the node is the assertion graph URI. Multiple tags are concatenated into one multi-value column, and dual labels collapse to one (untagged-language label preferred). Governed versions are deduplicated within the user's own output: of the user's non-invalidated versions declaring the same dct:isVersionOf plus gen:governedBy pair, only the newest is listed (no space-membership check, as the list reflects what the user created; the winners are materialized once in a single-row group_concat sub-select sharing no variables with the outer query). Get templates by given user prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select (concat("<span><a href=\"/publish?template=", encode_for_uri(str(?template_iri)), "\">", coalesce(min(?ulabel), min(?anylabel)), "</a></span>") as ?label) (group_concat(distinct replace(replace(str(?tag), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as ?tags_multi) ?date ?np ("^" as ?np_label) where { { select (group_concat(?w1; separator="|") as ?winners) where { { select ?gKind ?gSpace (max(concat(str(?gDate), ">", str(?gNp))) as ?maxW) where { graph npa:graph { ?gNp npx:signedBy ?_user_iri ; npa:hasValidSignatureForPublicKey ?gPubkey ; dct:created ?gDate ; npx:embeds ?gVersion ; np:hasAssertion ?gA . filter not exists { ?gInv npx:invalidates ?gNp ; npa:hasValidSignatureForPublicKey ?gPubkey . } } graph ?gA { ?gVersion dct:isVersionOf ?gKind ; gen:governedBy ?gSpace . } } group by ?gKind ?gSpace } bind(concat(str(?gKind), ">", str(?gSpace), ">", ?maxW) as ?w1) } } graph npa:graph { ?np npx:signedBy ?_user_iri . ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np npx:hasNanopubType nt:AssertionTemplate . ?np dct:created ?date . ?np np:hasAssertion ?a . } optional { graph npa:graph { ?np npx:embeds ?tnode . } graph ?a { ?tnode a nt:AssertionTemplate . } } bind(coalesce(?tnode, ?a) as ?t) bind(if(?t = ?a, ?np, ?t) as ?template_iri) graph ?a { ?t rdfs:label ?anylabel . } optional { graph ?a { ?t rdfs:label ?ulabel . filter(lang(?ulabel) = "") } } optional { graph ?a { ?t nt:hasTag ?tag . } } filter not exists { graph ?a { ?t a nt:UnlistedTemplate } } optional { graph ?a { ?t dct:isVersionOf ?kind ; gen:governedBy ?space . } } bind(concat("|", coalesce(?winners, ""), "|") as ?wlist) filter( !bound(?kind) || !contains(?wlist, concat("|", str(?kind), ">", str(?space), ">")) || contains(?wlist, concat("|", str(?kind), ">", str(?space), ">", str(?date), ">", str(?np), "|")) ) } group by ?template_iri ?date ?np order by desc(?date) Returns the basic info of all provenance templates. Supports both template identity shapes (docs/template-identity-and-governance.md in the nanodash repo): the label is read off the node typed nt:ProvenanceTemplate in the assertion -- the assertion graph URI for legacy templates, the embedded template node for templates with embedded identity -- falling back to the assertion graph URI if no typed node is found. Governed version pairs are deduplicated: a version declaring dct:isVersionOf plus gen:governedBy is listed only if it is the current governed winner of its (kind, space) pair -- the newest non-invalidated version signed by a current member+ of the governing space, with the kind validated as maintained by that space (mirroring the get-latest-governed-version resolver). The winners are materialized once in a single-row group_concat sub-select sharing no variables with the outer query, then checked via string containment; this replaces the previous optional-joined sub-select, which relied on RDF4J's non-standard left-join behavior (under strict SPARQL semantics the unbound cross-join would drop non-governed templates) and risked per-row re-evaluation of the federated SERVICE call. A governed version whose pair does not validate is kept (inert gen:governedBy, matching the resolver's pin-is-the-floor semantics); non-governed versions are unaffected. Get provenance templates prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?np ?pubkey ?pubkeyhash ?date ?label ?creator where { { select (group_concat(?w1; separator="|") as ?winners) where { { select ?gKind ?gSpace (max(concat(str(?gDate), ">", str(?gNp))) as ?maxW) where { graph npa:graph { ?gNp npa:hasValidSignatureForPublicKeyHash ?gPubkeyhash ; dct:created ?gDate ; npx:embeds ?gVersion ; np:hasAssertion ?gA . filter not exists { ?gInv npx:invalidates ?gNp ; npa:hasValidSignatureForPublicKeyHash ?gPubkeyhash . } } graph ?gA { ?gVersion dct:isVersionOf ?gKind ; gen:governedBy ?gSpace . } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?gKind npa:isMaintainedBy ?gSpace ; npa:hasGoverningSpaceRef ?gRef . ?gRi a gen:RoleInstantiation ; npa:forSpace ?gSpace ; npa:forSpaceRef ?gRef ; npa:hasRoleType ?gTier ; npa:forAgent ?gAgent . filter(?gTier = gen:AdminRole || ?gTier = gen:MaintainerRole || ?gTier = gen:MemberRole) ?gAcct a npa:AccountState ; npa:agent ?gAgent ; npa:pubkey ?gPubkeyhash . } } } group by ?gKind ?gSpace } bind(concat(str(?gKind), ">", str(?gSpace), ">", ?maxW) as ?w1) } } graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np npa:hasValidSignatureForPublicKeyHash ?pubkeyhash . ?np npx:hasNanopubType nt:ProvenanceTemplate . ?np dct:created ?date . ?np np:hasAssertion ?a . optional { ?np npx:signedBy ?creator . } } optional { graph ?a { ?tnode a nt:ProvenanceTemplate } } bind(coalesce(?tnode, ?a) as ?t) graph ?a { ?t rdfs:label ?label . } optional { graph ?a { ?t dct:isVersionOf ?kind ; gen:governedBy ?space . } } bind(concat("|", coalesce(?winners, ""), "|") as ?wlist) filter( !bound(?kind) || !contains(?wlist, concat("|", str(?kind), ">", str(?space), ">")) || contains(?wlist, concat("|", str(?kind), ">", str(?space), ">", str(?date), ">", str(?np), "|")) ) } order by desc(?date) Returns the basic info of all pubinfo templates. Supports both template identity shapes (docs/template-identity-and-governance.md in the nanodash repo): the label is read off the node typed nt:PubinfoTemplate in the assertion -- the assertion graph URI for legacy templates, the embedded template node for templates with embedded identity -- falling back to the assertion graph URI if no typed node is found. Governed version pairs are deduplicated: a version declaring dct:isVersionOf plus gen:governedBy is listed only if it is the current governed winner of its (kind, space) pair -- the newest non-invalidated version signed by a current member+ of the governing space, with the kind validated as maintained by that space (mirroring the get-latest-governed-version resolver). The winners are materialized once in a single-row group_concat sub-select sharing no variables with the outer query, then checked via string containment; this replaces the previous optional-joined sub-select, which relied on RDF4J's non-standard left-join behavior (under strict SPARQL semantics the unbound cross-join would drop non-governed templates) and risked per-row re-evaluation of the federated SERVICE call. A governed version whose pair does not validate is kept (inert gen:governedBy, matching the resolver's pin-is-the-floor semantics); non-governed versions are unaffected. Get pubinfo templates prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?np ?pubkey ?pubkeyhash ?date ?label ?creator where { { select (group_concat(?w1; separator="|") as ?winners) where { { select ?gKind ?gSpace (max(concat(str(?gDate), ">", str(?gNp))) as ?maxW) where { graph npa:graph { ?gNp npa:hasValidSignatureForPublicKeyHash ?gPubkeyhash ; dct:created ?gDate ; npx:embeds ?gVersion ; np:hasAssertion ?gA . filter not exists { ?gInv npx:invalidates ?gNp ; npa:hasValidSignatureForPublicKeyHash ?gPubkeyhash . } } graph ?gA { ?gVersion dct:isVersionOf ?gKind ; gen:governedBy ?gSpace . } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?gKind npa:isMaintainedBy ?gSpace ; npa:hasGoverningSpaceRef ?gRef . ?gRi a gen:RoleInstantiation ; npa:forSpace ?gSpace ; npa:forSpaceRef ?gRef ; npa:hasRoleType ?gTier ; npa:forAgent ?gAgent . filter(?gTier = gen:AdminRole || ?gTier = gen:MaintainerRole || ?gTier = gen:MemberRole) ?gAcct a npa:AccountState ; npa:agent ?gAgent ; npa:pubkey ?gPubkeyhash . } } } group by ?gKind ?gSpace } bind(concat(str(?gKind), ">", str(?gSpace), ">", ?maxW) as ?w1) } } graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np npa:hasValidSignatureForPublicKeyHash ?pubkeyhash . ?np npx:hasNanopubType nt:PubinfoTemplate . ?np dct:created ?date . ?np np:hasAssertion ?a . optional { ?np npx:signedBy ?creator . } } optional { graph ?a { ?tnode a nt:PubinfoTemplate } } bind(coalesce(?tnode, ?a) as ?t) graph ?a { ?t rdfs:label ?label . } optional { graph ?a { ?t dct:isVersionOf ?kind ; gen:governedBy ?space . } } bind(concat("|", coalesce(?winners, ""), "|") as ?wlist) filter( !bound(?kind) || !contains(?wlist, concat("|", str(?kind), ">", str(?space), ">")) || contains(?wlist, concat("|", str(?kind), ">", str(?space), ">", str(?date), ">", str(?np), "|")) ) } order by desc(?date) Returns the basic info of all assertion templates. Supports both template identity shapes (docs/template-identity-and-governance.md in the nanodash repo): the label, tag, and unlisted flag are read off the node typed nt:AssertionTemplate in the assertion -- the assertion graph URI for legacy templates, the embedded template node for templates with embedded identity -- falling back to the assertion graph URI if no typed node is found. Governed version pairs are deduplicated: a version declaring dct:isVersionOf plus gen:governedBy is listed only if it is the current governed winner of its (kind, space) pair -- the newest non-invalidated version signed by a current member+ of the governing space, with the kind validated as maintained by that space (mirroring the get-latest-governed-version resolver). The winners are materialized once in a single-row group_concat sub-select sharing no variables with the outer query, then checked via string containment; this replaces the previous optional-joined sub-select, which relied on RDF4J's non-standard left-join behavior (under strict SPARQL semantics the unbound cross-join would drop non-governed templates) and risked per-row re-evaluation of the federated SERVICE call. A governed version whose pair does not validate is kept (inert gen:governedBy, matching the resolver's pin-is-the-floor semantics); non-governed versions are unaffected. Get assertion templates prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?np ?pubkey ?pubkeyhash ?date ?label ?tag ?unlisted ?creator where { { select (group_concat(?w1; separator="|") as ?winners) where { { select ?gKind ?gSpace (max(concat(str(?gDate), ">", str(?gNp))) as ?maxW) where { graph npa:graph { ?gNp npa:hasValidSignatureForPublicKeyHash ?gPubkeyhash ; dct:created ?gDate ; npx:embeds ?gVersion ; np:hasAssertion ?gA . filter not exists { ?gInv npx:invalidates ?gNp ; npa:hasValidSignatureForPublicKeyHash ?gPubkeyhash . } } graph ?gA { ?gVersion dct:isVersionOf ?gKind ; gen:governedBy ?gSpace . } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?gKind npa:isMaintainedBy ?gSpace ; npa:hasGoverningSpaceRef ?gRef . ?gRi a gen:RoleInstantiation ; npa:forSpace ?gSpace ; npa:forSpaceRef ?gRef ; npa:hasRoleType ?gTier ; npa:forAgent ?gAgent . filter(?gTier = gen:AdminRole || ?gTier = gen:MaintainerRole || ?gTier = gen:MemberRole) ?gAcct a npa:AccountState ; npa:agent ?gAgent ; npa:pubkey ?gPubkeyhash . } } } group by ?gKind ?gSpace } bind(concat(str(?gKind), ">", str(?gSpace), ">", ?maxW) as ?w1) } } graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np npa:hasValidSignatureForPublicKeyHash ?pubkeyhash . ?np npx:hasNanopubType nt:AssertionTemplate . ?np dct:created ?date . ?np np:hasAssertion ?a . optional { ?np npx:signedBy ?creator . } } optional { graph ?a { ?tnode a nt:AssertionTemplate } } bind(coalesce(?tnode, ?a) as ?t) optional { graph ?a { ?t rdfs:label ?label } } optional { graph ?a { ?t nt:hasTag ?tag . } } bind(exists { graph ?a { ?t a nt:UnlistedTemplate } } as ?unlisted) optional { graph ?a { ?t dct:isVersionOf ?kind ; gen:governedBy ?space . } } bind(concat("|", coalesce(?winners, ""), "|") as ?wlist) filter( !bound(?kind) || !contains(?wlist, concat("|", str(?kind), ">", str(?space), ">")) || contains(?wlist, concat("|", str(?kind), ">", str(?space), ">", str(?date), ">", str(?np), "|")) ) } order by desc(?date) Returns all assertion templates with their label, tags, creator and date, ordered by descending date. Supports both template identity shapes: for templates with embedded identity (anchored via the npx:embeds triple), the returned template IRI is the embedded template node (the IRI external references should carry) and label/tags are read off that node; for legacy templates, the nanopub URI is returned and label/tags are read off the assertion graph node. Multiple tags are concatenated into one multi-value column, and dual labels collapse to one (untagged-language label preferred). Governed version pairs are deduplicated: a version declaring dct:isVersionOf plus gen:governedBy is listed only if it is the current governed winner of its (kind, space) pair -- the newest non-invalidated version signed by a current member+ of the governing space, with the kind validated as maintained by that space (mirroring the get-latest-governed-version resolver). The winners are materialized once in a single-row group_concat sub-select and checked via string containment, avoiding per-row re-evaluation of the federated SERVICE call. A governed version whose pair does not validate is kept (inert gen:governedBy); non-governed versions are unaffected. Get all templates prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?template_iri (coalesce(min(?ulabel), min(?anylabel)) as ?template_iri_label) (group_concat(distinct replace(replace(str(?tag), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as ?tags_multi) ?creator ?date ?np ("^" as ?np_label) where { { select (group_concat(?w1; separator="|") as ?winners) where { { select ?gKind ?gSpace (max(concat(str(?gDate), ">", str(?gNp))) as ?maxW) where { graph npa:graph { ?gNp npa:hasValidSignatureForPublicKeyHash ?gPubkeyhash ; dct:created ?gDate ; npx:embeds ?gVersion ; np:hasAssertion ?gA . filter not exists { ?gInv npx:invalidates ?gNp ; npa:hasValidSignatureForPublicKeyHash ?gPubkeyhash . } } graph ?gA { ?gVersion dct:isVersionOf ?gKind ; gen:governedBy ?gSpace . } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?gKind npa:isMaintainedBy ?gSpace ; npa:hasGoverningSpaceRef ?gRef . ?gRi a gen:RoleInstantiation ; npa:forSpace ?gSpace ; npa:forSpaceRef ?gRef ; npa:hasRoleType ?gTier ; npa:forAgent ?gAgent . filter(?gTier = gen:AdminRole || ?gTier = gen:MaintainerRole || ?gTier = gen:MemberRole) ?gAcct a npa:AccountState ; npa:agent ?gAgent ; npa:pubkey ?gPubkeyhash . } } } group by ?gKind ?gSpace } bind(concat(str(?gKind), ">", str(?gSpace), ">", ?maxW) as ?w1) } } graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np npx:hasNanopubType nt:AssertionTemplate . ?np dct:created ?date . ?np np:hasAssertion ?a . optional { ?np npx:signedBy ?creator . } } optional { graph npa:graph { ?np npx:embeds ?tnode . } graph ?a { ?tnode a nt:AssertionTemplate . } } bind(coalesce(?tnode, ?a) as ?t) bind(if(?t = ?a, ?np, ?t) as ?template_iri) optional { graph ?a { ?t rdfs:label ?ulabel . filter(lang(?ulabel) = "") } } optional { graph ?a { ?t rdfs:label ?anylabel } } optional { graph ?a { ?t nt:hasTag ?tag . } } filter not exists { graph ?a { ?t a nt:UnlistedTemplate } } optional { graph ?a { ?t dct:isVersionOf ?kind ; gen:governedBy ?space . } } bind(concat("|", coalesce(?winners, ""), "|") as ?wlist) filter( !bound(?kind) || !contains(?wlist, concat("|", str(?kind), ">", str(?space), ">")) || contains(?wlist, concat("|", str(?kind), ">", str(?space), ">", str(?date), ">", str(?np), "|")) ) } group by ?template_iri ?creator ?date ?np order by desc(?date) Resolves the canonical (latest authorized) version of a space-governed definition -- a resource view, an assertion/provenance/pubinfo template, or any other definition whose versions follow the embeds/isVersionOf/governedBy convention -- per docs/views-and-presets-as-maintained-resources.md and docs/template-identity-and-governance.md in the nanodash repo. Takes the definition's kind IRI (its dct:isVersionOf target; kind) and the governing space IRI (space) and returns at most one row: the newest version whose nanopub (a) npx:embeds the version IRI, which declares dct:isVersionOf <kind> plus gen:governedBy <space> in the assertion, and (b) is signed by a pubkey of a CURRENT member+ (admin/maintainer/member, not observer) of that space's governing ref -- with the kind validated as a maintained resource of the space (npa:isMaintainedBy + npa:hasGoverningSpaceRef in the materialized state graph; the two anchors that make gen:governedBy a label, not a grant). The RoleInstantiation's npa:forSpace/npa:forSpaceRef pair ties the governing ref to the given space IRI, so a multi-maintainer kind never floats across pairs. An empty result means no valid floating candidate: the caller keeps its pinned version (the pin is the floor and is not re-validated here). Versions retracted by their own signing key are skipped. Hosted on the spaces repo; the version/pubkey lookup federates to the full repo with kind and space as text-substituted constants, so the federated scan stays narrow (entry via dct:isVersionOf <kind>). This version generalizes the previous view-specific one (which federated to the gen:ResourceView type repo) to definitions of any type, so the same resolver serves views and templates alike. Get latest governed version prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?version ?date ?np ("^" as ?np_label) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?_kind_iri npa:isMaintainedBy ?_space_iri ; npa:hasGoverningSpaceRef ?ref . ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_iri ; npa:forSpaceRef ?ref ; npa:hasRoleType ?tier ; npa:forAgent ?agent . filter(?tier = gen:AdminRole || ?tier = gen:MaintainerRole || ?tier = gen:MemberRole) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?pubkey . } service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?version ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } graph ?a { ?version dct:isVersionOf ?_kind_iri ; gen:governedBy ?_space_iri . } } } order by desc(?date) desc(?np) limit 1 Like 'Get the classes of an ontology from space members', but links classes to the ontology via dct:isPartOf (the predicate used by the biochementity template). Returns the biochementities (owl:Class) that declare dct:isPartOf the given resource, restricted to nanopubs published by an admin, maintainer, or member of the space that maintains the resource. The maintaining space and its validated member public-key hashes are resolved server-side from the spaces repo (/repo/spaces); observers are excluded. Each class URI appears once, kept from the latest (by nanopub timestamp) member-published definition. Superclass labels are taken from the superclass' own rdfs:label when it is a biochementity in the same ontology. The types column lists any rdf:type assignments besides owl:Class. The last_modified_by/last_modified columns give the signer and timestamp of that latest definition; the signer name is resolved from the trust repo (/repo/trust) or left blank. Get the biochementities of an ontology from space members prefix owl: <http://www.w3.org/2002/07/owl#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?class ?class_label ?description ?superclasses_multi_iri ?superclasses_label_multi ?types_multi_iri ?types_label_multi ?last_modified_by (sample(?lmbl) as ?last_modified_by_label) ?last_modified (?np as ?override_target) ?np ?np_label where { { select ?class ?class_label (?definition as ?description) (group_concat(distinct str(?superclass); separator=" ") as ?superclasses_multi_iri) (group_concat(distinct replace(replace(coalesce(?superclass_lbl, str(?superclass)), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as ?superclasses_label_multi) (group_concat(distinct str(?type); separator=" ") as ?types_multi_iri) (group_concat(distinct replace(replace(replace(str(?type), "^.*[/#]", ""), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as ?types_label_multi) (sample(?user) as ?last_modified_by) (sample(?date) as ?last_modified) ?np ("^" as ?np_label) where { values ?_ontology_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } values ?_ontology_multi_iri {} graph ?stateG { ?_ontology_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np npx:hasNanopubType owl:Class . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np dct:created ?date . ?np npx:introduces ?class . ?np np:hasAssertion ?a . optional { ?np npx:signedBy ?user . } } filter(contains(?memberPubkeys, ?pubkey)) graph ?a { ?class dct:isPartOf ?_ontology_multi_iri . optional { ?class rdfs:label ?class_label . filter(lang(?class_label) = "") } optional { ?class skos:definition ?definition . } optional { ?class rdfs:subClassOf ?superclass . filter(isIRI(?superclass)) } optional { ?class a ?type . filter(?type != owl:Class) } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType owl:Class . ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 . filter not exists { ?np2x npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } ?np2 dct:created ?date2 . ?np2 npx:introduces ?class . ?np2 np:hasAssertion ?a2 . } filter(contains(?memberPubkeys, ?pubkey2)) graph ?a2 { ?class dct:isPartOf ?_ontology_multi_iri . } filter(?date2 > ?date || (?date2 = ?date && str(?np2) > str(?np))) } optional { select ?superclass (sample(?sclbl) as ?superclass_lbl) where { values ?_ontology_multi_iri {} graph npa:graph { ?scnp npx:hasNanopubType owl:Class ; npx:introduces ?superclass ; np:hasAssertion ?sca . } graph ?sca { ?superclass dct:isPartOf ?_ontology_multi_iri ; rdfs:label ?sclbl . } } group by ?superclass } } group by ?class ?class_label ?definition ?np } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> { select ?last_modified_by ?lmbl where { graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?tg . } graph ?tg { ?last_modified_by foaf:name ?lmbl . } } } } } group by ?class ?class_label ?description ?superclasses_multi_iri ?superclasses_label_multi ?types_multi_iri ?types_label_multi ?last_modified_by ?last_modified ?np ?np_label order by ?class_label This query performs a basic search on the nanopublications: a URI (starting with http:// or https://) finds the nanopublications referencing it in subject, predicate, or object position (via a federated query on the full repo); any other input is treated as a full-text search. Basic search prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix search: <http://www.openrdf.org/contrib/lucenesail#> select distinct ?np ?label ?date where { { # Full-text mode: any input that is not a URI is passed to the Lucene index. # The mode filters become constants after placeholder substitution, so the # non-matching branch is pruned before evaluation. filter(!(strstarts(?_query, "http://") || strstarts(?_query, "https://"))) graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } optional { ?np rdfs:label ?label . } ?np dct:created ?date . } ?np search:matches [ search:query ?_query ; search:property npa:hasFilterLiteral ; search:score ?score ] . } union { # URI mode: find the nanopublications referencing the URI in subject, # predicate, or object position, federated to the full repo. filter(strstarts(?_query, "http://") || strstarts(?_query, "https://")) service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph ?g { { { bind(iri(?_query) as ?subj) } union { bind(iri(?_query) as ?pred) } union { bind(iri(?_query) as ?obj) } } ?subj ?pred ?obj . } graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } optional { ?np rdfs:label ?label . } ?np dct:created ?date . ?np ?graphpred ?g . values ?graphpred { np:hasAssertion np:hasProvenance np:hasPublicationInfo } } } } } limit 100 Given a publication (identified by its DOI URI or other identifier), this query returns its details as property-value rows: its bibliographic metadata (type, title, authors in list order, journal, date, volume, pages) from the nanopublication introducing it, the resources citing it via CiTO relations (with the citation type in the property label), and the statements (AIDA sentences) that were derived from it. Recognized properties get human-readable labels and are shown first. Get publication details prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix bibo: <http://purl.org/ontology/bibo/> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix prov: <http://www.w3.org/ns/prov#> prefix hycl: <http://purl.org/petapico/o/hycl#> select ?property ?property_label ?value (min(?vlabel) as ?value_label) where { { graph npa:graph { ?np npx:introduces ?_publication_iri ; np:hasAssertion ?a ; npa:hasValidSignatureForPublicKey ?pk . } filter not exists { graph npa:graph { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pk . } } { graph ?a { ?_publication_iri ?property ?value . } filter(?property not in (dct:isPartOf, bibo:authorList, bibo:pageStart, bibo:pageEnd)) bind(if(?property = rdf:type, replace(replace(str(?value), "^.*[/#]", ""), "([a-z])([A-Z])", "$1 $2"), ?xu) as ?vlabel) bind( if(?property = rdf:type, "Type", if(?property = dct:title, "Title", if(?property = dct:date, "Date", if(?property = bibo:volume, "Volume", str(?property))))) as ?property_label) bind( if(?property = rdf:type, 0, if(?property = dct:title, 1, if(?property = dct:date, 30, if(?property = bibo:volume, 32, 40)))) as ?sort) } union { graph ?a { ?_publication_iri dct:isPartOf ?j . ?j dct:title ?value . } bind(dct:isPartOf as ?property) bind("Published in" as ?property_label) bind(31 as ?sort) } union { graph ?a { ?_publication_iri bibo:pageStart ?ps . } optional { graph ?a { ?_publication_iri bibo:pageEnd ?pe . } } bind(bibo:pageStart as ?property) bind("Pages" as ?property_label) bind(33 as ?sort) bind(if(bound(?pe) && str(?pe) != str(?ps), concat(str(?ps), "-", str(?pe)), str(?ps)) as ?value) } union { graph ?a { ?_publication_iri bibo:authorList ?al . ?al ?m ?author . ?author foaf:name ?value . } filter(strstarts(str(?m), "http://www.w3.org/1999/02/22-rdf-syntax-ns#_")) bind(bibo:authorList as ?property) bind("Author" as ?property_label) bind(10 + xsd:integer(strafter(str(?m), "#_")) / 1000.0 as ?sort) } } union { graph npa:graph { ?cnp np:hasAssertion ?ca ; npa:hasValidSignatureForPublicKey ?cpk . } filter not exists { graph npa:graph { ?cinv npx:invalidates ?cnp ; npa:hasValidSignatureForPublicKey ?cpk . } } graph ?ca { ?value ?property ?_publication_iri . } filter(strstarts(str(?property), "http://purl.org/spar/cito/")) bind(concat("Cited by (", lcase(replace(replace(str(?property), "http://purl.org/spar/cito/", ""), "([a-z])([A-Z])", "$1 $2")), ")") as ?property_label) bind(50 as ?sort) optional { graph npa:graph { ?lnp np:hasAssertion ?la ; npa:hasValidSignatureForPublicKey ?lpk . } filter not exists { graph npa:graph { ?linv npx:invalidates ?lnp ; npa:hasValidSignatureForPublicKey ?lpk . } } graph ?la { ?value rdfs:label ?vlabel . } } } union { graph npa:graph { ?snp np:hasAssertion ?sa ; npa:hasValidSignatureForPublicKey ?spk . } filter not exists { graph npa:graph { ?sinv npx:invalidates ?snp ; npa:hasValidSignatureForPublicKey ?spk . } } graph ?sa { ?value prov:wasDerivedFrom ?_publication_iri . ?value a hycl:AIDA-Sentence . } bind(prov:wasDerivedFrom as ?property) bind("Basis for statement" as ?property_label) bind(60 as ?sort) optional { graph npa:graph { ?snp rdfs:label ?vlabel . } } } } group by ?property ?property_label ?value ?sort order by ?sort str(?value) Given a statement (AIDA sentence), this query returns its details as property-value rows: its type, the topic(s) it is about, the source(s) it was derived from (with titles where available), and the resources that cover it via gen:coversClaim. Recognized properties get human-readable labels and are shown first. Get statement details prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix prov: <http://www.w3.org/ns/prov#> prefix hycl: <http://purl.org/petapico/o/hycl#> select ?property ?property_label ?value (min(?vlabel) as ?value_label) where { { graph npa:graph { ?np np:hasAssertion ?a ; npa:hasValidSignatureForPublicKey ?pk . } filter not exists { graph npa:graph { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pk . } } graph ?a { ?_statement_iri ?property ?value . } bind("out" as ?dir) optional { graph npa:graph { ?lnp np:hasAssertion ?la ; npa:hasValidSignatureForPublicKey ?lpk . } filter not exists { graph npa:graph { ?linv npx:invalidates ?lnp ; npa:hasValidSignatureForPublicKey ?lpk . } } graph ?la { ?value rdfs:label|dct:title ?vlabelRaw . } } } union { graph npa:graph { ?np np:hasAssertion ?a ; npa:hasValidSignatureForPublicKey ?pk . } filter not exists { graph npa:graph { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pk . } } graph ?a { ?value gen:coversClaim ?_statement_iri . } bind(gen:coversClaim as ?property) bind("in" as ?dir) optional { graph npa:graph { ?lnp np:hasAssertion ?la ; npa:hasValidSignatureForPublicKey ?lpk . } filter not exists { graph npa:graph { ?linv npx:invalidates ?lnp ; npa:hasValidSignatureForPublicKey ?lpk . } } graph ?la { ?value rdfs:label ?vlabelRaw . } } } bind(coalesce(?vlabelRaw, if(?value = hycl:AIDA-Sentence, "AIDA sentence", ?xu)) as ?vlabel) bind( if(?dir = "in", "Covered by", if(?property = rdf:type, "Type", if(?property = <http://schema.org/about> || ?property = <https://schema.org/about>, "Topic", if(?property = prov:wasDerivedFrom, "Derived from", str(?property))))) as ?property_label) bind( if(?dir = "in", 50, if(?property = rdf:type, 0, if(?property = <http://schema.org/about> || ?property = <https://schema.org/about>, 10, if(?property = prov:wasDerivedFrom, 20, 40)))) as ?sort) } group by ?property ?property_label ?value ?sort order by ?sort str(?value) Given a glossary term (a SKOS concept, typically identified by its Wikidata URI), this query returns its details as property-value rows: its type, label, and definition, the resources that reference it in their glossary via dct:references, and the statements (AIDA sentences) that are about it. Recognized properties get human-readable labels and are shown first. Get term details prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix hycl: <http://purl.org/petapico/o/hycl#> select ?property ?property_label ?value (min(?vlabel) as ?value_label) where { { graph npa:graph { ?np np:hasAssertion ?a ; npa:hasValidSignatureForPublicKey ?pk . } filter not exists { graph npa:graph { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pk . } } graph ?a { ?_term_iri ?property ?value . } bind(if(?value = skos:Concept, "Concept", ?xu) as ?vlabel) bind( if(?property = rdf:type, "Type", if(?property = rdfs:label, "Label", if(?property = skos:definition, "Definition", str(?property)))) as ?property_label) bind( if(?property = rdf:type, 0, if(?property = rdfs:label, 1, if(?property = skos:definition, 2, 40))) as ?sort) } union { graph npa:graph { ?rnp np:hasAssertion ?ra ; npa:hasValidSignatureForPublicKey ?rpk . } filter not exists { graph npa:graph { ?rinv npx:invalidates ?rnp ; npa:hasValidSignatureForPublicKey ?rpk . } } graph ?ra { ?value dct:references ?_term_iri . } bind(dct:references as ?property) bind("Referenced by" as ?property_label) bind(50 as ?sort) optional { graph npa:graph { ?lnp np:hasAssertion ?la ; npa:hasValidSignatureForPublicKey ?lpk . } filter not exists { graph npa:graph { ?linv npx:invalidates ?lnp ; npa:hasValidSignatureForPublicKey ?lpk . } } graph ?la { ?value rdfs:label ?vlabel . } } } union { graph npa:graph { ?snp np:hasAssertion ?sa ; npa:hasValidSignatureForPublicKey ?spk . } filter not exists { graph npa:graph { ?sinv npx:invalidates ?snp ; npa:hasValidSignatureForPublicKey ?spk . } } graph ?sa { ?value ?aboutProp ?_term_iri . ?value a hycl:AIDA-Sentence . } filter(?aboutProp in (<http://schema.org/about>, <https://schema.org/about>)) bind(?aboutProp as ?property) bind("Topic of statement" as ?property_label) bind(60 as ?sort) optional { graph npa:graph { ?snp rdfs:label ?vlabel . } } } } group by ?property ?property_label ?value ?sort order by ?sort str(?value) Returns key-value facts for display on the page of a time-limited space (project, initiative, campaign, or event): its type(s), date, location, description(s), and admins. Type, date, location, and description are read from the resource's latest non-invalidated definition nanopub. Admins are the validated admins (npa:hasRoleType gen:AdminRole) of the governing space, resolved via the spaces repository. The date row shows the start and end dates; when both fall on the same day, it shows the day with the start and end times (and the timezone offset); when the end date is absent, only the start date is shown. The location row shows the location URI as a link. Date and location rows are omitted when the corresponding values are not given. Each property occupies one row; the Value column is a multi-value cell so properties with several values (multiple types or admins) list them all in a single row. Both columns use the '_noheader' convention so the redundant header row is dropped. Get time-limited space info prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix schema: <http://schema.org/> select distinct ?Property_noheader ?Property_label ?Value_multi_val_noheader ?Value_label_multi where { values ?_resource_multi_iri {} graph npa:graph { ?np npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; np:hasAssertion ?a . filter not exists { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } graph ?a { ?_resource_multi_iri a ?baseType . filter(?baseType in (gen:Space, gen:MaintainedResource)) } optional { select (group_concat(?typeIriS; separator="\n") as ?typeVal) (group_concat(?typeLocal; separator="\n") as ?typeLabel) where { select distinct ?typeIriS ?typeLocal where { values ?_resource_multi_iri {} graph npa:graph { ?npt npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pkt ; np:hasAssertion ?at . filter not exists { ?invt npx:invalidates ?npt ; npa:hasValidSignatureForPublicKeyHash ?pkt . } } graph ?at { ?_resource_multi_iri a ?typeIri . filter(?typeIri != gen:Space && ?typeIri != gen:MaintainedResource) } bind(str(?typeIri) as ?typeIriS) bind(replace(str(?typeIri), '^.*[/#]', '') as ?typeLocal) } } having (count(?typeIriS) > 0) } optional { select (group_concat(distinct ?descEsc; separator="\n") as ?descVal) where { values ?_resource_multi_iri {} graph npa:graph { ?npd npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pkd ; np:hasAssertion ?ad . filter not exists { ?invd npx:invalidates ?npd ; npa:hasValidSignatureForPublicKeyHash ?pkd . } } graph ?ad { ?_resource_multi_iri dct:description ?desc . } bind(replace(replace(str(?desc), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n") as ?descEsc) } having (count(?desc) > 0) } optional { select (group_concat(?admin2; separator="\n") as ?adminVal) (group_concat(?adminName; separator="\n") as ?adminLabel) where { select distinct ?admin2 ?adminName where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?g . } optional { graph ?g { ?_resource_multi_iri npa:isMaintainedBy ?maint . } } bind(coalesce(?maint, ?_resource_multi_iri) as ?adminSpace) graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?adminSpace ; npa:hasRoleType gen:AdminRole ; npa:forAgent ?admin . } optional { graph ?g { ?admin foaf:name ?adminName0 . } } } bind(coalesce(?adminName0, str(?admin)) as ?adminName) bind(str(?admin) as ?admin2) } } having (count(?admin2) > 0) } optional { graph ?a { ?_resource_multi_iri schema:startDate ?startDate . } } optional { graph ?a { ?_resource_multi_iri schema:endDate ?endDate . } } optional { graph ?a { ?_resource_multi_iri schema:location ?location . } } bind(coalesce(substr(str(?startDate), 1, 10), str(?startDate)) as ?sDay) bind(coalesce(substr(str(?endDate), 1, 10), "") as ?eDay) bind(coalesce(substr(str(?startDate), 12, 5), "") as ?sTime) bind(coalesce(substr(str(?endDate), 12, 5), "") as ?eTime) bind(coalesce(replace(substr(str(?startDate), 17), "^(:[0-9][0-9](\\.[0-9]+)?)?", ""), "") as ?tzRaw) bind(if(?tzRaw = "Z", "UTC", if(?tzRaw != "", concat("UTC", ?tzRaw), "")) as ?tzDisp) bind( if(?eDay != "", if(?sDay = ?eDay, if(?sTime != "" && ?eTime != "", concat(?sDay, ", ", ?sTime, "\u2013", ?eTime, if(?tzDisp != "", concat(" (", ?tzDisp, ")"), "")), ?sDay), concat(?sDay, " \u2013 ", ?eDay)), ?sDay) as ?dateVal) values (?key ?Property_noheader ?Property_label) { ('Type' rdf:type 'Type:') ('Date' schema:startDate 'Date:') ('Location' schema:location 'Location:') ('Description' dct:description 'Description:') ('Admins' gen:hasAdmin 'Admins:') } bind(if(?key='Type', ?typeVal, if(?key='Date', ?dateVal, if(?key='Location', str(?location), if(?key='Description', ?descVal, ?adminVal)))) as ?Value_multi_val_noheader) filter(bound(?Value_multi_val_noheader)) bind(if(?key='Type', ?typeLabel, if(?key='Admins', ?adminLabel, '')) as ?Value_label_multi) } order by (if(?key='Type', 1, if(?key='Date', 2, if(?key='Location', 3, if(?key='Description', 4, 5))))) Autocomplete lookup for FAIR Supporting Resources (FSRs), searching on labels and descriptions, excluding retracted/superseded nanopublications, example nanopublications, entries from before 2022, and entries disapproved by the curators. FSR lookup prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix fip: <https://w3id.org/fair/fip/terms/> prefix search: <http://www.openrdf.org/contrib/lucenesail#> select distinct ?thing ?label ?description ?np ?date ?pubkey where { graph npa:graph { <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> npa:hasValidSignatureForPublicKey ?curators_np_pk . ?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk . filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . } ?latest_curators_np np:hasAssertion ?latest_curators_assertion . } graph npa:networkGraph { ?latest_curators_np (npx:supersedes)* <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> . filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np } } graph npa:graph { ?np rdfs:label ?label . optional { ?np dct:description ?description . } ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np dct:created ?date . filter(str(?date) > "2022") filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np npx:introduces|npx:describes ?thing . ?np npx:hasNanopubType ?type . values ?type { fip:Data-usage-license fip:Metadata-preservation-policy fip:Persistency-Policy fip:Crosswalk fip:Editor fip:FAIR-Representation-Service fip:Authentication-and-authorization-service fip:Provenance-Tracking-Service fip:Validation-Service fip:Web-API fip:Identifier-service fip:FAIR-Supporting-Software fip:Registry fip:Communication-protocol fip:Knowledge-representation-language fip:Metadata-schema fip:Metadata-data-linking-schema fip:Provenance-model fip:Structured-vocabulary fip:Semantic-model } } { ?np search:matches [ search:query ?_searchterm ; search:property rdfs:label ] . } union { ?np search:matches [ search:query ?_searchterm ; search:property dct:description ] . } bind(iri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256("http://purl.org/nanopub/x/disapprovesOf"))) as ?disappr_service) filter not exists { service ?disappr_service { graph npa:graph { ?disapproval_np np:hasAssertion ?da ; npa:hasValidSignatureForPublicKey ?dpubkey . filter not exists { ?disapproval_npx npx:invalidates ?disapproval_np ; npa:hasValidSignatureForPublicKey ?dpubkey . } } graph ?latest_curators_assertion { ?qpubkeys npx:hasPublicKey ?dpubkey . } graph ?da { ?disapprover npx:disapprovesOf ?np . } } } } limit 10 This query performs a full-text search on FAIR Specifications, excluding retracted/superseded nanopublications, example nanopublications, entries from before 2022, and entries disapproved by the curators. Search on FAIR Specifications prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix fip: <https://w3id.org/fair/fip/terms/> prefix search: <http://www.openrdf.org/contrib/lucenesail#> select distinct ?thing ?label ?description ?np ?pubkey ?date where { graph npa:graph { <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> npa:hasValidSignatureForPublicKey ?curators_np_pk . ?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk . filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . } ?latest_curators_np np:hasAssertion ?latest_curators_assertion . } graph npa:networkGraph { ?latest_curators_np (npx:supersedes)* <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> . filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np } } graph npa:graph { values ?type { fip:FAIR-Specification fip:Metadata-schema fip:Semantic-model fip:Structured-vocabulary fip:Provenance-model } ?np npx:hasNanopubType ?type . ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np dct:created ?date . filter(str(?date) > "2022") filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np npx:introduces|npx:describes ?thing . ?np rdfs:label ?label . optional { ?np dct:description ?description . } } ?np search:matches [ search:query ?_query ; search:property rdfs:label ; search:score ?score ; search:snippet ?snippet ] . bind(iri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256("http://purl.org/nanopub/x/disapprovesOf"))) as ?disappr_service) filter not exists { service ?disappr_service { graph npa:graph { ?disapproval_np np:hasAssertion ?da ; npa:hasValidSignatureForPublicKey ?dpubkey . filter not exists { ?disapproval_npx npx:invalidates ?disapproval_np ; npa:hasValidSignatureForPublicKey ?dpubkey . } } graph ?latest_curators_assertion { ?qpubkeys npx:hasPublicKey ?dpubkey . } graph ?da { ?disapprover npx:disapprovesOf ?np . } } } } limit 10 Returns all FAIR outputs linked to the given project via the FAIR-findings (ff) output relations (has-article, has-dataset, has-software, has-method, has-dmp, has-preregistration), with the output's title and the kind of output derived from the relation, restricted to links authored by a member, maintainer, or admin of the project's space. Get FAIR outputs for project prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix ff: <https://w3id.org/fair/ff/terms/> select ?output ?output_label ?kind ?np ("^" as ?np_label) where { values ?_project_multi_iri {} values ?outputProp { ff:has-article ff:has-dataset ff:has-software ff:has-method ff:has-dmp ff:has-preregistration ff:has-presentation } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . } values ?_project_multi_iri {} graph ?stateG { ?_project_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?roleType . filter(?roleType in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?npPubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?npPubkey . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?pi . } filter(contains(?memberPubkeys, ?npPubkey)) graph ?a { ?_project_multi_iri ?outputProp ?output . } optional { graph ?a { ?output rdfs:label ?output_label0 } } optional { graph ?pi { ?output nt:hasLabelFromApi ?output_label1 } } bind(coalesce(?output_label0, ?output_label1) as ?output_label) bind(strafter(str(?outputProp), "https://w3id.org/fair/ff/terms/has-") as ?kind) } order by ?kind ?output_label Returns all FAIR outputs (ff:has-* relations) linked to the given space or any of its sub-spaces (by IRI nesting), with the project each output belongs to, the output title, and the kind of output. Restricted to links authored by a member, maintainer, or admin of some space in the subtree. Works at any level: a single project, a programme, or a top-level organization. Get FAIR outputs for space and sub-spaces prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix ff: <https://w3id.org/fair/ff/terms/> select ?project ?project_label ?output ?output_label ?kind ?np ("^" as ?np_label) where { values ?_space_multi_iri {} values ?outputProp { ff:has-article ff:has-dataset ff:has-software ff:has-method ff:has-dmp ff:has-preregistration ff:has-presentation } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(distinct ?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . } values ?_space_multi_iri {} graph ?stateG { ?ri a gen:RoleInstantiation ; npa:forSpace ?proj ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) filter(?proj = ?_space_multi_iri || strstarts(str(?proj), concat(str(?_space_multi_iri), "/"))) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?npPubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?npPubkey . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?pi . } filter(contains(?memberPubkeys, ?npPubkey)) graph ?a { ?project ?outputProp ?output . } filter(?project = ?_space_multi_iri || strstarts(str(?project), concat(str(?_space_multi_iri), "/"))) optional { graph ?a { ?output rdfs:label ?output_label0 } } optional { graph ?pi { ?output nt:hasLabelFromApi ?output_label1 } } optional { graph ?pi { ?project nt:hasLabelFromApi ?project_label } } bind(coalesce(?output_label0, ?output_label1) as ?output_label) bind(strafter(str(?outputProp), "https://w3id.org/fair/ff/terms/has-") as ?kind) } order by ?project_label ?kind ?output_label 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. Space-governed versions (gen:governedBy, nanodash docs/views-and-presets-as-maintained-resources.md): a referenced version declaring gen:governedBy resolves to the newest version of its (kind, space) pair signed by a current member+ (admin/maintainer/member) of that space -- with the kind validated as a maintained resource of the space -- taking precedence over the supersedes-based head; without a valid governed candidate the pinned version stands. Get view displays prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?display ?view (coalesce(?viewKindOptional, ?view) as ?viewKind) ?label ?displayType ?displayMode ?np ?pubkey ?date where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } { # Authority gate (issue #130 / nanodash#510): a single mandatory hop through the # governing space ref, which covers both a maintained resource and a space itself # (the reflexive self-edge), keyed on the role tier materialized on the # RoleInstantiation since #125. Replaces the old bare-IRI isMaintainedBy? hop and the # dead RoleDeclaration maintainer join. Non-ref variant: any ref claiming the IRI, so # authority merges across refs (the ref variant pins a single ?passedRef instead). graph ?stateG { ?_resource_multi_iri npa:hasGoverningSpaceRef ?spaceRef . ?ri a gen:RoleInstantiation ; npa:forSpaceRef ?spaceRef ; npa:hasRoleType ?roleType ; npa:forAgent ?authAgent . filter(?roleType = gen:AdminRole || ?roleType = gen:MaintainerRole) ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } } { # branch (a): standalone view displays — LOCAL pattern on the endpoint repo graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np dct:created ?date . ?np npx:embeds ?display . ?np np:hasAssertion ?a . optional { ?np rdfs:label ?label } } graph ?a { ?display gen:isDisplayOfView ?refView . ?display gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayType { gen:PartLevelViewDisplay gen:TopLevelViewDisplay } ?display a ?displayType . } optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } } } union { # branch (b): preset-supplied views — wrapped in a sub-SELECT so the remote # service does not collapse branch (a). ?display stays unbound. select ?refView ?label ?displayType ?displayMode ?np ?pubkey ?date ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np dct:created ?date . ?np npx:embeds ?assignment . ?np np:hasAssertion ?a . optional { ?np rdfs:label ?label } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri . ?assignment gen:isAssignmentOfPreset ?presetRef . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } graph npa:graph { ?presetNp npx:embeds ?presetRef ; np:hasAssertion ?pa . } graph ?pa { ?presetRef a gen:Preset . { ?presetRef gen:hasTopLevelView ?refView . bind(gen:TopLevelViewDisplay as ?displayType) } union { ?presetRef gen:hasView ?refView . bind(gen:PartLevelViewDisplay as ?displayType) } } } } } # Resolve each referenced view to its latest version: the current head of its # supersedes version tree (a nanopub itself neither superseded nor validly # retracted via npx:invalidates), most recent among heads on a fork. Wrapped in # a run-once sub-SELECT so this cross-repo service is evaluated once for the # whole view set rather than once per referenced view -- the per-view federation # round-trips were the dominant cost of earlier versions. optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { select distinct ?refView ?latestView ?viewKindOptional ?pinKind ?pinSpace where { graph npa:graph { ?rnp npx:embeds ?refView ; np:hasAssertion ?ra . } graph ?ra { ?refView a gen:ResourceView . } optional { graph ?ra { ?refView dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace . } } optional { ?vnp npx:embeds ?refView . ?latestNp (npx:supersedes|^npx:supersedes)* ?vnp ; dct:created ?ldate ; npx:embeds ?latestView ; np:hasAssertion ?va ; npa:hasValidSignatureForPublicKeyHash ?invPk . filter not exists { ?supNp npx:supersedes ?latestNp . } filter not exists { ?invNp npx:invalidates ?latestNp ; npa:hasValidSignatureForPublicKeyHash ?invPk . } filter not exists { ?other (npx:supersedes|^npx:supersedes)* ?vnp ; dct:created ?odate ; npa:hasValidSignatureForPublicKeyHash ?invPk2 . filter not exists { ?supNp2 npx:supersedes ?other . } filter not exists { ?invNp2 npx:invalidates ?other ; npa:hasValidSignatureForPublicKeyHash ?invPk2 . } filter(?odate > ?ldate) } graph ?va { ?latestView a gen:ResourceView . optional { ?latestView dct:isVersionOf ?viewKindOptional . } } } } } } # Space-governed resolution (gen:governedBy; nanodash docs/views-and-presets-as- # maintained-resources.md): a pinned version declaring a governing space resolves to # the newest member+-signed version of its (kind, space) pair instead of the # supersedes head; no valid candidate -> the pin stands. optional { { select ?pinKind ?pinSpace (iri(strafter(max(concat(str(?cDate), ">", str(?cver))), ">")) as ?governedLatest) where { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?cnp dct:created ?cDate ; npa:hasValidSignatureForPublicKeyHash ?cpk ; npx:embeds ?cver ; np:hasAssertion ?ca . filter not exists { ?ci npx:invalidates ?cnp ; npa:hasValidSignatureForPublicKeyHash ?cpk . } } graph ?ca { ?cver dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace . } } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?gsg . } graph ?gsg { ?pinKind npa:isMaintainedBy ?pinSpace ; npa:hasGoverningSpaceRef ?gref . ?gri a gen:RoleInstantiation ; npa:forSpace ?pinSpace ; npa:forSpaceRef ?gref ; npa:hasRoleType ?gtier ; npa:forAgent ?gag . filter(?gtier = gen:AdminRole || ?gtier = gen:MaintainerRole || ?gtier = gen:MemberRole) ?gacct a npa:AccountState ; npa:agent ?gag ; npa:pubkey ?cpk . } } } group by ?pinKind ?pinSpace } } bind(if(bound(?pinSpace), coalesce(?governedLatest, ?refView), coalesce(?latestView, ?refView)) as ?view) } order by desc(?date) Ref-scoped variant of get-view-displays (the Content-tab renderer query) for a single space ref. Takes TWO inputs: the space IRI (resource) and the ref's root nanopub (root_np); the authority gate is scoped to admins/maintainers of THAT ref (npa:forSpaceRef resolved from root_np) instead of the space IRI merged across all its refs. Both inputs are concrete (VALUES) so federation bindings propagate. Space-only companion to get-view-displays; same columns. Regenerate from the latest get-view-displays by adding the root_np VALUES, the ?passedRef npa:rootNanopub resolution, and npa:forSpaceRef ?passedRef on the gate's RoleInstantiation. Space-governed versions (gen:governedBy, nanodash docs/views-and-presets-as-maintained-resources.md): a referenced version declaring gen:governedBy resolves to the newest version of its (kind, space) pair signed by a current member+ (admin/maintainer/member) of that space -- with the kind validated as a maintained resource of the space -- taking precedence over the supersedes-based head; without a valid governed candidate the pinned version stands. Get view displays (ref-scoped) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?display ?view (coalesce(?viewKindOptional, ?view) as ?viewKind) ?label ?displayType ?displayMode ?np ?pubkey ?date where { values ?_resource_multi_iri {} values ?_root_np_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph npa:spacesGraph { ?passedRef npa:rootNanopub ?_root_np_multi_iri . } { # Authority gate (issue #130 / nanodash#510): a single mandatory hop through the # governing space ref, which covers both a maintained resource and a space itself # (the reflexive self-edge), keyed on the role tier materialized on the # RoleInstantiation since #125. Replaces the old bare-IRI isMaintainedBy? hop and the # dead RoleDeclaration maintainer join. Ref variant: the governing ref is pinned to # ?passedRef (resolved from root_np), so authority cannot bleed across rival refs # claiming the same space IRI. graph ?stateG { ?_resource_multi_iri npa:hasGoverningSpaceRef ?passedRef . ?ri a gen:RoleInstantiation ; npa:forSpaceRef ?passedRef ; npa:hasRoleType ?roleType ; npa:forAgent ?authAgent . filter(?roleType = gen:AdminRole || ?roleType = gen:MaintainerRole) ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } } { # branch (a): standalone view displays — LOCAL pattern on the endpoint repo graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np dct:created ?date . ?np npx:embeds ?display . ?np np:hasAssertion ?a . optional { ?np rdfs:label ?label } } graph ?a { ?display gen:isDisplayOfView ?refView . ?display gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayType { gen:PartLevelViewDisplay gen:TopLevelViewDisplay } ?display a ?displayType . } optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } } } union { # branch (b): preset-supplied views — wrapped in a sub-SELECT so the remote # service does not collapse branch (a). ?display stays unbound. select ?refView ?label ?displayType ?displayMode ?np ?pubkey ?date ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np dct:created ?date . ?np npx:embeds ?assignment . ?np np:hasAssertion ?a . optional { ?np rdfs:label ?label } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri . ?assignment gen:isAssignmentOfPreset ?presetRef . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } graph npa:graph { ?presetNp npx:embeds ?presetRef ; np:hasAssertion ?pa . } graph ?pa { ?presetRef a gen:Preset . { ?presetRef gen:hasTopLevelView ?refView . bind(gen:TopLevelViewDisplay as ?displayType) } union { ?presetRef gen:hasView ?refView . bind(gen:PartLevelViewDisplay as ?displayType) } } } } } # Resolve each referenced view to its latest version: the current head of its # supersedes version tree (a nanopub itself neither superseded nor validly # retracted via npx:invalidates), most recent among heads on a fork. Wrapped in # a run-once sub-SELECT so this cross-repo service is evaluated once for the # whole view set rather than once per referenced view -- the per-view federation # round-trips were the dominant cost of earlier versions. optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { select distinct ?refView ?latestView ?viewKindOptional ?pinKind ?pinSpace where { graph npa:graph { ?rnp npx:embeds ?refView ; np:hasAssertion ?ra . } graph ?ra { ?refView a gen:ResourceView . } optional { graph ?ra { ?refView dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace . } } optional { ?vnp npx:embeds ?refView . ?latestNp (npx:supersedes|^npx:supersedes)* ?vnp ; dct:created ?ldate ; npx:embeds ?latestView ; np:hasAssertion ?va ; npa:hasValidSignatureForPublicKeyHash ?invPk . filter not exists { ?supNp npx:supersedes ?latestNp . } filter not exists { ?invNp npx:invalidates ?latestNp ; npa:hasValidSignatureForPublicKeyHash ?invPk . } filter not exists { ?other (npx:supersedes|^npx:supersedes)* ?vnp ; dct:created ?odate ; npa:hasValidSignatureForPublicKeyHash ?invPk2 . filter not exists { ?supNp2 npx:supersedes ?other . } filter not exists { ?invNp2 npx:invalidates ?other ; npa:hasValidSignatureForPublicKeyHash ?invPk2 . } filter(?odate > ?ldate) } graph ?va { ?latestView a gen:ResourceView . optional { ?latestView dct:isVersionOf ?viewKindOptional . } } } } } } # Space-governed resolution (gen:governedBy; nanodash docs/views-and-presets-as- # maintained-resources.md): a pinned version declaring a governing space resolves to # the newest member+-signed version of its (kind, space) pair instead of the # supersedes head; no valid candidate -> the pin stands. optional { { select ?pinKind ?pinSpace (iri(strafter(max(concat(str(?cDate), ">", str(?cver))), ">")) as ?governedLatest) where { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?cnp dct:created ?cDate ; npa:hasValidSignatureForPublicKeyHash ?cpk ; npx:embeds ?cver ; np:hasAssertion ?ca . filter not exists { ?ci npx:invalidates ?cnp ; npa:hasValidSignatureForPublicKeyHash ?cpk . } } graph ?ca { ?cver dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace . } } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?gsg . } graph ?gsg { ?pinKind npa:isMaintainedBy ?pinSpace ; npa:hasGoverningSpaceRef ?gref . ?gri a gen:RoleInstantiation ; npa:forSpace ?pinSpace ; npa:forSpaceRef ?gref ; npa:hasRoleType ?gtier ; npa:forAgent ?gag . filter(?gtier = gen:AdminRole || ?gtier = gen:MaintainerRole || ?gtier = gen:MemberRole) ?gacct a npa:AccountState ; npa:agent ?gag ; npa:pubkey ?cpk . } } } group by ?pinKind ?pinSpace } } bind(if(bound(?pinSpace), coalesce(?governedLatest, ?refView), coalesce(?latestView, ?refView)) as ?view) } order by desc(?date) Lists, for a PART page (a resource viewed as a part of a maintained resource/space/user), the view displays configured on the part's owning resource, flagged for this specific part (read-only). Same display set and admin/maintainer authorization as list-view-displays, keyed on the owning resource (the 'resource' parameter): standalone view displays plus preset-contributed views, deactivations applied, each view resolved to its latest version. The displayed_here column is a flag (check mark, else blank) indicating whether the view is shown on THIS part -- i.e. its appliesToInstancesOf matches one of the part's own classes (the 'partclass' multi-valued parameter), or it is pinned to the part via gen:appliesTo, or its namespace targeting covers the part's IRI (the 'partid' parameter). A hasTopLevelView preset is pinned to the owning resource's own page and is therefore never shown on a part (blank); a hasView preset falls back to the view's own targeting. For blank (not-shown) rows the target_multi_iri column lists the class(es)/namespace(s) the view targets. Rows are ordered shown-here first, then by structural position. Space-governed versions (gen:governedBy, nanodash docs/views-and-presets-as-maintained-resources.md): a referenced version declaring gen:governedBy resolves to the newest version of its (kind, space) pair signed by a current member+ (admin/maintainer/member) of that space -- with the kind validated as a maintained resource of the space -- taking precedence over the supersedes-based head; without a valid governed candidate the pinned version stands. List part view displays prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view ?view_label ?displayed_here ?position (substr(?position, 1, 3) as ?position_label) (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), ""), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?dApply ?dTarget ?effVTarget ?pinSpace ?governedLatest where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } { # Authority gate (issue #130 / nanodash#510): a single mandatory hop through the # governing space ref, which covers both a maintained resource and a space itself # (the reflexive self-edge), keyed on the role tier materialized on the # RoleInstantiation since #125. Replaces the old bare-IRI isMaintainedBy? hop and # the dead RoleDeclaration maintainer join. Non-ref variant: any ref claiming the # IRI, so authority merges across refs (the ref variant pins a single ?passedRef). graph ?stateG { ?_resource_multi_iri npa:hasGoverningSpaceRef ?spaceRef . ?ri a gen:RoleInstantiation ; npa:forSpaceRef ?spaceRef ; npa:hasRoleType ?roleType ; npa:forAgent ?authAgent . filter(?roleType = gen:AdminRole || ?roleType = gen:MaintainerRole) ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?supLabel . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } # Space-governed resolution (gen:governedBy; nanodash docs/views-and-presets-as- # maintained-resources.md): if the pinned version declares a governing space, the # newest version of its (kind, space) pair signed by a current member+ of that # space wins, with the kind validated as maintained by the space. Run-once # sub-select over all governed versions network-wide (gen:governedBy is highly # selective), joined back per pin. No valid candidate -> the pin stands. optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?pinNp npx:embeds ?viewRef ; np:hasAssertion ?pinA . } graph ?pinA { ?viewRef dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace . } } { select ?pinKind ?pinSpace (iri(strafter(max(concat(str(?cDate), ">", str(?cver))), ">")) as ?governedLatest) where { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?cnp dct:created ?cDate ; npa:hasValidSignatureForPublicKeyHash ?cpk ; npx:embeds ?cver ; np:hasAssertion ?ca . filter not exists { ?ci npx:invalidates ?cnp ; npa:hasValidSignatureForPublicKeyHash ?cpk . } } graph ?ca { ?cver dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace . } } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?gsg . } graph ?gsg { ?pinKind npa:isMaintainedBy ?pinSpace ; npa:hasGoverningSpaceRef ?gref . ?gri a gen:RoleInstantiation ; npa:forSpace ?pinSpace ; npa:forSpaceRef ?gref ; npa:hasRoleType ?gtier ; npa:forAgent ?gag . filter(?gtier = gen:AdminRole || ?gtier = gen:MaintainerRole || ?gtier = gen:MemberRole) ?gacct a npa:AccountState ; npa:agent ?gag ; npa:pubkey ?cpk . } } } group by ?pinKind ?pinSpace } service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?gnp npx:embeds ?governedLatest ; np:hasAssertion ?gva . } graph ?gva { ?governedLatest dct:title ?gTitle . } optional { graph ?gva { ?governedLatest gen:hasStructuralPosition ?gPos . } } optional { graph ?gva { ?governedLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?gTarget . } } } } bind(if(bound(?governedLatest), ?gTitle, ?supLabel) as ?view_label) bind(if(bound(?governedLatest), ?gPos, ?viewPos) as ?effViewPos) bind(if(bound(?governedLatest), ?gTarget, ?vTarget) as ?effVTarget) bind(coalesce(?dispPos, ?effViewPos, "") as ?position) } } values ?__partclass_multi_iri {} bind(if(coalesce(str(?dApply) = str(?_partid_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(?dTarget = ?__partclass_multi_iri, false) || coalesce(strstarts(str(?_partid_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?effVTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(?effVTarget = ?__partclass_multi_iri, false) || coalesce(strstarts(str(?_partid_iri), str(?effVTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?effVTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(if(bound(?pinSpace), coalesce(?governedLatest, ?viewRef), coalesce(?viewLatest, ?viewRef)) as ?view) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np } } order by desc(?displayed_here) ?position desc(?date_added) Lists the currently active view displays of a resource for the About page (standalone + preset-contributed, deactivations applied, latest version, one row per resolved view keeping the latest). displayed_here flags whether the view is shown on this resource's own page. Ordered shown-here first, then by structural position. Space-governed versions (gen:governedBy, nanodash docs/views-and-presets-as-maintained-resources.md): a referenced version declaring gen:governedBy resolves to the newest version of its (kind, space) pair signed by a current member+ (admin/maintainer/member) of that space -- with the kind validated as a maintained resource of the space -- taking precedence over the supersedes-based head; without a valid governed candidate the pinned version stands. List view displays prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?displayed_here) as ?displayed_here) (sample(?position) as ?position) (substr(sample(?position), 1, 3) as ?position_label) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (sample(?deactivateView) as ?deactivateView) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\t", str(?np))), "\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?effVTarget ?pinSpace ?governedLatest where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } { # Authority gate (issue #130 / nanodash#510): a single mandatory hop through the # governing space ref, which covers both a maintained resource and a space itself # (the reflexive self-edge), keyed on the role tier materialized on the # RoleInstantiation since #125. Replaces the old bare-IRI isMaintainedBy? hop and # the dead RoleDeclaration maintainer join. Non-ref variant: any ref claiming the # IRI, so authority merges across refs (the ref variant pins a single ?passedRef). graph ?stateG { ?_resource_multi_iri npa:hasGoverningSpaceRef ?spaceRef . ?ri a gen:RoleInstantiation ; npa:forSpaceRef ?spaceRef ; npa:hasRoleType ?roleType ; npa:forAgent ?authAgent . filter(?roleType = gen:AdminRole || ?roleType = gen:MaintainerRole) ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } bind(if(exists { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy ?anyMaintainer } }, gen:MaintainedResource, if(exists { graph ?stateG { ?ownAcc a npa:AccountState ; npa:agent ?_resource_multi_iri } }, gen:IndividualAgent, gen:Space)) as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?supLabel . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } # Space-governed resolution (gen:governedBy; nanodash docs/views-and-presets-as- # maintained-resources.md): if the pinned version declares a governing space, the # newest version of its (kind, space) pair signed by a current member+ of that # space wins, with the kind validated as maintained by the space. Run-once # sub-select over all governed versions network-wide (gen:governedBy is highly # selective), joined back per pin. No valid candidate -> the pin stands. optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?pinNp npx:embeds ?viewRef ; np:hasAssertion ?pinA . } graph ?pinA { ?viewRef dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace . } } { select ?pinKind ?pinSpace (iri(strafter(max(concat(str(?cDate), ">", str(?cver))), ">")) as ?governedLatest) where { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?cnp dct:created ?cDate ; npa:hasValidSignatureForPublicKeyHash ?cpk ; npx:embeds ?cver ; np:hasAssertion ?ca . filter not exists { ?ci npx:invalidates ?cnp ; npa:hasValidSignatureForPublicKeyHash ?cpk . } } graph ?ca { ?cver dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace . } } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?gsg . } graph ?gsg { ?pinKind npa:isMaintainedBy ?pinSpace ; npa:hasGoverningSpaceRef ?gref . ?gri a gen:RoleInstantiation ; npa:forSpace ?pinSpace ; npa:forSpaceRef ?gref ; npa:hasRoleType ?gtier ; npa:forAgent ?gag . filter(?gtier = gen:AdminRole || ?gtier = gen:MaintainerRole || ?gtier = gen:MemberRole) ?gacct a npa:AccountState ; npa:agent ?gag ; npa:pubkey ?cpk . } } } group by ?pinKind ?pinSpace } service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?gnp npx:embeds ?governedLatest ; np:hasAssertion ?gva . } graph ?gva { ?governedLatest dct:title ?gTitle . } optional { graph ?gva { ?governedLatest gen:hasStructuralPosition ?gPos . } } optional { graph ?gva { ?governedLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?gTarget . } } } } bind(if(bound(?governedLatest), ?gTitle, ?supLabel) as ?view_label) bind(if(bound(?governedLatest), ?gPos, ?viewPos) as ?effViewPos) bind(if(bound(?governedLatest), ?gTarget, ?vTarget) as ?effVTarget) bind(coalesce(?dispPos, ?effViewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?effVTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?effVTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?effVTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?effVTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(if(bound(?pinSpace), coalesce(?governedLatest, ?viewRef), coalesce(?viewLatest, ?viewRef)) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view order by desc(?displayed_here) ?position Ref-scoped view displays for a single space ref. Like list-view-displays but takes TWO inputs: the space IRI (resource) and the ref's root nanopub (root_np). The authority gate is scoped to admins/maintainers of THAT ref (npa:forSpaceRef resolved from root_np) rather than the space IRI merged across all its refs. Both inputs are concrete (VALUES) so federation bindings propagate (a single auto-detecting param can't: a service-derived resource IRI does not push into the federated SERVICE blocks). Space-only companion to list-view-displays; same columns. Regenerate from the latest list-view-displays by adding the root_np VALUES, the ?passedRef npa:rootNanopub resolution, and npa:forSpaceRef ?passedRef on the gate's RoleInstantiation. Space-governed versions (gen:governedBy, nanodash docs/views-and-presets-as-maintained-resources.md): a referenced version declaring gen:governedBy resolves to the newest version of its (kind, space) pair signed by a current member+ (admin/maintainer/member) of that space -- with the kind validated as a maintained resource of the space -- taking precedence over the supersedes-based head; without a valid governed candidate the pinned version stands. List view displays (ref-scoped) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?displayed_here) as ?displayed_here) (sample(?position) as ?position) (substr(sample(?position), 1, 3) as ?position_label) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (sample(?deactivateView) as ?deactivateView) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\\t", str(?np))), "\\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?effVTarget ?pinSpace ?governedLatest where { values ?_resource_multi_iri {} values ?_root_np_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph npa:spacesGraph { ?passedRef npa:rootNanopub ?_root_np_multi_iri . } { # Authority gate (issue #130 / nanodash#510): a single mandatory hop through the # governing space ref, which covers both a maintained resource and a space itself # (the reflexive self-edge), keyed on the role tier materialized on the # RoleInstantiation since #125. Replaces the old bare-IRI isMaintainedBy? hop and # the dead RoleDeclaration maintainer join. Ref variant: the governing ref is # pinned to ?passedRef (resolved from root_np), so authority cannot bleed across # rival refs claiming the same space IRI. graph ?stateG { ?_resource_multi_iri npa:hasGoverningSpaceRef ?passedRef . ?ri a gen:RoleInstantiation ; npa:forSpaceRef ?passedRef ; npa:hasRoleType ?roleType ; npa:forAgent ?authAgent . filter(?roleType = gen:AdminRole || ?roleType = gen:MaintainerRole) ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } bind(if(exists { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy ?anyMaintainer } }, gen:MaintainedResource, if(exists { graph ?stateG { ?ownAcc a npa:AccountState ; npa:agent ?_resource_multi_iri } }, gen:IndividualAgent, gen:Space)) as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?supLabel . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } # Space-governed resolution (gen:governedBy; nanodash docs/views-and-presets-as- # maintained-resources.md): if the pinned version declares a governing space, the # newest version of its (kind, space) pair signed by a current member+ of that # space wins, with the kind validated as maintained by the space. Run-once # sub-select over all governed versions network-wide (gen:governedBy is highly # selective), joined back per pin. No valid candidate -> the pin stands. optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?pinNp npx:embeds ?viewRef ; np:hasAssertion ?pinA . } graph ?pinA { ?viewRef dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace . } } { select ?pinKind ?pinSpace (iri(strafter(max(concat(str(?cDate), ">", str(?cver))), ">")) as ?governedLatest) where { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?cnp dct:created ?cDate ; npa:hasValidSignatureForPublicKeyHash ?cpk ; npx:embeds ?cver ; np:hasAssertion ?ca . filter not exists { ?ci npx:invalidates ?cnp ; npa:hasValidSignatureForPublicKeyHash ?cpk . } } graph ?ca { ?cver dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace . } } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?gsg . } graph ?gsg { ?pinKind npa:isMaintainedBy ?pinSpace ; npa:hasGoverningSpaceRef ?gref . ?gri a gen:RoleInstantiation ; npa:forSpace ?pinSpace ; npa:forSpaceRef ?gref ; npa:hasRoleType ?gtier ; npa:forAgent ?gag . filter(?gtier = gen:AdminRole || ?gtier = gen:MaintainerRole || ?gtier = gen:MemberRole) ?gacct a npa:AccountState ; npa:agent ?gag ; npa:pubkey ?cpk . } } } group by ?pinKind ?pinSpace } service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?gnp npx:embeds ?governedLatest ; np:hasAssertion ?gva . } graph ?gva { ?governedLatest dct:title ?gTitle . } optional { graph ?gva { ?governedLatest gen:hasStructuralPosition ?gPos . } } optional { graph ?gva { ?governedLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?gTarget . } } } } bind(if(bound(?governedLatest), ?gTitle, ?supLabel) as ?view_label) bind(if(bound(?governedLatest), ?gPos, ?viewPos) as ?effViewPos) bind(if(bound(?governedLatest), ?gTarget, ?vTarget) as ?effVTarget) bind(coalesce(?dispPos, ?effViewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?effVTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?effVTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?effVTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?effVTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(if(bound(?pinSpace), coalesce(?governedLatest, ?viewRef), coalesce(?viewLatest, ?viewRef)) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view order by desc(?displayed_here) ?position Space-scoped view displays for a single space ref. Derived from list-view-displays (RAfGpyfUX8qjSMN5-aRWOPeVqHajs3f6zUzcnMuRibk1g) but specialised for gen:Space resources: the authority gate keeps only the governing-space-ref hop -- issue #130's reflexive self-edge already exposes the space's own admins/maintainers there -- and drops the agent-self UNION branch, leaving a single non-UNION join under the variable state graph. This avoids the RDF4J planner timeout documented in nanopub-query doc/sparql-quirks.md (variable hasCurrentSpaceState pointer + multi-join + UNION => intermittent 504) that made the space View-displays view fail intermittently. ?ownClass is folded to the constant gen:Space. Takes the same two concrete inputs (resource = space IRI, root_np = ref root) and returns the same columns as list-view-displays. The outer SELECT collapses multiple attach rows per view deterministically: ?displayed_here via max() (shown if any live path displays it), every other column pinned to the single newest (date_added, np) row via argmax -- replacing the old non-deterministic sample() aggregates. Space-governed versions (gen:governedBy, nanodash docs/views-and-presets-as-maintained-resources.md): a referenced version declaring gen:governedBy resolves to the newest version of its (kind, space) pair signed by a current member+ (admin/maintainer/member) of that space -- with the kind validated as a maintained resource of the space -- taking precedence over the supersedes-based head; without a valid governed candidate the pinned version stands. List view displays (space) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (?view_label_g as ?view_label) (?displayed_here_g as ?displayed_here) (?position_g as ?position) (substr(?position_g, 1, 3) as ?position_label) (if(strlen(?via_preset_g) > 0, iri(?via_preset_g), ?undef_vp) as ?via_preset) (?via_preset_label_g as ?via_preset_label) (if(strlen(?added_by_g) > 0, iri(?added_by_g), ?undef_ab) as ?added_by) (?deactivateView_g as ?deactivateView) (?date_added_g as ?date_added) (?np_g as ?np) (?np_label_g as ?np_label) where { # Collapse to one deterministic row per ?view. The page can reach a view through several # rows (a direct ViewDisplay AND a preset, multiple display nanopubs, class+namespace targets); # group by ?view picks ONE. ?displayed_here uses max() = "shown if displayed via any live path" # ("" < the check mark, so max yields the check when any path shows it) and is order-stable. # Every other column is pinned to the single newest row via an argmax over (date_added, np) -- # the same trick already used for ?np -- so the detail columns stay mutually consistent # (no value mixed in from a different source row) instead of independently SAMPLE()d at random. select ?view (min(?view_label) as ?view_label_g) (max(?displayed_here) as ?displayed_here_g) (strafter(strafter(max(concat(str(?date_added), "\\t", str(?np), "\\t", str(?position))), "\\t"), "\\t") as ?position_g) (strafter(strafter(max(concat(str(?date_added), "\\t", str(?np), "\\t", coalesce(str(?via_preset), ""))), "\\t"), "\\t") as ?via_preset_g) (strafter(strafter(max(concat(str(?date_added), "\\t", str(?np), "\\t", coalesce(str(?via_preset_label), ""))), "\\t"), "\\t") as ?via_preset_label_g) (strafter(strafter(max(concat(str(?date_added), "\\t", str(?np), "\\t", coalesce(str(?added_by), ""))), "\\t"), "\\t") as ?added_by_g) (strafter(strafter(max(concat(str(?date_added), "\\t", str(?np), "\\t", str(?deactivateView))), "\\t"), "\\t") as ?deactivateView_g) (max(?date_added) as ?date_added_g) (iri(strafter(max(concat(str(?date_added), "\\t", str(?np))), "\\t")) as ?np_g) ("^" as ?np_label_g) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?effVTarget ?pinSpace ?governedLatest where { values ?_resource_multi_iri {} values ?_root_np_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph npa:spacesGraph { ?passedRef npa:rootNanopub ?_root_np_multi_iri . } # Authority gate (space-scoped, no-UNION variant of list-view-displays): a single # mandatory hop through the governing space ref. For a gen:Space resource, issue #130's # reflexive self-edge (?space npa:hasGoverningSpaceRef ?ownRef) already exposes the # space's own admins/maintainers through this same hop, so the agent-self UNION branch # carried by the general list-view-displays is redundant here and is dropped. That leaves # a single non-UNION join under the variable ?stateG, avoiding the RDF4J planner timeout # documented in nanopub-query doc/sparql-quirks.md (variable hasCurrentSpaceState pointer # + multi-join + UNION => intermittent 504). ?ownClass is the constant gen:Space (this # query only backs gen:Space views), so the two ownClass exists-probes are folded away too. graph ?stateG { ?_resource_multi_iri npa:hasGoverningSpaceRef ?passedRef . ?ri a gen:RoleInstantiation ; npa:forSpaceRef ?passedRef ; npa:hasRoleType ?roleType ; npa:forAgent ?authAgent . filter(?roleType = gen:AdminRole || ?roleType = gen:MaintainerRole) ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } bind(gen:Space as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?supLabel . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } # Space-governed resolution (gen:governedBy; nanodash docs/views-and-presets-as- # maintained-resources.md): if the pinned version declares a governing space, the # newest version of its (kind, space) pair signed by a current member+ of that # space wins, with the kind validated as maintained by the space. Run-once # sub-select over all governed versions network-wide (gen:governedBy is highly # selective), joined back per pin. No valid candidate -> the pin stands. optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?pinNp npx:embeds ?viewRef ; np:hasAssertion ?pinA . } graph ?pinA { ?viewRef dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace . } } { select ?pinKind ?pinSpace (iri(strafter(max(concat(str(?cDate), ">", str(?cver))), ">")) as ?governedLatest) where { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?cnp dct:created ?cDate ; npa:hasValidSignatureForPublicKeyHash ?cpk ; npx:embeds ?cver ; np:hasAssertion ?ca . filter not exists { ?ci npx:invalidates ?cnp ; npa:hasValidSignatureForPublicKeyHash ?cpk . } } graph ?ca { ?cver dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace . } } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?gsg . } graph ?gsg { ?pinKind npa:isMaintainedBy ?pinSpace ; npa:hasGoverningSpaceRef ?gref . ?gri a gen:RoleInstantiation ; npa:forSpace ?pinSpace ; npa:forSpaceRef ?gref ; npa:hasRoleType ?gtier ; npa:forAgent ?gag . filter(?gtier = gen:AdminRole || ?gtier = gen:MaintainerRole || ?gtier = gen:MemberRole) ?gacct a npa:AccountState ; npa:agent ?gag ; npa:pubkey ?cpk . } } } group by ?pinKind ?pinSpace } service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?gnp npx:embeds ?governedLatest ; np:hasAssertion ?gva . } graph ?gva { ?governedLatest dct:title ?gTitle . } optional { graph ?gva { ?governedLatest gen:hasStructuralPosition ?gPos . } } optional { graph ?gva { ?governedLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?gTarget . } } } } bind(if(bound(?governedLatest), ?gTitle, ?supLabel) as ?view_label) bind(if(bound(?governedLatest), ?gPos, ?viewPos) as ?effViewPos) bind(if(bound(?governedLatest), ?gTarget, ?vTarget) as ?effVTarget) bind(coalesce(?dispPos, ?effViewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?effVTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?effVTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?effVTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?effVTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(if(bound(?pinSpace), coalesce(?governedLatest, ?viewRef), coalesce(?viewLatest, ?viewRef)) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view } order by desc(?displayed_here) ?position Like 'Get the classes of an ontology', but only returns classes published by an admin, maintainer, or member of the space that maintains the given resource. Classes are included if their definition declares them part of the given ontology (dct:isPartOf, or the legacy dct:partOf) or if their IRI starts with the ontology's namespace (optional 'ontologyNamespace' parameter). The maintaining space and its validated member public-key hashes are resolved server-side from the spaces repo (/repo/spaces); observers are excluded. Each class URI appears once, kept from the latest (by nanopub timestamp) member-published definition. Superclass labels are taken from the superclass' own rdfs:label when it is a class in the same ontology or namespace. The types column lists any rdf:type assignments besides owl:Class (e.g. owl:DeprecatedClass). The last_modified_by/last_modified columns give the signer and timestamp of that latest definition; the signer name is resolved from the trust repo (/repo/trust) or left blank. Get the classes of an ontology from space members including namespace prefix owl: <http://www.w3.org/2002/07/owl#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?class ?class_label ?description ?superclasses_multi_iri ?superclasses_label_multi ?types_multi_iri ?types_label_multi ?last_modified_by (sample(?lmbl) as ?last_modified_by_label) ?last_modified ?np ?np_label where { { select ?class (coalesce(min(?class_label_u), min(?class_label_a)) as ?class_label) (coalesce(min(?definition_u), min(?definition_a)) as ?description) (group_concat(distinct str(?superclass); separator=" ") as ?superclasses_multi_iri) (group_concat(distinct replace(replace(coalesce(?superclass_lbl, str(?superclass)), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as ?superclasses_label_multi) (group_concat(distinct str(?type); separator=" ") as ?types_multi_iri) (group_concat(distinct replace(replace(replace(str(?type), "^.*[/#]", ""), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as ?types_label_multi) (sample(?user) as ?last_modified_by) (sample(?date) as ?last_modified) ?np ("^" as ?np_label) where { values ?_ontology_multi_iri {} { select (group_concat(distinct str(?pubkey); separator=" ") as ?memberkeys) where { values ?_ontology_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?_ontology_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?pubkey . } } } } graph npa:graph { ?np npx:hasNanopubType owl:Class . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey1 . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey1 . } ?np dct:created ?date . ?np npx:introduces ?class . ?np np:hasAssertion ?a . optional { ?np npx:signedBy ?user . } } filter(contains(?memberkeys, str(?pubkey1))) graph ?a { { ?class a owl:Class . filter(strstarts(str(?class), ?__ontologyNamespace)) } union { ?class (dct:partOf|dct:isPartOf) ?_ontology_multi_iri . } optional { ?class rdfs:label ?class_label_u . filter(lang(?class_label_u) = "") } optional { ?class rdfs:label ?class_label_a . } optional { ?class skos:definition ?definition_u . filter(lang(?definition_u) = "") } optional { ?class skos:definition ?definition_a . } optional { ?class rdfs:subClassOf ?superclass . filter(isIRI(?superclass)) } optional { ?class a ?type . filter(?type != owl:Class) } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType owl:Class . ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 . filter not exists { ?np2x npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } ?np2 dct:created ?date2 . ?np2 npx:introduces ?class . ?np2 np:hasAssertion ?a2 . } filter(contains(?memberkeys, str(?pubkey2))) graph ?a2 { { ?class a owl:Class . filter(strstarts(str(?class), ?__ontologyNamespace)) } union { ?class (dct:partOf|dct:isPartOf) ?_ontology_multi_iri . } } filter(?date2 > ?date || (?date2 = ?date && str(?np2) > str(?np))) } optional { select ?superclass (coalesce(min(?sclbl_u), min(?sclbl_a)) as ?superclass_lbl) where { values ?_ontology_multi_iri {} graph npa:graph { ?scnp npx:hasNanopubType owl:Class ; npx:introduces ?superclass ; np:hasAssertion ?sca . } graph ?sca { { ?superclass a owl:Class . filter(strstarts(str(?superclass), ?__ontologyNamespace)) } union { ?superclass (dct:partOf|dct:isPartOf) ?_ontology_multi_iri . } ?superclass rdfs:label ?sclbl_a . optional { ?superclass rdfs:label ?sclbl_u . filter(lang(?sclbl_u) = "") } } } group by ?superclass } } group by ?class ?np } bind(coalesce(?last_modified_by, <urn:no-agent>) as ?signer) optional { { select ?signer ?lmbl where { service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> { graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?tg . } graph ?tg { ?signer foaf:name ?lmbl . } } } } } } group by ?class ?class_label ?description ?superclasses_multi_iri ?superclasses_label_multi ?types_multi_iri ?types_label_multi ?last_modified_by ?last_modified ?np ?np_label order by ?class_label Like 'Get the properties of an ontology', but only returns properties published by an admin, maintainer, or member of the space that maintains the given resource. Properties are included if their definition declares them part of the given ontology (dct:isPartOf, or the legacy dct:partOf) or if their IRI starts with the ontology's namespace (optional 'ontologyNamespace' parameter). The maintaining space and its validated member public-key hashes are resolved server-side from the spaces repo (/repo/spaces); observers are excluded. Each property URI appears once, kept from the latest (by nanopub timestamp) member-published definition. Superproperty, domain and range labels are taken from the term's own rdfs:label when it is defined in the same ontology or namespace (superproperties from the property repo, domain/range from the class repo), otherwise the local name is shown; domain and range are multi-valued. The types column lists any rdf:type assignments besides rdf:Property (e.g. owl:ObjectProperty, owl:DatatypeProperty). The last_modified_by/last_modified columns give the signer and timestamp of that latest definition; the signer name is resolved from the trust repo (/repo/trust) or left blank. Get the properties of an ontology from space members including namespace prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix owl: <http://www.w3.org/2002/07/owl#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?property ?property_label ?description ?superproperties_multi_iri ?superproperties_label_multi ?domain_multi_iri ?domain_label_multi ?range_multi_iri ?range_label_multi ?types_multi_iri ?types_label_multi ?last_modified_by (sample(?lmbl) as ?last_modified_by_label) ?last_modified ?np ?np_label where { { select ?property (coalesce(min(?property_label_u), min(?property_label_a)) as ?property_label) (coalesce(min(?definition_u), min(?definition_a)) as ?description) (group_concat(distinct str(?superprop); separator=" ") as ?superproperties_multi_iri) (group_concat(distinct replace(replace(coalesce(?superprop_lbl, replace(str(?superprop), "^.*[/#]", "")), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as ?superproperties_label_multi) (group_concat(distinct str(?domain); separator=" ") as ?domain_multi_iri) (group_concat(distinct replace(replace(coalesce(?domain_lbl, replace(str(?domain), "^.*[/#]", "")), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as ?domain_label_multi) (group_concat(distinct str(?range); separator=" ") as ?range_multi_iri) (group_concat(distinct replace(replace(coalesce(?range_lbl, replace(str(?range), "^.*[/#]", "")), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as ?range_label_multi) (group_concat(distinct str(?type); separator=" ") as ?types_multi_iri) (group_concat(distinct replace(replace(replace(str(?type), "^.*[/#]", ""), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n"); separator="\n") as ?types_label_multi) (sample(?user) as ?last_modified_by) (sample(?date) as ?last_modified) ?np ("^" as ?np_label) where { values ?_ontology_multi_iri {} { select (group_concat(distinct str(?pubkey); separator=" ") as ?memberkeys) where { values ?_ontology_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?_ontology_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?pubkey . } } } } graph npa:graph { ?np npx:hasNanopubType rdf:Property . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey1 . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey1 . } ?np dct:created ?date . ?np npx:introduces ?property . ?np np:hasAssertion ?a . optional { ?np npx:signedBy ?user . } } filter(contains(?memberkeys, str(?pubkey1))) graph ?a { { ?property a rdf:Property . filter(strstarts(str(?property), ?__ontologyNamespace)) } union { ?property (dct:partOf|dct:isPartOf) ?_ontology_multi_iri . } optional { ?property rdfs:label ?property_label_u . filter(lang(?property_label_u) = "") } optional { ?property rdfs:label ?property_label_a . } optional { ?property skos:definition ?definition_u . filter(lang(?definition_u) = "") } optional { ?property skos:definition ?definition_a . } optional { ?property rdfs:subPropertyOf ?superprop . filter(isIRI(?superprop)) } optional { ?property rdfs:domain ?domain . filter(isIRI(?domain)) } optional { ?property rdfs:range ?range . filter(isIRI(?range)) } optional { ?property a ?type . filter(?type != rdf:Property) } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType rdf:Property . ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 . filter not exists { ?np2x npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } ?np2 dct:created ?date2 . ?np2 npx:introduces ?property . ?np2 np:hasAssertion ?a2 . } filter(contains(?memberkeys, str(?pubkey2))) graph ?a2 { { ?property a rdf:Property . filter(strstarts(str(?property), ?__ontologyNamespace)) } union { ?property (dct:partOf|dct:isPartOf) ?_ontology_multi_iri . } } filter(?date2 > ?date || (?date2 = ?date && str(?np2) > str(?np))) } optional { select ?superprop (coalesce(min(?splbl_u), min(?splbl_a)) as ?superprop_lbl) where { values ?_ontology_multi_iri {} graph npa:graph { ?spnp npx:hasNanopubType rdf:Property ; npx:introduces ?superprop ; np:hasAssertion ?spa . } graph ?spa { { ?superprop a rdf:Property . filter(strstarts(str(?superprop), ?__ontologyNamespace)) } union { ?superprop (dct:partOf|dct:isPartOf) ?_ontology_multi_iri . } ?superprop rdfs:label ?splbl_a . optional { ?superprop rdfs:label ?splbl_u . filter(lang(?splbl_u) = "") } } } group by ?superprop } optional { select ?domain (coalesce(min(?dl_u), min(?dl_a)) as ?domain_lbl) where { values ?_ontology_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/e8cc5bb29ec5597303f8f101c65c545dc124ee0df68ce733764b03adc3237184> { graph npa:graph { ?dnp npx:hasNanopubType owl:Class ; npx:introduces ?domain ; np:hasAssertion ?dca . } graph ?dca { { ?domain a owl:Class . filter(strstarts(str(?domain), ?__ontologyNamespace)) } union { ?domain (dct:partOf|dct:isPartOf) ?_ontology_multi_iri . } ?domain rdfs:label ?dl_a . optional { ?domain rdfs:label ?dl_u . filter(lang(?dl_u) = "") } } } } group by ?domain } optional { select ?range (coalesce(min(?rl_u), min(?rl_a)) as ?range_lbl) where { values ?_ontology_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/e8cc5bb29ec5597303f8f101c65c545dc124ee0df68ce733764b03adc3237184> { graph npa:graph { ?rnp npx:hasNanopubType owl:Class ; npx:introduces ?range ; np:hasAssertion ?rca . } graph ?rca { { ?range a owl:Class . filter(strstarts(str(?range), ?__ontologyNamespace)) } union { ?range (dct:partOf|dct:isPartOf) ?_ontology_multi_iri . } ?range rdfs:label ?rl_a . optional { ?range rdfs:label ?rl_u . filter(lang(?rl_u) = "") } } } } group by ?range } } group by ?property ?np } bind(coalesce(?last_modified_by, <urn:no-agent>) as ?signer) optional { { select ?signer ?lmbl where { service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> { graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?tg . } graph ?tg { ?signer foaf:name ?lmbl . } } } } } } group by ?property ?property_label ?description ?superproperties_multi_iri ?superproperties_label_multi ?domain_multi_iri ?domain_label_multi ?range_multi_iri ?range_label_multi ?types_multi_iri ?types_label_multi ?last_modified_by ?last_modified ?np ?np_label order by ?property_label Lists the participants of a given space (one row per agent): agents holding a participant role, matched via the role's participation properties (participatedAsParticipantIn or wikidata P1344) so all role versions and both the 3PFF and general participant-role lineages are covered (validated role instantiations in the current space state). The np column points to the participation grant nanopub. IRI-keyed by npa:forSpace (param space). List space 3PFF participants prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?user_iri ?user_iri_label ?np ?np_label where { { select ?user_iri (sample(?name) as ?name) (max(?grantNpStr) as ?np0) where { values ?_space_multi_iri {} values ?partProp { <https://w3id.org/fair/3pff/participatedAsParticipantIn> <http://www.wikidata.org/entity/P1344> } graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?user_iri ; npa:viaNanopub ?grantNp ; npa:regularProperty ?partProp . } optional { graph ?g { ?user_iri foaf:name ?name } } bind(str(?grantNp) as ?grantNpStr) } group by ?user_iri } bind(iri(?np0) as ?np) bind("^" as ?np_label) bind(if(bound(?name), str(?name), "") as ?user_iri_label) } order by lcase(?user_iri_label) Like 'Get the definitions of an ontology including namespace and descriptions', but restricted to definition nanopublications published by an admin, maintainer, or member of the space that maintains the resource (observers excluded). It returns the definitions of the elements of a given OWL ontology (classes, properties, named individuals, and describing paragraphs) that either match the ontology namespace or declare dct:isPartOf the ontology. The maintaining space and its validated member public-key hashes are resolved server-side from the spaces repo (/repo/spaces). Each element appears once, kept from the latest member-authored definition (by nanopub timestamp, ties broken by nanopub URI). The last_modified_by/last_modified columns give the signer and timestamp of that latest definition; the signer name is resolved from the trust repo (/repo/trust) or left blank. Get the latest member-authored definitions of an ontology including namespace prefix owl: <http://www.w3.org/2002/07/owl#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix skos: <http://www.w3.org/2004/02/skos/core#> prefix schema: <https://schema.org/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?item (sample(?item_label_) as ?item_label) (sample(?user) as ?last_modified_by) (sample(?lmbl) as ?last_modified_by_label) (sample(?date) as ?last_modified) (sample(?np_) as ?np) ("^" as ?np_label) where { { select ?item (max(?rank) as ?maxrank) where { { select ?np_ ?item ?a ?date ?pubkey ?itemType where { values ?itemType { owl:Class rdf:Property owl:ObjectProperty owl:DatatypeProperty owl:NamedIndividual gen:Paragraph } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } values ?_ontology_multi_iri {} graph ?stateG { ?_ontology_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np_ npx:hasNanopubType ?itemType . ?np_ npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np_ ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np_ dct:created ?date . ?np_ npx:introduces ?item . ?np_ np:hasAssertion ?a . } filter(contains(?memberPubkeys, ?pubkey)) } } values ?_ontology_multi_iri {} graph ?a { { ?item a ?itemType . filter(strstarts(str(?item), ?__ontologyNamespace)) } union { ?item a ?itemType . ?item dct:isPartOf|schema:isPartOf ?_ontology_multi_iri . } } bind(concat(str(?date), "|", str(?np_)) as ?rank) } group by ?item } { select ?np_ ?item ?date ?user ?item_label_ where { { select ?np_ ?item ?a ?date ?user ?pubkey ?itemType where { values ?itemType { owl:Class rdf:Property owl:ObjectProperty owl:DatatypeProperty owl:NamedIndividual gen:Paragraph } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } values ?_ontology_multi_iri {} graph ?stateG { ?_ontology_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt . filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np_ npx:hasNanopubType ?itemType . ?np_ npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np_ ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np_ dct:created ?date . ?np_ npx:introduces ?item . ?np_ np:hasAssertion ?a . optional { ?np_ npx:signedBy ?user . } } filter(contains(?memberPubkeys, ?pubkey)) } } values ?_ontology_multi_iri {} graph ?a { { ?item a ?itemType . filter(strstarts(str(?item), ?__ontologyNamespace)) } union { ?item a ?itemType . ?item dct:isPartOf|schema:isPartOf ?_ontology_multi_iri . } optional { ?item rdfs:label|schema:title ?item_label_ . } } } } bind(concat(str(?date), "|", str(?np_)) as ?rank) filter(?rank = ?maxrank) optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> { select ?user ?lmbl where { graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?tg . } graph ?tg { ?user foaf:name ?lmbl . } } } } } group by ?item order by ?item_label The query returns all FAIR Supporting Resources (FSRs) that are in scope of climate change adaptation (GEMET concept 15033). Get all climate change adaptation FSRs prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix dct: <http://purl.org/dc/terms/> prefix fip: <https://w3id.org/fair/fip/terms/> prefix search: <http://www.openrdf.org/contrib/lucenesail#> select distinct ?thing (?label as ?thing_label) ?description (group_concat(distinct ?type; separator=" ") as ?types_multi_iri) ?np ?date where { graph npa:graph { <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> npa:hasValidSignatureForPublicKey ?curators_np_pk . ?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk . filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . } ?latest_curators_np np:hasAssertion ?latest_curators_assertion . } graph npa:networkGraph { ?latest_curators_np (npx:supersedes)* <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> . filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np } } graph npa:graph { ?np rdfs:label ?label ; npa:hasValidSignatureForPublicKey ?pubkey ; dct:created ?date . ?np npx:introduces|npx:describes ?thing . filter(str(?date) > "2022") filter exists { ?np npx:hasNanopubType ?fsr_type . values ?fsr_type { fip:FAIR-Enabling-Resource fip:FAIR-Supporting-Resource fip:Available-FAIR-Enabling-Resource } } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np npx:hasNanopubType ?type . filter(?type != fip:FAIR-Enabling-Resource) filter(?type != fip:Available-FAIR-Enabling-Resource) filter(?type != fip:FAIR-Enabling-Resource-to-be-Developed) filter(?type != fip:FAIR-Supporting-Resource) filter(?type != fip:Available-FAIR-Supporting-Resource) filter(?type != fip:FAIR-Supporting-Resource-to-be-Developed) filter(?type != fip:Domain-Specific-FAIR-Supporting-Resource) filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np np:hasAssertion ?a . } graph ?a { ?thing rdfs:comment ?description . ?thing fip:in-scope-of <http://www.eionet.europa.eu/gemet/concept/15033> . } filter not exists { graph npa:graph { ?disapproval_np npx:hasNanopubType <http://purl.org/nanopub/x/disapprovesOf> . ?disapproval_np np:hasAssertion ?da ; npa:hasValidSignatureForPublicKey ?dpubkey . filter not exists { ?disapproval_npx npx:invalidates ?disapproval_np ; npa:hasValidSignatureForPublicKey ?dpubkey . } } graph ?latest_curators_assertion { ?qpubkeys npx:hasPublicKey ?dpubkey . } graph ?da { ?disapprover npx:disapprovesOf ?np . } } } group by ?np ?thing ?description ?label ?date order by ?label Lists the members of a given space (one row per agent): agents holding the general member role (validated role instantiations in the current space state). Matches both published versions of that role. The np column points to the membership grant nanopub. IRI-keyed by npa:forSpace (param space). List space members by role prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?user_iri ?user_iri_label ?np ?np_label where { { select ?user_iri (sample(?name) as ?name) (max(?grantNpStr) as ?np0) where { values ?_space_multi_iri {} values ?role { <https://w3id.org/np/RAs9jJ7t2SRoUOjNtYwbJuR0n1ZP81AHolj6-xV18R6Nk/memberRole> <https://w3id.org/np/RA6VAVtZOK9Es1AKUHEK71f4xo9-AH-7dVqQK8X6zGpmw/memberRole> } graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?user_iri ; npa:viaNanopub ?grantNp ; gen:hasRole ?role . } optional { graph ?g { ?user_iri foaf:name ?name } } bind(str(?grantNp) as ?grantNpStr) } group by ?user_iri } bind(iri(?np0) as ?np) bind("^" as ?np_label) bind(if(bound(?name), str(?name), "") as ?user_iri_label) } order by lcase(?user_iri_label) Returns the concluded projects (defined as Spaces) that are sub-spaces of the given space, together with their project lead. A project counts as concluded when it has an end date that lies before today. A lead is only shown when it is a validated (top-down approved) holder of a project-lead role that is attached to that project at Member tier or above (observer-tier, self-attestable lead roles are excluded). Get concluded sub-space projects prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix schema: <http://schema.org/> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> select distinct ?project ?project_label ?dates ?lead ?lead_label ?description ?np ("^" as ?np_label) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np npx:introduces ?project . ?np np:hasAssertion ?a . ?np dct:created ?npDate . filter not exists { ?np2 npx:introduces ?project . ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } ?np2 dct:created ?npDate2 . filter(?npDate2 > ?npDate) } } graph ?a { ?project a gen:Space . ?project a gen:Project . ?project rdfs:label ?project_label . optional { ?project dct:description ?description . } optional { ?project schema:startDate ?datetime . } ?project schema:endDate ?endDatetime . } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?_resource_iri npa:hasSubSpace ?project . } optional { graph npa:spacesGraph { ?riStem (npa:regularProperty|npa:inverseProperty) gen:hasProjectLead ; npa:forSpace ?project ; npa:forAgent ?lead . ?rd npa:role ?role ; (gen:hasRegularProperty|gen:hasInverseProperty) gen:hasProjectLead ; npa:hasRoleType ?roleType . filter(?roleType in (gen:MemberRole, gen:MaintainerRole, gen:AdminRole)) } graph ?stateG { ?ra a gen:RoleAssignment ; npa:forSpace ?project ; gen:hasRole ?role . ?riFull npa:forSpace ?project ; npa:forAgent ?lead . } filter(strstarts(str(?riFull), concat(str(?riStem), "__"))) optional { graph ?stateG { ?lead foaf:name ?lead_label } } } } bind(xsd:date(substr(str(?endDatetime), 1, 10)) as ?endDate) bind(xsd:date(substr(str(now()), 1, 10)) as ?today) filter(?endDate < ?today) bind(substr(str(?datetime), 1, 10) as ?startDay) bind(substr(str(?endDatetime), 1, 10) as ?endDay) bind(if(!bound(?datetime), ?endDay, if(?startDay = ?endDay, concat(?startDay, " ", substr(str(?datetime), 12, 5)), concat(?startDay, " – ", ?endDay))) as ?dates) } order by ?startDay Returns the ongoing and upcoming projects (defined as Spaces) that are sub-spaces of the given space, together with their project lead. A project counts as ongoing/upcoming when it has no end date or its end date is today or later. A lead is only shown when it is a validated (top-down approved) holder of a project-lead role that is attached to that project at Member tier or above (observer-tier, self-attestable lead roles are excluded). Get ongoing and upcoming sub-space projects prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix schema: <http://schema.org/> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> select distinct ?project ?project_label ?dates ?lead ?lead_label ?description ?np ("^" as ?np_label) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np npx:introduces ?project . ?np np:hasAssertion ?a . ?np dct:created ?npDate . filter not exists { ?np2 npx:introduces ?project . ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } ?np2 dct:created ?npDate2 . filter(?npDate2 > ?npDate) } } graph ?a { ?project a gen:Space . ?project a gen:Project . ?project rdfs:label ?project_label . optional { ?project dct:description ?description . } optional { ?project schema:startDate ?datetime . } optional { ?project schema:endDate ?endDatetime . } } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?_resource_iri npa:hasSubSpace ?project . } optional { graph npa:spacesGraph { ?riStem (npa:regularProperty|npa:inverseProperty) gen:hasProjectLead ; npa:forSpace ?project ; npa:forAgent ?lead . ?rd npa:role ?role ; (gen:hasRegularProperty|gen:hasInverseProperty) gen:hasProjectLead ; npa:hasRoleType ?roleType . filter(?roleType in (gen:MemberRole, gen:MaintainerRole, gen:AdminRole)) } graph ?stateG { ?ra a gen:RoleAssignment ; npa:forSpace ?project ; gen:hasRole ?role . ?riFull npa:forSpace ?project ; npa:forAgent ?lead . } filter(strstarts(str(?riFull), concat(str(?riStem), "__"))) optional { graph ?stateG { ?lead foaf:name ?lead_label } } } } bind(xsd:date(substr(str(?datetime), 1, 10)) as ?startDate) bind(xsd:date(substr(str(?endDatetime), 1, 10)) as ?endDate) bind(xsd:date(substr(str(now()), 1, 10)) as ?today) filter(!bound(?endDate) || ?endDate >= ?today) bind(substr(str(?datetime), 1, 10) as ?startDay) bind(if(bound(?endDatetime), substr(str(?endDatetime), 1, 10), ?startDay) as ?endDay) bind(if(?startDay = ?endDay, concat(?startDay, " ", substr(str(?datetime), 12, 5)), concat(?startDay, " – ", ?endDay)) as ?dates) } order by ?startDate Returns all outputs (e.g. publications) linked to the given project via frapo:hasOutput, with the output's label, its type(s) and publication date (when described by a space member), restricted to links and descriptions authored by a member, maintainer, or admin of the project's space. Get outputs for project prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix frapo: <http://purl.org/cerif/frapo/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix fabio: <http://purl.org/spar/fabio/> select ?publication ?publication_label (group_concat(distinct str(?type); separator=" ") as ?type_multi_iri) (group_concat(distinct ?typeLabel; separator="\n") as ?type_label_multi) (sample(?pubdate0) as ?pubdate) ?np ("^" as ?np_label) where { values ?_project_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { select (group_concat(?mpk; separator=" ") as ?memberPubkeys) where { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?stateG . } values ?_project_multi_iri {} graph ?stateG { ?_project_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?roleType . filter(?roleType in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } } } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?npPubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?npPubkey . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?pi . } filter(contains(?memberPubkeys, ?npPubkey)) graph ?a { ?_project_multi_iri frapo:hasOutput ?publication . } optional { graph ?pi { ?publication nt:hasLabelFromApi ?publication_label . } } optional { graph npa:graph { ?dnp npa:hasValidSignatureForPublicKeyHash ?dpk . filter not exists { ?dnpx npx:invalidates ?dnp ; npa:hasValidSignatureForPublicKeyHash ?dpk . } filter not exists { ?dnp npx:hasNanopubType npx:ExampleNanopub . } ?dnp np:hasAssertion ?da . } filter(contains(?memberPubkeys, ?dpk)) graph ?da { ?publication a ?type . filter(strstarts(str(?type), "http://purl.org/spar/fabio/")) optional { ?publication dct:date ?pubdate0 } } bind(strafter(str(?type), "http://purl.org/spar/fabio/") as ?typeLabel) } } group by ?publication ?publication_label ?np order by desc(?pubdate) Returns key-value facts for display on a project page (a gen:Project, which is also a gen:Space): its description, start date, end date, project lead(s), and admins. Description and dates are read from the project's latest non-invalidated definition nanopub. Project leads are the validated holders of the project-lead role (gen:hasRole .../projectLeadRole) and admins are the validated admins (npa:hasRoleType gen:AdminRole) of the project, both resolved via the spaces repository. A lead's label uses the canonical foaf:name from the trust state when present, otherwise falls back to the foaf:name or nt:hasLabelFromApi declared for the agent in the pubinfo of the role-grant nanopub (npa:viaNanopub), and finally to the agent IRI. Each property occupies one row; the Value column is a multi-value cell so properties with several values (multiple leads or admins) list them all in a single row. Both columns use the '_noheader' convention so the redundant header row is dropped. Get project info prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix schema: <http://schema.org/> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?Property_noheader ?Property_label ?Value_multi_val_noheader ?Value_label_multi where { values ?_resource_multi_iri {} graph npa:graph { ?np npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; np:hasAssertion ?a . filter not exists { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } graph ?a { ?_resource_multi_iri a gen:Project } optional { select (group_concat(distinct ?descEsc; separator="\n") as ?descVal) where { values ?_resource_multi_iri {} graph npa:graph { ?npd npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pkd ; np:hasAssertion ?ad . filter not exists { ?invd npx:invalidates ?npd ; npa:hasValidSignatureForPublicKeyHash ?pkd . } } graph ?ad { ?_resource_multi_iri dct:description ?desc . } bind(replace(replace(str(?desc), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n") as ?descEsc) } having (count(?desc) > 0) } optional { select (group_concat(distinct substr(str(?sd), 1, 10); separator="\n") as ?startVal) where { values ?_resource_multi_iri {} graph npa:graph { ?nps npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pks ; np:hasAssertion ?asd . filter not exists { ?invs npx:invalidates ?nps ; npa:hasValidSignatureForPublicKeyHash ?pks . } } graph ?asd { ?_resource_multi_iri schema:startDate ?sd . } } having (count(?sd) > 0) } optional { select (group_concat(distinct substr(str(?ed), 1, 10); separator="\n") as ?endVal) where { values ?_resource_multi_iri {} graph npa:graph { ?npe npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pke ; np:hasAssertion ?aed . filter not exists { ?inve npx:invalidates ?npe ; npa:hasValidSignatureForPublicKeyHash ?pke . } } graph ?aed { ?_resource_multi_iri schema:endDate ?ed . } } having (count(?ed) > 0) } optional { select (group_concat(?lead2; separator="\n") as ?leadVal) (group_concat(?leadName; separator="\n") as ?leadLabel) where { select ?lead2 (coalesce(max(?leadNmState), max(?leadNmPub), ?lead2) as ?leadName) where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?g . } graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?_resource_multi_iri ; gen:hasRole <https://w3id.org/np/RAei8Dr3uv5mhWDfkgmX39wbhFe_1fsF_zFBrzYt94LZQ/projectLeadRole> ; npa:forAgent ?lead ; npa:viaNanopub ?leadNp . } optional { graph ?g { ?lead foaf:name ?leadNmState . } } } optional { graph npa:graph { ?leadNp np:hasPublicationInfo ?lpi . } graph ?lpi { ?lead foaf:name ?leadNmPub1 . } } optional { graph npa:graph { ?leadNp np:hasPublicationInfo ?lpi2 . } graph ?lpi2 { ?lead nt:hasLabelFromApi ?leadNmPub2 . } } bind(coalesce(?leadNmPub1, ?leadNmPub2) as ?leadNmPub) bind(str(?lead) as ?lead2) } group by ?lead2 } having (count(?lead2) > 0) } optional { select (group_concat(?admin2; separator="\n") as ?adminVal) (group_concat(?adminName; separator="\n") as ?adminLabel) where { select distinct ?admin2 ?adminName where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?g . } graph ?g { ?ri2 a gen:RoleInstantiation ; npa:forSpace ?_resource_multi_iri ; npa:hasRoleType gen:AdminRole ; npa:forAgent ?admin . } optional { graph ?g { ?admin foaf:name ?adminName0 . } } } bind(coalesce(?adminName0, str(?admin)) as ?adminName) bind(str(?admin) as ?admin2) } } having (count(?admin2) > 0) } values (?key ?Property_noheader ?Property_label) { ('Description' dct:description 'Description:') ('StartDate' schema:startDate 'Start Date:') ('EndDate' schema:endDate 'End Date:') ('Lead' gen:hasProjectLead 'Project Lead:') ('Admins' gen:hasAdmin 'Admins:') } bind(if(?key='Description', ?descVal, if(?key='StartDate', ?startVal, if(?key='EndDate', ?endVal, if(?key='Lead', ?leadVal, ?adminVal)))) as ?Value_multi_val_noheader) filter(bound(?Value_multi_val_noheader)) bind(if(?key='Lead', ?leadLabel, if(?key='Admins', ?adminLabel, '')) as ?Value_label_multi) } order by (if(?key='Description', 1, if(?key='StartDate', 2, if(?key='EndDate', 3, if(?key='Lead', 4, 5))))) This query returns resources (FERs etc.) together with the info about whether GO FAIR qualified them. Get GO FAIR qualified things prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix dct: <http://purl.org/dc/terms/> prefix fip: <https://w3id.org/fair/fip/terms/> prefix prov: <http://www.w3.org/ns/prov#> select distinct ?thing ?label ?np ?date ?qualification_np where { graph npa:graph { <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> npa:hasValidSignatureForPublicKey ?curators_np_pk . ?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk . filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . } ?latest_curators_np np:hasAssertion ?latest_curators_assertion . } graph npa:networkGraph { ?latest_curators_np (npx:supersedes)* <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> . filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np } } graph npa:graph { ?np npx:hasNanopubType ?__type_iri . ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np (npx:introduces|npx:describes) ?thing . ?np rdfs:label ?label . ?np dct:description ?description . ?np dct:created ?date . filter(str(?date) > "2022") } graph npa:graph { ?qualification_np npx:hasNanopubType npx:qualifies . ?qualification_np npa:hasValidSignatureForPublicKey ?qpubkey . } graph ?latest_curators_assertion { ?qpubkeys npx:hasPublicKey ?qpubkey . } graph npa:graph { filter not exists { ?qualification_np_x npx:invalidates ?qualification_np ; npa:hasValidSignatureForPublicKey ?qpubkey . } ?qualification_np np:hasAssertion ?qa . } graph ?qa { ?qualifier npx:qualifies ?np . } optional { graph npa:graph { ?disapproval npa:hasValidSignatureForPublicKey ?dpubkey . } graph ?latest_curators_assertion { ?dpubkeys npx:hasPublicKey ?dpubkey . } graph npa:graph { filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . } ?disapproval np:hasAssertion ?da . } graph ?da { ?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np . } } filter(!bound(?disapproval)) # Faster than "filter not exists" for some reason } group by ?thing ?label ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np order by asc(?label) Returns a list of all events related to the Three Point FAIRification Framework (3PFF), with IRIs output directly (not pre-rendered as HTML). Multi-value organizer/facilitator/more-info columns carry their IRIs alongside a parallel label companion column (organizer and facilitator labels resolved from the trust repository, falling back to the URI's local name). Variant of get-3pff-events-html intended for tabular views that render IRIs and labels natively (e.g. Nanodash). The final 'np' column uses '^' labels to trigger the per-row dropdown menu. Get 3PFF Events (IRIs) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix dct: <http://purl.org/dc/terms/> prefix prov: <http://www.w3.org/ns/prov#> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix tpff: <https://w3id.org/fair/3pff/> prefix schema: <http://schema.org/> select (?event as ?Event_ID) (?eventShortName as ?Event_ID_label) (?eventLongName as ?Event_Name) (?eventDate as ?Date) ?Organizers_multi_iri ?Organizers_label_multi ?Facilitators_multi_iri ?Facilitators_label_multi ?More_Info_multi_iri ?More_Info_label_multi ?np ("^" as ?np_label) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasAssertion ?assertion . ?np npx:introduces ?event . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?event a tpff:3PFF-event . ?event rdfs:label ?eventName . optional { ?event dct:date ?dateDct . } optional { ?event schema:startDate ?dateSchema . } } bind(coalesce(?dateDct, strBefore(str(?dateSchema), "T")) as ?eventDate) bind(replace(str(?eventName), ' ?\\|.*$', '') as ?eventShortName) bind(replace(str(?eventName), '^.*\\| ?(.*)$', '$1') as ?eventLongName) optional { select ?event (group_concat(str(?org); separator=" ") as ?Organizers_multi_iri) (group_concat(?orgLabel; separator="\n") as ?Organizers_label_multi) where { select ?event ?org (sample(?orgName) as ?orgLabel) where { graph npa:graph { ?onp npx:introduces ?event ; np:hasAssertion ?oa ; npa:hasValidSignatureForPublicKey ?opk . filter not exists { ?onpx npx:invalidates ?onp ; npa:hasValidSignatureForPublicKey ?opk . } } graph ?oa { ?event a tpff:3PFF-event . ?event tpff:has-event-organizer ?org . } bind(replace(replace(str(?org), "/$", ""), "^.*[/#]", "") as ?orgLocal) optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentTrustState ?ts . } graph ?ts { ?org foaf:name ?orgFoaf . } } } bind(coalesce(?orgFoaf, ?orgLocal) as ?orgName) } group by ?event ?org } group by ?event } optional { select ?event (group_concat(str(?fac); separator=" ") as ?Facilitators_multi_iri) (group_concat(?facLabel; separator="\n") as ?Facilitators_label_multi) where { select ?event ?fac (sample(?facName) as ?facLabel) where { graph npa:graph { ?fnp npx:introduces ?event ; np:hasAssertion ?fa ; npa:hasValidSignatureForPublicKey ?fpk . filter not exists { ?fnpx npx:invalidates ?fnp ; npa:hasValidSignatureForPublicKey ?fpk . } } graph ?fa { ?event a tpff:3PFF-event . ?event tpff:has-event-facilitator ?fac . } bind(replace(replace(str(?fac), "/$", ""), "^.*[/#]", "") as ?facLocal) optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentTrustState ?fts . } graph ?fts { ?fac foaf:name ?facFoaf . } } } bind(coalesce(?facFoaf, ?facLocal) as ?facName) } group by ?event ?fac } group by ?event } optional { select ?event (group_concat(str(?link); separator=" ") as ?More_Info_multi_iri) (group_concat(?linkLabel; separator="\n") as ?More_Info_label_multi) where { select ?event ?link (sample(?linkLocal) as ?linkLabel) where { graph npa:graph { ?lnp npx:introduces ?event ; np:hasAssertion ?la ; npa:hasValidSignatureForPublicKey ?lpk . filter not exists { ?lnpx npx:invalidates ?lnp ; npa:hasValidSignatureForPublicKey ?lpk . } } graph ?la { ?event a tpff:3PFF-event . ?event rdfs:seeAlso ?link . } bind(replace(replace(str(?link), "/$", ""), "^.*[/#]", "") as ?linkLocal) } group by ?event ?link } group by ?event } } order by desc(?eventDate) Lists every observer-tier role association of a space ref (validated plus un-introduced self-declared, flagged via the headerless column). Excludes a member's observer association only when they hold a VALIDATED higher tier THROUGH THE SAME ROLE PROPERTY (npa:hasRoleType on a gen:RoleInstantiation in the current space state). BUGFIX over RAoW4pMA/RAZNHDFQ (nanodash#498): that version excluded the member whenever they held ANY validated higher-tier role, which hid an admin/maintainer/member from the observer list even for a separate, genuinely observer-tier role they hold (e.g. an admin who is also a planned attendant showed nowhere as an observer). Scoping the higher-tier check to the same role property restores the intended behaviour (every observer-tier association is listed) while keeping the #498 tier-collision fix: a property declared as observer globally but validated at a higher tier for this member in this ref is still excluded. List space observers (ref-scoped, all observer-tier associations, with validation flag) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix schema: <http://schema.org/> select ?member (group_concat(distinct ?latestNp; separator=" ") as ?role_assignments_multi_iri) (group_concat(distinct ?roleLabel; separator="\n") as ?role_assignments_label_multi) (if(max(?val) = 0, "⚠️", "") as ?unverified_noheader) where { { select ?member ?roleProp (max(?val0) as ?val) (strafter(max(concat(coalesce(str(?dateNp),""), " ", str(?grantNp))), " ") as ?latestNp) (sample(?rl) as ?rlRaw) where { values ?_root_np_multi_iri {} graph npa:spacesGraph { ?ref npa:rootNanopub ?_root_np_multi_iri ; npa:spaceIri ?spaceIri . } graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph npa:spacesGraph { ?ri a gen:RoleInstantiation ; npa:forSpace ?inSpace ; npa:forAgent ?member ; npa:viaNanopub ?grantNp ; (npa:regularProperty|npa:inverseProperty) ?roleProp . } filter( ?inSpace = ?spaceIri || exists { graph ?g { ?inSpace npa:sameAsSpace ?ref } } ) filter exists { graph npa:spacesGraph { ?rdf a npa:RoleDeclaration ; npa:hasRoleType gen:ObserverRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } filter(?roleProp != gen:hasAdmin) filter not exists { graph ?g { ?vriH a gen:RoleInstantiation ; npa:forSpaceRef ?ref ; npa:forAgent ?member ; (npa:regularProperty|npa:inverseProperty) ?roleProp . { ?vriH npa:hasRoleType gen:AdminRole } union { ?vriH npa:hasRoleType gen:MaintainerRole } union { ?vriH npa:hasRoleType gen:MemberRole } } } filter not exists { graph npa:graph { ?invNp npx:invalidates ?grantNp ; npa:hasValidSignatureForPublicKeyHash ?invpk . ?grantNp npa:hasValidSignatureForPublicKeyHash ?invpk . } } bind(if(exists { graph ?g { ?vri npa:forSpaceRef ?ref ; npa:forAgent ?member ; npa:viaNanopub ?grantNp } }, 1, 0) as ?val0) optional { graph npa:graph { ?grantNp dct:created ?dateNp } } optional { graph ?g { ?raRole a gen:RoleAssignment ; npa:forSpaceRef ?ref ; gen:hasRole ?role . } graph npa:spacesGraph { ?rd2 a npa:RoleDeclaration ; npa:role ?role ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp ; npa:viaNanopub ?roleNp . } graph npa:graph { ?roleNp np:hasAssertion ?role_a . } optional { graph ?role_a { ?role schema:name ?rl } } } } group by ?member ?roleProp } bind(coalesce(?rlRaw, "role") as ?roleLabel) } group by ?member order by ?unverified_noheader ?member Lists the participants of a given space (one row per agent): agents holding the general participant role or the planned-attendance role (validated role instantiations in the current space state). A separate status column holds '(planned)' when the agent only plans to attend (no participant role), otherwise empty. The np column points to the participant-role grant if present, otherwise to the planned-attendance grant. IRI-keyed by npa:forSpace (param space). List space participants prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?user_iri ?user_iri_label ?status ?np ?np_label where { { select ?user_iri (sample(?name) as ?name) (max(?partNp0) as ?partNp) (max(?planNp0) as ?planNp) where { values ?_space_multi_iri {} values ?role { <https://w3id.org/np/RAAZF7iqaWUcyWJMZ-1-hJxoGUxM5ykR70SQT9vKT5m3I/participantRole> <https://w3id.org/np/RA9SPqtEgUK_ZcNzTRQjoOvKuV6vNgA81la4XA4HKDltQ/plannedAttendanceRole> } graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?user_iri ; npa:viaNanopub ?grantNp ; gen:hasRole ?role . } optional { graph ?g { ?user_iri foaf:name ?name } } bind(if(?role = <https://w3id.org/np/RAAZF7iqaWUcyWJMZ-1-hJxoGUxM5ykR70SQT9vKT5m3I/participantRole>, str(?grantNp), "") as ?partNp0) bind(if(?role = <https://w3id.org/np/RA9SPqtEgUK_ZcNzTRQjoOvKuV6vNgA81la4XA4HKDltQ/plannedAttendanceRole>, str(?grantNp), "") as ?planNp0) } group by ?user_iri } bind(if(?partNp != "", str(?partNp), str(?planNp)) as ?npStr) bind(iri(?npStr) as ?np) bind("^" as ?np_label) bind(if(bound(?name), str(?name), "") as ?user_iri_label) bind(if(?partNp = "", "(planned)", "") as ?status) } order by lcase(?user_iri_label) Lists the observers of a given space (one row per agent): agents holding the observer role (validated role instantiations in the current space state). The np column points to the observer-role grant nanopub. IRI-keyed by npa:forSpace (param space). List space observers by role prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?user_iri ?user_iri_label ?np ?np_label where { { select ?user_iri (sample(?name) as ?name) (max(?grantNpStr) as ?np0) where { values ?_space_multi_iri {} graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?user_iri ; npa:viaNanopub ?grantNp ; gen:hasRole <https://w3id.org/np/RAqAgIgZHRhzOVArfNvPPGPPfQEUK_b_155d6vGPbMMbc/observer-role> . } optional { graph ?g { ?user_iri foaf:name ?name } } bind(str(?grantNp) as ?grantNpStr) } group by ?user_iri } bind(iri(?np0) as ?np) bind("^" as ?np_label) bind(if(bound(?name), str(?name), "") as ?user_iri_label) } order by lcase(?user_iri_label) Returns key-value facts for display on a space or maintained-resource page: its type(s), description(s), and admins. Type and description are read from the resource's latest non-invalidated definition nanopub. Admins are the validated admins (npa:hasRoleType gen:AdminRole) of the governing space - the resource itself when it is a space, or its maintaining space when it is a maintained resource - resolved via the spaces repository. Each property occupies one row; the Value column is a multi-value cell so properties with several values (multiple types or admins) list them all in a single row. Both columns use the '_noheader' convention so the redundant header row is dropped. Get resource info prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?Property_noheader ?Property_label ?Value_multi_val_noheader ?Value_label_multi where { values ?_resource_multi_iri {} graph npa:graph { ?np npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; np:hasAssertion ?a . filter not exists { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } graph ?a { ?_resource_multi_iri a ?baseType . filter(?baseType in (gen:Space, gen:MaintainedResource)) } optional { select (group_concat(?typeIriS; separator="\n") as ?typeVal) (group_concat(?typeLocal; separator="\n") as ?typeLabel) where { select distinct ?typeIriS ?typeLocal where { values ?_resource_multi_iri {} graph npa:graph { ?npt npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pkt ; np:hasAssertion ?at . filter not exists { ?invt npx:invalidates ?npt ; npa:hasValidSignatureForPublicKeyHash ?pkt . } } graph ?at { ?_resource_multi_iri a ?typeIri . filter(?typeIri != gen:Space && ?typeIri != gen:MaintainedResource) } bind(str(?typeIri) as ?typeIriS) bind(replace(str(?typeIri), '^.*[/#]', '') as ?typeLocal) } } having (count(?typeIriS) > 0) } optional { select (group_concat(distinct ?descEsc; separator="\n") as ?descVal) where { values ?_resource_multi_iri {} graph npa:graph { ?npd npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pkd ; np:hasAssertion ?ad . filter not exists { ?invd npx:invalidates ?npd ; npa:hasValidSignatureForPublicKeyHash ?pkd . } } graph ?ad { ?_resource_multi_iri dct:description ?desc . } bind(replace(replace(str(?desc), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n") as ?descEsc) } having (count(?desc) > 0) } optional { select (group_concat(?admin2; separator="\n") as ?adminVal) (group_concat(?adminName; separator="\n") as ?adminLabel) where { select distinct ?admin2 ?adminName where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?g . } optional { graph ?g { ?_resource_multi_iri npa:isMaintainedBy ?maint . } } bind(coalesce(?maint, ?_resource_multi_iri) as ?adminSpace) graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?adminSpace ; npa:hasRoleType gen:AdminRole ; npa:forAgent ?admin . } optional { graph ?g { ?admin foaf:name ?adminName0 . } } } bind(coalesce(?adminName0, str(?admin)) as ?adminName) bind(str(?admin) as ?admin2) } } having (count(?admin2) > 0) } values (?key ?Property_noheader ?Property_label) { ('Type' rdf:type 'Type:') ('Description' dct:description 'Description:') ('Admins' gen:hasAdmin 'Admins:') } bind(if(?key='Type', ?typeVal, if(?key='Description', ?descVal, ?adminVal)) as ?Value_multi_val_noheader) filter(bound(?Value_multi_val_noheader)) bind(if(?key='Type', ?typeLabel, if(?key='Admins', ?adminLabel, '')) as ?Value_label_multi) } order by (if(?key='Type', 1, if(?key='Description', 2, 3))) Returns basic key-value facts about a given space (type, alternative IDs, start and end date for time-limited spaces, and the latest and root definition nanopubs). The space's latest-definition nanopub is passed in as the 'spaceNp' parameter; type, alternative IDs and dates are read from that definition, and its space-ref's root definition is resolved from the spaces repository. This scopes every fact to a single space-ref (identity = space IRI + root definition), so spaces whose IRI is claimed by several refs no longer mix. Each property occupies exactly one row: the Value column is a multi-value (IRI or literal) cell, so a property with several values (e.g. multiple types or alternative IDs) lists them all in a single row rather than spawning a row per value. Each multi-valued property is aggregated in its own subquery so the values never cross-multiply across rows. Both columns use the '_noheader' convention so the redundant header row is dropped. Get space info prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix schema: <http://schema.org/> prefix owl: <http://www.w3.org/2002/07/owl#> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?Property_noheader ?Property_label ?Value_multi_val_noheader ?Value_label_multi where { values ?_space_multi_iri {} graph npa:graph { ?_spaceNp_iri np:hasAssertion ?a . } graph ?a { ?_space_multi_iri a gen:Space . } optional { select (group_concat(?typeIri; separator="\n") as ?typeVal) (group_concat(?typeLocal; separator="\n") as ?typeLabel) where { values ?_space_multi_iri {} graph npa:graph { ?_spaceNp_iri np:hasAssertion ?at . } graph ?at { ?_space_multi_iri a ?typeIri . filter(?typeIri != gen:Space) } bind(replace(str(?typeIri), '^.*[/#]', '') as ?typeLocal) } having (count(?typeIri) > 0) } optional { select (group_concat(str(?altIri); separator="\n") as ?altVal) where { values ?_space_multi_iri {} graph npa:graph { ?_spaceNp_iri np:hasAssertion ?aa . } graph ?aa { ?_space_multi_iri owl:sameAs ?altIri . } } having (count(?altIri) > 0) } optional { select (group_concat(str(?sd); separator="\n") as ?startVal) where { values ?_space_multi_iri {} graph npa:graph { ?_spaceNp_iri np:hasAssertion ?asd . } graph ?asd { ?_space_multi_iri schema:startDate ?sd . } } having (count(?sd) > 0) } optional { select (group_concat(str(?ed); separator="\n") as ?endVal) where { values ?_space_multi_iri {} graph npa:graph { ?_spaceNp_iri np:hasAssertion ?aed . } graph ?aed { ?_space_multi_iri schema:endDate ?ed . } } having (count(?ed) > 0) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:spacesGraph { ?def npa:viaNanopub ?_spaceNp_iri ; npa:forSpaceRef ?ref . ?ref npa:rootNanopub ?rootNp . } } } values (?key ?Property_noheader ?Property_label) { ('Type' rdf:type 'Type:') ('Alternative IDs' owl:sameAs 'Alternative IDs:') ('Start date' schema:startDate 'Start date:') ('End date' schema:endDate 'End date:') ('Latest definition' npa:viaNanopub 'Latest definition:') ('Root definition' gen:hasRootDefinition 'Root definition:') } bind(if(?key='Type', ?typeVal, if(?key='Alternative IDs', ?altVal, if(?key='Start date', ?startVal, if(?key='End date', ?endVal, if(?key='Latest definition', str(?_spaceNp_iri), str(?rootNp)))))) as ?Value_multi_val_noheader) filter(bound(?Value_multi_val_noheader)) bind(if(?key='Type', ?typeLabel, if(?key='Latest definition', substr(strafter(str(?_spaceNp_iri), '/np/'), 1, 10), if(?key='Root definition', substr(strafter(str(?rootNp), '/np/'), 1, 10), ''))) as ?Value_label_multi) } order by (if(?key='Type', 1, if(?key='Alternative IDs', 2, if(?key='Start date', 3, if(?key='End date', 4, if(?key='Latest definition', 5, 6)))))) Returns one row per known space with its label, type IRI and short type name, plus the number of members (Admin + Maintainer + Member tiers) and the number of observers (Observer tier), ordered by member count (most first), then alphabetically by space label. Intended for the /spaces table view. Get all spaces prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?space_iri (sample(?lbl) as ?space_iri_label) (sample(?t) as ?type) (sample(?tlbl) as ?type_label) (coalesce(sample(?mc), 0) as ?members_count) (coalesce(sample(?oc), 0) as ?observers_count) where { graph npa:spacesGraph { ?spaceRef a npa:SpaceRef ; npa:spaceIri ?space_iri . ?def a npa:SpaceDefinition ; npa:forSpaceRef ?spaceRef ; npa:viaNanopub ?np . } graph npa:graph { ?np rdfs:label ?lbl . ?np npx:hasNanopubType ?t . filter(strstarts(str(?t), "https://w3id.org/kpxl/gen/terms/")) filter(?t != gen:Space) } filter not exists { graph npa:graph { ?invNp npx:invalidates ?np . } } bind(strafter(str(?t), "https://w3id.org/kpxl/gen/terms/") as ?tlbl) optional { select ?space_iri (count(distinct ?memberAgent) as ?mc) (count(distinct ?observerAgent) as ?oc) where { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?g . } graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?space_iri ; npa:forAgent ?agent ; npa:hasRoleType ?tier . } bind(if(?tier != gen:ObserverRole, ?agent, ?unboundM) as ?memberAgent) bind(if(?tier = gen:ObserverRole, ?agent, ?unboundO) as ?observerAgent) } group by ?space_iri } } group by ?space_iri order by desc(coalesce(sample(?mc), 0)) lcase(sample(?lbl)) Lists the members (admin, maintainer, or member tier) of a given space together with their highest tier and links to the role-assignment nanopubs (labelled by the role name). Observer-tier roles are excluded. Reads the materialized tier directly off each validated gen:RoleInstantiation (npa:hasRoleType) and its role (gen:hasRole) in the current space state; no role-declaration re-derivation. IRI-keyed by npa:forSpace (param space). List space members prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix schema: <http://schema.org/> select ?user ?tier ?role_assignments_multi_iri ?role_assignments_label_multi where { { select ?user (if(min(?rank)=1,"Admin",if(min(?rank)=2,"Maintainer","Member")) as ?tier) (min(?rank) as ?rankMin) (group_concat(?latestNp; separator=" ") as ?role_assignments_multi_iri) (group_concat(?roleLabel; separator="\n") as ?role_assignments_label_multi) where { { select ?user ?role (min(?rank0) as ?rank) (sample(?roleLabel0) as ?roleLabel) (strafter(max(concat(coalesce(str(?dateNp),""), " ", str(?grantNp))), " ") as ?latestNp) where { values ?_space_multi_iri {} graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?user ; npa:viaNanopub ?grantNp ; npa:hasRoleType ?rt . } bind(if(?rt=gen:AdminRole,1,if(?rt=gen:MaintainerRole,2,if(?rt=gen:MemberRole,3,0))) as ?rank0) filter(?rank0 > 0) optional { graph npa:graph { ?grantNp dct:created ?dateNp } } optional { graph ?g { ?ri gen:hasRole ?role . } graph npa:spacesGraph { ?rd npa:role ?role ; npa:viaNanopub ?roleNp . } graph npa:graph { ?roleNp np:hasAssertion ?role_a . } optional { graph ?role_a { ?role schema:name ?rl } } } bind(if(?rt=gen:AdminRole,"admin",coalesce(?rl,"role")) as ?roleLabel0) } group by ?user ?role } } group by ?user } } order by ?rankMin ?user Lists the members (admin/maintainer/member tier) of a space ref with their highest tier and role-assignment links. Reads tier directly off each validated gen:RoleInstantiation (npa:hasRoleType / gen:hasRole) in the current space state; observer-tier excluded. Published as RApyKS9D (nanodash#498). List space members (ref-scoped) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix schema: <http://schema.org/> select ?member ?tier ?role_assignments_multi_iri ?role_assignments_label_multi where { { select ?member (if(min(?rank)=1,"Admin",if(min(?rank)=2,"Maintainer","Member")) as ?tier) (min(?rank) as ?rankMin) (group_concat(?latestNp; separator=" ") as ?role_assignments_multi_iri) (group_concat(?roleLabel; separator="\n") as ?role_assignments_label_multi) where { { select ?member ?role (min(?rank0) as ?rank) (sample(?roleLabel0) as ?roleLabel) (strafter(max(concat(coalesce(str(?dateNp),""), " ", str(?grantNp))), " ") as ?latestNp) where { values ?_root_np_multi_iri {} graph npa:spacesGraph { ?spaceRef npa:rootNanopub ?_root_np_multi_iri . } graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpaceRef ?spaceRef ; npa:forAgent ?member ; npa:viaNanopub ?grantNp ; npa:hasRoleType ?rt . } bind(if(?rt=gen:AdminRole,1,if(?rt=gen:MaintainerRole,2,if(?rt=gen:MemberRole,3,0))) as ?rank0) filter(?rank0 > 0) optional { graph npa:graph { ?grantNp dct:created ?dateNp } } optional { graph ?g { ?ri gen:hasRole ?role . } graph npa:spacesGraph { ?rd npa:role ?role ; npa:viaNanopub ?roleNp . } graph npa:graph { ?roleNp np:hasAssertion ?role_a . } optional { graph ?role_a { ?role schema:name ?rl } } } bind(if(?rt=gen:AdminRole,"admin",coalesce(?rl,"role")) as ?roleLabel0) } group by ?member ?role } } group by ?member } } order by ?rankMin ?member Lists the observer-tier members of a given space (highest validated tier is observer). Reads the materialized tier directly off each validated gen:RoleInstantiation (npa:hasRoleType) in the current space state and excludes anyone holding a higher tier; no role-declaration re-derivation. IRI-keyed by npa:forSpace (param space). List space observers prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix schema: <http://schema.org/> select ?user ?role_assignments_multi_iri ?role_assignments_label_multi where { { select ?user (max(?higher) as ?maxHigher) (group_concat(?latestNp; separator=" ") as ?role_assignments_multi_iri) (group_concat(?roleLabel; separator="\n") as ?role_assignments_label_multi) where { { select ?user ?role (max(?higher0) as ?higher) (sample(?roleLabel0) as ?roleLabel) (strafter(max(concat(coalesce(str(?dateNp),""), " ", str(?grantNp))), " ") as ?latestNp) where { values ?_space_multi_iri {} graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?user ; npa:viaNanopub ?grantNp ; npa:hasRoleType ?rt . } bind(if(?rt=gen:ObserverRole,0,1) as ?higher0) optional { graph npa:graph { ?grantNp dct:created ?dateNp } } optional { graph ?g { ?ri gen:hasRole ?role . } graph npa:spacesGraph { ?rd2 npa:role ?role ; npa:viaNanopub ?roleNp . } graph npa:graph { ?roleNp np:hasAssertion ?role_a . } optional { graph ?role_a { ?role schema:name ?rl } } } bind(coalesce(?rl,"role") as ?roleLabel0) } group by ?user ?role } } group by ?user having (max(?higher) = 0) } } order by ?user Returns the ongoing and upcoming events (defined as Spaces) that are sub-spaces of the given space. Get current and upcoming sub-space events prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix schema: <http://schema.org/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> select ?event ?event_label ?dates ?np ("^" as ?np_label) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np npx:introduces ?event . ?np np:hasAssertion ?a . ?np dct:created ?npDate . filter not exists { ?np2 npx:introduces ?event . ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } ?np2 dct:created ?npDate2 . filter(?npDate2 > ?npDate) } } graph ?a { ?event a gen:Space . ?event a gen:Event . ?event rdfs:label ?event_label . ?event schema:startDate ?datetime . optional { ?event schema:endDate ?endDatetime . } } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?_resource_iri npa:hasSubSpace ?event . } } bind(xsd:date(substr(str(?datetime), 1, 10)) as ?date) bind(xsd:date(substr(str(now()), 1, 10)) as ?today) optional { bind(xsd:date(substr(str(?endDatetime), 1, 10)) as ?endDate) } bind(if(bound(?endDate), ?endDate, ?date) as ?effectiveEnd) filter(?effectiveEnd >= ?today) bind(substr(str(?datetime), 1, 10) as ?startDay) bind(if(bound(?endDatetime), substr(str(?endDatetime), 1, 10), ?startDay) as ?endDay) bind(if(?startDay = ?endDay, concat(?startDay, " ", substr(str(?datetime), 12, 5)), concat(?startDay, " – ", ?endDay)) as ?dates) } order by ?date Returns the past (concluded) events (defined as Spaces) that are sub-spaces of the given space. Get past sub-space events prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix schema: <http://schema.org/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> select ?event ?event_label ?dates ?np ("^" as ?np_label) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np npx:introduces ?event . ?np np:hasAssertion ?a . ?np dct:created ?npDate . filter not exists { ?np2 npx:introduces ?event . ?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } ?np2 dct:created ?npDate2 . filter(?npDate2 > ?npDate) } } graph ?a { ?event a gen:Space . ?event a gen:Event . ?event rdfs:label ?event_label . ?event schema:startDate ?datetime . optional { ?event schema:endDate ?endDatetime . } } service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?_resource_iri npa:hasSubSpace ?event . } } bind(xsd:date(substr(str(?datetime), 1, 10)) as ?date) bind(xsd:date(substr(str(now()), 1, 10)) as ?today) optional { bind(xsd:date(substr(str(?endDatetime), 1, 10)) as ?endDate) } bind(if(bound(?endDate), ?endDate, ?date) as ?effectiveEnd) filter(?effectiveEnd < ?today) bind(substr(str(?datetime), 1, 10) as ?startDay) bind(if(bound(?endDatetime), substr(str(?endDatetime), 1, 10), ?startDay) as ?endDay) bind(if(?startDay = ?endDay, concat(?startDay, " ", substr(str(?datetime), 12, 5)), concat(?startDay, " – ", ?endDay)) as ?dates) } order by desc(?date) Lists the currently active view displays of a resource for the About page (standalone + preset-contributed, deactivations applied, latest version, one row per resolved view keeping the latest). displayed_here flags whether the view is shown on this resource's own page. Ordered shown-here first, then by structural position. Same as RAxKzcnWKNa_ufbAR_v2P8_eefeOIoEmRzKuEA9sm0IIQ but adds a position_label column (first three characters of the structural position) so the position cell shows e.g. \"1.1\" while the full literal \"1.1.about\" is shown on hover via the result-table label/tooltip convention. Also projects the deactivateView column (the view ref string) used by the per-row deactivate action, which the previous version dropped during outer aggregation. UNIFIED ref/IRI: optional ?__root_np_multi_iri scopes to one space-ref when present, IRI-keyed when absent; forSpaceRef is evaluated last as a bound-?ri lookup (efficient triple order) with a pinned-only equality filter. List view displays (unified ref/IRI v4) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?displayed_here) as ?displayed_here) (sample(?position) as ?position) (substr(sample(?position), 1, 3) as ?position_label) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (sample(?deactivateView) as ?deactivateView) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\\t", str(?np))), "\\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?vTarget where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } optional { values ?__root_np_multi_iri {} graph npa:spacesGraph { ?passedRef npa:rootNanopub ?__root_np_multi_iri . } } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . ?ri npa:forSpaceRef ?riRef . } filter( !bound(?passedRef) || ?riRef = ?passedRef ) optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } bind(if(exists { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy ?anyMaintainer } }, gen:MaintainedResource, if(exists { graph ?stateG { ?ownAcc a npa:AccountState ; npa:agent ?_resource_multi_iri } }, gen:IndividualAgent, gen:Space)) as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?vTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?vTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?vTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?vTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(coalesce(?viewLatest, ?viewRef) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view order by desc(?displayed_here) ?position Lists the currently active view displays of a resource for the About page (standalone + preset-contributed, deactivations applied, latest version, one row per resolved view keeping the latest). displayed_here flags whether the view is shown on this resource's own page. Ordered shown-here first, then by structural position. Same as RAxKzcnWKNa_ufbAR_v2P8_eefeOIoEmRzKuEA9sm0IIQ but adds a position_label column (first three characters of the structural position) so the position cell shows e.g. \"1.1\" while the full literal \"1.1.about\" is shown on hover via the result-table label/tooltip convention. Also projects the deactivateView column (the view ref string) used by the per-row deactivate action, which the previous version dropped during outer aggregation. List view displays (truncated position label, with deactivate ref) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?displayed_here) as ?displayed_here) (sample(?position) as ?position) (substr(sample(?position), 1, 3) as ?position_label) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (sample(?deactivateView) as ?deactivateView) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\\t", str(?np))), "\\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?vTarget where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } optional { values ?__root_np_multi_iri {} graph npa:spacesGraph { ?passedRef npa:rootNanopub ?__root_np_multi_iri . } } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forSpaceRef ?passedRef ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } bind(if(exists { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy ?anyMaintainer } }, gen:MaintainedResource, if(exists { graph ?stateG { ?ownAcc a npa:AccountState ; npa:agent ?_resource_multi_iri } }, gen:IndividualAgent, gen:Space)) as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?vTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?vTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?vTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?vTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(coalesce(?viewLatest, ?viewRef) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view order by desc(?displayed_here) ?position Lists the currently active view displays of a resource for the About page (standalone + preset-contributed, deactivations applied, latest version, one row per resolved view keeping the latest). displayed_here flags whether the view is shown on this resource's own page. Ordered shown-here first, then by structural position. Same as RAxKzcnWKNa_ufbAR_v2P8_eefeOIoEmRzKuEA9sm0IIQ but adds a position_label column (first three characters of the structural position) so the position cell shows e.g. \"1.1\" while the full literal \"1.1.about\" is shown on hover via the result-table label/tooltip convention. Also projects the deactivateView column (the view ref string) used by the per-row deactivate action, which the previous version dropped during outer aggregation. UNIFIED ref/IRI variant: an optional ?__root_np_multi_iri placeholder scopes authority to one space-ref (npa:forSpaceRef) when provided and falls back to IRI-keyed (admins merged across refs) when absent, via an optional ?riRef bind + coalesce equality filter (no per-row EXISTS) — replacing the separate list-view-displays-ref query. List view displays (unified ref/IRI, truncated position label, with deactivate ref) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?displayed_here) as ?displayed_here) (sample(?position) as ?position) (substr(sample(?position), 1, 3) as ?position_label) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (sample(?deactivateView) as ?deactivateView) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\\t", str(?np))), "\\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?vTarget where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } optional { values ?__root_np_multi_iri {} graph npa:spacesGraph { ?passedRef npa:rootNanopub ?__root_np_multi_iri . } } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . optional { ?ri npa:forSpaceRef ?riRef . } } filter( !bound(?passedRef) || coalesce(?riRef = ?passedRef, false) ) optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } bind(if(exists { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy ?anyMaintainer } }, gen:MaintainedResource, if(exists { graph ?stateG { ?ownAcc a npa:AccountState ; npa:agent ?_resource_multi_iri } }, gen:IndividualAgent, gen:Space)) as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?vTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?vTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?vTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?vTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(coalesce(?viewLatest, ?viewRef) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view order by desc(?displayed_here) ?position Lists the currently active view displays of a resource for the About page (standalone + preset-contributed, deactivations applied, latest version, one row per resolved view keeping the latest). displayed_here flags whether the view is shown on this resource's own page. Ordered shown-here first, then by structural position. Same as RAxKzcnWKNa_ufbAR_v2P8_eefeOIoEmRzKuEA9sm0IIQ but adds a position_label column (first three characters of the structural position) so the position cell shows e.g. \"1.1\" while the full literal \"1.1.about\" is shown on hover via the result-table label/tooltip convention. Also projects the deactivateView column (the view ref string) used by the per-row deactivate action, which the previous version dropped during outer aggregation. UNIFIED ref/IRI variant: an optional ?__root_np_multi_iri placeholder scopes authority to one space-ref (npa:forSpaceRef) when provided, and falls back to IRI-keyed (admins merged across refs) when absent — replacing the separate list-view-displays-ref query. List view displays (unified ref/IRI, truncated position label, with deactivate ref) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?displayed_here) as ?displayed_here) (sample(?position) as ?position) (substr(sample(?position), 1, 3) as ?position_label) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (sample(?deactivateView) as ?deactivateView) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\\t", str(?np))), "\\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?vTarget where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } optional { values ?__root_np_multi_iri {} graph npa:spacesGraph { ?passedRef npa:rootNanopub ?__root_np_multi_iri . } } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } filter( !bound(?passedRef) || exists { graph ?stateG { ?ri npa:forSpaceRef ?passedRef } } ) optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } bind(if(exists { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy ?anyMaintainer } }, gen:MaintainedResource, if(exists { graph ?stateG { ?ownAcc a npa:AccountState ; npa:agent ?_resource_multi_iri } }, gen:IndividualAgent, gen:Space)) as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?vTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?vTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?vTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?vTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(coalesce(?viewLatest, ?viewRef) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view order by desc(?displayed_here) ?position Ref-scoped view displays for a single space ref. Like list-view-displays but takes TWO inputs: the space IRI (resource) and the ref's root nanopub (root_np). The authority gate is scoped to admins/maintainers of THAT ref (npa:forSpaceRef resolved from root_np) rather than the space IRI merged across all its refs. Both inputs are concrete (VALUES) so federation bindings propagate (a single auto-detecting param can't: a service-derived resource IRI does not push into the federated SERVICE blocks). Space-only companion to list-view-displays; same columns. Regenerate from the latest list-view-displays by adding the root_np VALUES, the ?passedRef npa:rootNanopub resolution, and npa:forSpaceRef ?passedRef on the gate's RoleInstantiation. Adds a position_label column (first three characters of the structural position) so the position cell shows e.g. \"1.1\" while the full literal \"1.1.about\" is shown on hover via the result-table label/tooltip convention. Also projects the deactivateView column (the view ref string) used by the per-row deactivate action, which the previous version dropped during outer aggregation. List view displays (ref-scoped, truncated position label) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?displayed_here) as ?displayed_here) (sample(?position) as ?position) (substr(sample(?position), 1, 3) as ?position_label) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (sample(?deactivateView) as ?deactivateView) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\\t", str(?np))), "\\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?vTarget where { values ?_resource_multi_iri {} values ?_root_np_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph npa:spacesGraph { ?passedRef npa:rootNanopub ?_root_np_multi_iri . } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forSpaceRef ?passedRef ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } bind(if(exists { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy ?anyMaintainer } }, gen:MaintainedResource, if(exists { graph ?stateG { ?ownAcc a npa:AccountState ; npa:agent ?_resource_multi_iri } }, gen:IndividualAgent, gen:Space)) as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?vTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?vTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?vTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?vTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(coalesce(?viewLatest, ?viewRef) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view order by desc(?displayed_here) ?position Lists the currently active view displays of a resource for the About page (standalone + preset-contributed, deactivations applied, latest version, one row per resolved view keeping the latest). displayed_here flags whether the view is shown on this resource's own page. Ordered shown-here first, then by structural position. Same as RAxKzcnWKNa_ufbAR_v2P8_eefeOIoEmRzKuEA9sm0IIQ but adds a position_label column (first three characters of the structural position) so the position cell shows e.g. \"1.1\" while the full literal \"1.1.about\" is shown on hover via the result-table label/tooltip convention. Also projects the deactivateView column (the view ref string) used by the per-row deactivate action, which the previous version dropped during outer aggregation. List view displays (truncated position label, with deactivate ref) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?displayed_here) as ?displayed_here) (sample(?position) as ?position) (substr(sample(?position), 1, 3) as ?position_label) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (sample(?deactivateView) as ?deactivateView) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\t", str(?np))), "\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?vTarget where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } bind(if(exists { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy ?anyMaintainer } }, gen:MaintainedResource, if(exists { graph ?stateG { ?ownAcc a npa:AccountState ; npa:agent ?_resource_multi_iri } }, gen:IndividualAgent, gen:Space)) as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?vTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?vTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?vTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?vTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(coalesce(?viewLatest, ?viewRef) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view order by desc(?displayed_here) ?position Ref-scoped view displays for a single space ref. Like list-view-displays but takes TWO inputs: the space IRI (resource) and the ref's root nanopub (root_np). The authority gate is scoped to admins/maintainers of THAT ref (npa:forSpaceRef resolved from root_np) rather than the space IRI merged across all its refs. Both inputs are concrete (VALUES) so federation bindings propagate (a single auto-detecting param can't: a service-derived resource IRI does not push into the federated SERVICE blocks). Space-only companion to list-view-displays; same columns. Regenerate from the latest list-view-displays by adding the root_np VALUES, the ?passedRef npa:rootNanopub resolution, and npa:forSpaceRef ?passedRef on the gate's RoleInstantiation. Adds a position_label column (first three characters of the structural position) so the position cell shows e.g. \"1.1\" while the full literal \"1.1.about\" is shown on hover via the result-table label/tooltip convention. List view displays (ref-scoped, truncated position label) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?displayed_here) as ?displayed_here) (sample(?position) as ?position) (substr(sample(?position), 1, 3) as ?position_label) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\\t", str(?np))), "\\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?vTarget where { values ?_resource_multi_iri {} values ?_root_np_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph npa:spacesGraph { ?passedRef npa:rootNanopub ?_root_np_multi_iri . } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forSpaceRef ?passedRef ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } bind(if(exists { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy ?anyMaintainer } }, gen:MaintainedResource, if(exists { graph ?stateG { ?ownAcc a npa:AccountState ; npa:agent ?_resource_multi_iri } }, gen:IndividualAgent, gen:Space)) as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?vTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?vTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?vTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?vTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(coalesce(?viewLatest, ?viewRef) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view order by desc(?displayed_here) ?position Lists the currently active view displays of a resource for the About page (standalone + preset-contributed, deactivations applied, latest version, one row per resolved view keeping the latest). displayed_here flags whether the view is shown on this resource's own page. Ordered shown-here first, then by structural position. Same as RAxKzcnWKNa_ufbAR_v2P8_eefeOIoEmRzKuEA9sm0IIQ but adds a position_label column (first three characters of the structural position) so the position cell shows e.g. \"1.1\" while the full literal \"1.1.about\" is shown on hover via the result-table label/tooltip convention. List view displays (truncated position label) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?displayed_here) as ?displayed_here) (sample(?position) as ?position) (substr(sample(?position), 1, 3) as ?position_label) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\t", str(?np))), "\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?vTarget where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } bind(if(exists { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy ?anyMaintainer } }, gen:MaintainedResource, if(exists { graph ?stateG { ?ownAcc a npa:AccountState ; npa:agent ?_resource_multi_iri } }, gen:IndividualAgent, gen:Space)) as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?vTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?vTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?vTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?vTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(coalesce(?viewLatest, ?viewRef) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view order by desc(?displayed_here) ?position Lists the currently active view displays of a resource, for the About page: standalone view displays and the views contributed by assigned presets (marked in the via_preset column). Filtered to declarations signed by an admin or maintainer of the owning space, or by the affected user themselves; deactivated entries (and entries with a newer deactivation for the same pair) are excluded. Shows each view (resolved to its latest version), its structural position, the contributing preset (if any), who added it, the date, and the source nanopub. Ordered by structural position. Experimental variant of RAe63temfrauWIRVIpGa5booRJgioepZSg8t54lgMxmNo: adds a position_label column (the first three characters of the structural position) so the position cell shows e.g. \"1.1\" while the full literal \"1.1.about\" is shown on hover via the result-table label/tooltip convention. List view displays (truncated position label) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select (coalesce(?viewLatest, ?viewRef) as ?view) ?view_label ?position (substr(?position, 1, 3) as ?position_label) (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) bind(str(?viewRef) as ?deactivateView) } order by ?position desc(?date) Lists the non-approved role claims of a given space ref (space IRI + root definition): agents who hold a higher-tier role instantiation (admin/maintainer/member) that is NOT in the trust-validated current state, i.e. a self-assigned or otherwise ungranted claim awaiting approval by an equal-or-higher-tier member. Pass the ref's root nanopub (root_np). Observer-tier roles are excluded: they are self-assignable, so a self-declared observer needs no approval and is shown by list-space-observers instead. The higher-tier test is generic — the built-in admin property (gen:hasAdmin) OR a RoleDeclaration whose npa:hasRoleType is gen:AdminRole/gen:MaintainerRole/gen:MemberRole — but because the live spaces repo currently materialises every declaration as gen:ObserverRole, only admin claims are detectable today; maintainer/member claims appear automatically once real tier subclasses exist. Per (member, role) only the latest role-instantiation nanopub is returned (by dct:created). Returns the claimed tier, the role-assignment grant nanopub(s) with the claimed role's label (role_assignments_multi_iri + role_assignments_label_multi), and the role-assignment template (for the approve action, which re-asserts the same triple), plus a hidden agent_iri column the approve action maps into the template's agent placeholder. v2: adds the role_assignments columns. v3: resolves owl:sameAs space aliases (via the ref's validated npa:sameAsSpace edges in the current-state graph), so a higher-tier claim made against an alias IRI of the space is detected. v4: the invalidation filter now honours an npx:invalidates edge only when the invalidating nanopub shares a signing pubkey (npa:hasValidSignatureForPublicKeyHash) with the grant it targets, so a foreign-key retraction can no longer suppress another agent's claim (issue #487 / same gate as the materializer's #112). v5: BUGFIX — the v3/v4 space-alias resolution used a `{ bind(?spaceIri as ?inSpace) } union { ... npa:sameAsSpace ... }` pattern, but RDF4J does not propagate the outer ?spaceIri into a BIND inside a UNION branch, so ?inSpace was left unbound and the query returned ZERO rows for every space (no pending claim could ever surface). Replaced with a non-union `filter( ?inSpace = ?spaceIri || exists { ... npa:sameAsSpace ... } )` that binds ?inSpace from the role-instantiation triple, restoring detection while keeping alias resolution. List space non-approved role claims (ref-scoped) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix schema: <http://schema.org/> select ?member (sample(?agentX) as ?agent_iri) (sample(?tierX) as ?tier) (group_concat(distinct ?latestNp; separator=" ") as ?role_assignments_multi_iri) (group_concat(distinct ?roleLabel; separator="\n") as ?role_assignments_label_multi) (sample(?rtmplX) as ?roleAssignmentTemplate) where { { select ?member ?roleProp (max(?val0) as ?val) (strafter(max(concat(coalesce(str(?dateNp),""), " ", str(?grantNp))), " ") as ?latestNp) (sample(?member) as ?agentX) (sample(?tier0) as ?tierX) (sample(?rtmpl0) as ?rtmplX) (sample(?rl) as ?rlRaw) where { values ?_root_np_multi_iri {} graph npa:spacesGraph { ?ref npa:rootNanopub ?_root_np_multi_iri ; npa:spaceIri ?spaceIri . } graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph npa:spacesGraph { ?ri a gen:RoleInstantiation ; npa:forSpace ?inSpace ; npa:forAgent ?member ; npa:viaNanopub ?grantNp ; (npa:regularProperty|npa:inverseProperty) ?roleProp . } filter( ?inSpace = ?spaceIri || exists { graph ?g { ?inSpace npa:sameAsSpace ?ref } } ) bind(?roleProp = gen:hasAdmin as ?isAdminProp) bind(exists { graph npa:spacesGraph { ?rdA a npa:RoleDeclaration ; npa:hasRoleType gen:AdminRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } as ?isAdminDecl) bind(exists { graph npa:spacesGraph { ?rdM a npa:RoleDeclaration ; npa:hasRoleType gen:MaintainerRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } as ?isMaint) bind(exists { graph npa:spacesGraph { ?rdMe a npa:RoleDeclaration ; npa:hasRoleType gen:MemberRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } as ?isMemb) filter(?isAdminProp || ?isAdminDecl || ?isMaint || ?isMemb) filter not exists { graph npa:graph { ?invNp npx:invalidates ?grantNp ; npa:hasValidSignatureForPublicKeyHash ?invpk . ?grantNp npa:hasValidSignatureForPublicKeyHash ?invpk . } } bind(if(exists { graph ?g { ?vri npa:forSpaceRef ?ref ; npa:forAgent ?member ; (npa:regularProperty|npa:inverseProperty) ?roleProp } }, 1, 0) as ?val0) optional { graph npa:graph { ?grantNp dct:created ?dateNp } } bind(if(?isAdminProp || ?isAdminDecl, "Admin", if(?isMaint, "Maintainer", "Member")) as ?tier0) bind(if(?isAdminProp, <https://w3id.org/np/RAsOQ7k3GNnuUqZuLm57PWwWopQJR_4onnCpNR457CZg8>, ?undefTmpl) as ?rtmpl0) optional { graph ?g { ?raRole a gen:RoleAssignment ; npa:forSpaceRef ?ref ; gen:hasRole ?role . } graph npa:spacesGraph { ?rd2 a npa:RoleDeclaration ; npa:role ?role ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp ; npa:viaNanopub ?roleNp . } graph npa:graph { ?roleNp np:hasAssertion ?role_a . } optional { graph ?role_a { ?role schema:name ?rlS } } optional { graph ?role_a { ?role rdfs:label ?rlA } } optional { graph ?role_a { ?role dct:title ?rlB } } bind(coalesce(?rlS, ?rlA, ?rlB) as ?rlResolved) } bind(if(?isAdminProp, "admin", ?rlResolved) as ?rl) } group by ?member ?roleProp having (max(?val0) = 0) } bind(coalesce(?rlRaw, "role") as ?roleLabel) } group by ?member order by ?member Lists the currently active view displays of a resource for the About page (standalone + preset-contributed, deactivations applied, latest version, one row per resolved view keeping the latest). displayed_here flags whether the view is shown on this resource's own page. Ordered shown-here first, then by structural position. List view displays prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?displayed_here) as ?displayed_here) (sample(?position) as ?position) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\t", str(?np))), "\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?vTarget where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } bind(if(exists { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy ?anyMaintainer } }, gen:MaintainedResource, if(exists { graph ?stateG { ?ownAcc a npa:AccountState ; npa:agent ?_resource_multi_iri } }, gen:IndividualAgent, gen:Space)) as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?vTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?vTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?vTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?vTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(coalesce(?viewLatest, ?viewRef) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view order by desc(?displayed_here) ?position Lists, for a PART page (a resource viewed as a part of a maintained resource/space/user), the view displays configured on the part's owning resource, flagged for this specific part (read-only). Same display set and admin/maintainer authorization as list-view-displays, keyed on the owning resource (the 'resource' parameter): standalone view displays plus preset-contributed views, deactivations applied, each view resolved to its latest version. The displayed_here column is a flag (check mark, else blank) indicating whether the view is shown on THIS part -- i.e. its appliesToInstancesOf matches one of the part's own classes (the 'partclass' multi-valued parameter), or it is pinned to the part via gen:appliesTo, or its namespace targeting covers the part's IRI (the 'partid' parameter). A hasTopLevelView preset is pinned to the owning resource's own page and is therefore never shown on a part (blank); a hasView preset falls back to the view's own targeting. For blank (not-shown) rows the target_multi_iri column lists the class(es)/namespace(s) the view targets. Rows are ordered shown-here first, then by structural position. List part view displays prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), ""), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?dApply ?dTarget ?vTarget where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) } } values ?__partclass_multi_iri {} bind(if(coalesce(str(?dApply) = str(?_partid_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(?dTarget = ?__partclass_multi_iri, false) || coalesce(strstarts(str(?_partid_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?vTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(?vTarget = ?__partclass_multi_iri, false) || coalesce(strstarts(str(?_partid_iri), str(?vTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?vTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(coalesce(?viewLatest, ?viewRef) as ?view) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np } } order by desc(?displayed_here) ?position desc(?date_added) Ref-scoped view displays for a single space ref. Like list-view-displays but takes TWO inputs: the space IRI (resource) and the ref's root nanopub (root_np). The authority gate is scoped to admins/maintainers of THAT ref (npa:forSpaceRef resolved from root_np) rather than the space IRI merged across all its refs. Both inputs are concrete (VALUES) so federation bindings propagate (a single auto-detecting param can't: a service-derived resource IRI does not push into the federated SERVICE blocks). Space-only companion to list-view-displays; same columns. Regenerate from the latest list-view-displays by adding the root_np VALUES, the ?passedRef npa:rootNanopub resolution, and npa:forSpaceRef ?passedRef on the gate's RoleInstantiation. List view displays (ref-scoped) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?displayed_here) as ?displayed_here) (sample(?position) as ?position) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\\t", str(?np))), "\\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?displayed_here ?position (if(?displayed_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?displayed_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓"), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "✓")))))) as ?displayed_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?deactivateView ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?ownClass ?dApply ?dTarget ?vTarget where { values ?_resource_multi_iri {} values ?_root_np_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph npa:spacesGraph { ?passedRef npa:rootNanopub ?_root_np_multi_iri . } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forSpaceRef ?passedRef ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } bind(if(exists { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy ?anyMaintainer } }, gen:MaintainedResource, if(exists { graph ?stateG { ?ownAcc a npa:AccountState ; npa:agent ?_resource_multi_iri } }, gen:IndividualAgent, gen:Space)) as ?ownClass) } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("✓" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) } } bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?vTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(str(?vTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?vTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?vTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(coalesce(?viewLatest, ?viewRef) as ?view) bind(str(?viewRef) as ?deactivateView) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np } } } group by ?view order by desc(?displayed_here) ?position Finds presets (gen:Preset) by a text query for auto-complete lookup, restricted to those designed for a given entity type — i.e. whose gen:appliesToInstancesOf matches the passed appliedPresetClass. Mirrors find-views, for presets. Find presets prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?thing ?label ?description ?np ?pubkey ?date where { graph npa:graph { ?np npx:hasNanopubType gen:Preset . ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np dct:created ?date . ?np npx:embeds ?thing . ?np rdfs:label ?label . optional { ?np dct:description ?description . } filter(contains(lcase(?label), lcase(?_query))) ?np np:hasAssertion ?a . } graph ?a { ?thing gen:appliesToInstancesOf ?__appliedPresetClass_iri . } } limit 10 Lists the presets assigned in a given space ref (space IRI + root definition). Pass the ref's root nanopub (root_np); the query resolves the ref via npa:rootNanopub and reads the server-materialised npa:PresetAssignment rows scoped by npa:forSpaceRef from the trust-validated current space-state graph (only admin-authored assignments are materialised, so this is authorisation-scoped). Per (preset, resource) only the latest assignment by dct:created counts, and the preset is listed only when that latest row is still activated (npa:isActivated true) — a deactivation is a newer admin-authored row with npa:isActivated false. Columns match the IRI-keyed list-preset-assignments (preset, preset_label, deactivatePreset, added_by, date_added, np, np_label) so it drives the existing Preset assignments view unchanged. Ref-scoped variant: shows only that one ref's assignments rather than merging all refs claiming the IRI. List preset assignments (ref-scoped) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?preset (sample(?lbl) as ?preset_label) (str(?preset) as ?deactivatePreset) (sample(?user) as ?added_by) (?date as ?date_added) ?np ("^" as ?np_label) where { values ?_root_np_multi_iri {} graph npa:spacesGraph { ?ref npa:rootNanopub ?_root_np_multi_iri . } graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?paRef a npa:PresetAssignment ; npa:forSpaceRef ?ref ; npa:ofPreset ?preset ; npa:forResource ?resource ; npa:isActivated ?activated ; npa:viaNanopub ?np ; dct:created ?date . } filter(?activated = true) filter not exists { graph ?g { ?pa2 a npa:PresetAssignment ; npa:forSpaceRef ?ref ; npa:ofPreset ?preset ; npa:forResource ?resource ; dct:created ?date2 . } filter(?date2 > ?date) } optional { graph npa:graph { ?np npx:signedBy ?user } } optional { ?pnp npx:embeds ?preset ; np:hasAssertion ?pa . graph ?pa { ?preset rdfs:label ?lbl } } } group by ?preset ?date ?np order by desc(?date) Returns the (non-admin) members of a given space ref (space IRI + root definition), each with a ?validated flag. Pass the ref's root nanopub (root_np); the query resolves the ref via npa:rootNanopub and its space IRI, then returns every non-admin gen:RoleInstantiation naming that IRI from the raw npa:spacesGraph (member agent, role's regular/inverse property, instantiating nanopublication), with ?validated = true when that instantiation is also present in the trust-state-validated current space-state graph for this ref (i.e. the agent's key has a trust-approved AccountState from an accepted introduction), false otherwise. This shows all self-declared members while flagging the un-introduced/unvalidated ones, rather than hiding them. The invalidation filter is gated on a shared signing pubkey (npa:hasValidSignatureForPublicKeyHash) between the invalidating nanopub and the member declaration, so a foreign-key retraction cannot drop a member (issue #487). Get space members (ref-scoped, with validation flag) prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?member ?regProp ?invProp ?np ("^" as ?np_label) ?validated where { values ?_root_np_multi_iri {} graph npa:spacesGraph { ?ref npa:rootNanopub ?_root_np_multi_iri ; npa:spaceIri ?spaceIri . } graph npa:spacesGraph { ?ri a gen:RoleInstantiation ; npa:forSpace ?spaceIri ; npa:forAgent ?member ; npa:viaNanopub ?np . optional { ?ri npa:regularProperty ?regProp } optional { ?ri npa:inverseProperty ?invProp } filter not exists { ?ri npa:inverseProperty gen:hasAdmin } } filter not exists { graph npa:graph { ?invNp npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?invpk . ?np npa:hasValidSignatureForPublicKeyHash ?invpk . } } bind(exists { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?vri a gen:RoleInstantiation ; npa:forSpaceRef ?ref ; npa:forAgent ?member ; npa:viaNanopub ?np . } } as ?validated) } Returns the latest non-invalidated SpaceDefinition per space ref from the server-materialised spaces repo, joined to the declaring nanopublication for its label and type. Ref-aware variant of Get spaces (v2): adds the space ref (?ref) and its root nanopublication (?root) so the client can key one space per ref (space IRI + root definition) rather than per IRI. v4 (supersedes the v3 RAD5KmWO…): the invalidation filter is gated on a shared signing pubkey (npa:hasValidSignatureForPublicKeyHash) between the invalidating nanopub and the space-definition nanopub, so a foreign-key retraction can no longer suppress a space definition (issue #487). Get spaces (v4, ref-aware, same-pubkey invalidation gate) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?space_iri ?space_iri_label ?type ?type_label ?date ?np ("^" as ?np_label) ?ref ?root where { graph npa:spacesGraph { ?ref a npa:SpaceRef ; npa:spaceIri ?space_iri . optional { ?ref npa:rootNanopub ?root } ?def a npa:SpaceDefinition ; npa:forSpaceRef ?ref ; npa:viaNanopub ?np ; dct:created ?date . } graph npa:graph { ?np rdfs:label ?space_iri_label . ?np npx:hasNanopubType ?type . filter(strstarts(str(?type), "https://w3id.org/kpxl/gen/terms/")) filter(?type != gen:Space) } filter not exists { graph npa:graph { ?invNp npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?invpk . ?np npa:hasValidSignatureForPublicKeyHash ?invpk . } } bind(strafter(str(?type), "https://w3id.org/kpxl/gen/terms/") as ?type_label) } order by desc(?date) Lists every ref (root definition) that claims a given space IRI, each with its validated admin agents — the disambiguation claimants list. Pass the space IRI (space); returns one row per npa:SpaceRef of that IRI: its root nanopub (root) and the space-separated admin agent IRIs (admins_multi_iri), taken from the trust-state-validated admin RoleInstantiations (npa:inverseProperty gen:hasAdmin) scoped to that ref (npa:forSpaceRef) in the current space-state graph. More than one row means several distinct definitions claim the same identifier. Replaces the per-ref get-space-admins fan-out with a single query; which ref is the client's representative (default) is decided client-side. List space claimants prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?root (group_concat(distinct ?agent; separator=" ") as ?admins_multi_iri) where { values ?_space_multi_iri {} graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph npa:spacesGraph { ?ref a npa:SpaceRef ; npa:spaceIri ?_space_multi_iri ; npa:rootNanopub ?root . } optional { graph ?g { ?ri a gen:RoleInstantiation ; npa:inverseProperty gen:hasAdmin ; npa:forSpaceRef ?ref ; npa:forAgent ?agent . } } } group by ?root order by ?root Lists the maintained resources of a given space ref (space IRI + root definition) with a link to the source nanopublication. Label comes from each resource's definition assertion; resources whose definitions are all retracted or otherwise invalidated are filtered out. Ordered alphabetically by label. Pass the ref's root nanopub (root_np); the query resolves the ref via npa:rootNanopub and scopes the maintained-resource edges by the ref-level npa:hasMaintainedResource (subject = the ref), so it shows only that one ref's resources rather than merging all refs claiming the IRI. Ref-scoped variant of list-maintained-resources (which is IRI-keyed via npa:hasMaintainedResource on the space IRI). List maintained resources of a space (ref-scoped) prefix np: <http://www.nanopub.org/nschema#> prefix npx: <http://purl.org/nanopub/x/> prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> select ?resource ?resource_label ?np ("^" as ?np_label) where { { select ?resource (sample(?label) as ?resource_label) (sample(?viaNp) as ?np) where { values ?_root_np_multi_iri {} graph npa:spacesGraph { ?spaceRef npa:rootNanopub ?_root_np_multi_iri ; npa:spaceIri ?spaceIri . } graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?spaceRef npa:hasMaintainedResource ?resource . } graph ?ag { ?resource a gen:MaintainedResource ; rdfs:label ?label . } graph npa:graph { ?defNp np:hasAssertion ?ag ; npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?inv npx:invalidates ?defNp ; npa:hasValidSignatureForPublicKey ?pubkey . } } optional { graph npa:spacesGraph { ?d a npa:MaintainedResourceDeclaration ; npa:resourceIri ?resource ; npa:maintainerSpace ?spaceIri ; npa:viaNanopub ?viaNp } } } group by ?resource } } order by lcase(str(?resource_label)) Lists the roles assigned in a given space ref (space IRI + root definition) as a table: each role (linked, labelled by its schema:name, falling back to its label/title), its tier (Admin/Maintainer/Member/Observer), a count of how many distinct users of the ref hold that role, the contributing preset (via_preset, for roles carried by a preset assignment — resolved from the validated role-attachment's npa:derivedFromPreset marker), who added it, and the date. The built-in Admin role is always included as the first row. Also returns the role-assignment template (for the assign-user action) and the source nanopublication. Pass the ref's root nanopub (root_np); the query resolves the ref via npa:rootNanopub and scopes the role assignments and instantiations by npa:forSpaceRef, so it shows only that one ref's roles rather than merging all refs claiming the IRI. Ref-scoped variant of list-space-roles (which is IRI-keyed via npa:forSpace). List space roles (ref-scoped) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix schema: <http://schema.org/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?role (sample(?rlbl) as ?role_label) (sample(?rtier) as ?tier) (count(distinct ?member) as ?users) (sample(?presetX) as ?via_preset) (sample(?presetXlbl) as ?via_preset_label) (sample(?userX) as ?added_by) (max(?dateX) as ?date_added) (sample(?rtmpl) as ?roleAssignmentTemplate) (sample(?npX) as ?np) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } values ?_root_np_multi_iri {} graph npa:spacesGraph { ?spaceRef npa:rootNanopub ?_root_np_multi_iri . } { bind(<https://w3id.org/np/RA_eEJjQbxzSqYSwPzfjzOZi5sMPpUmHskFNsgJYSws8I/adminRole> as ?role) bind(0 as ?sortkey) bind("admin" as ?rlbl) bind("Admin" as ?rtier) bind(<https://w3id.org/np/RAsOQ7k3GNnuUqZuLm57PWwWopQJR_4onnCpNR457CZg8> as ?rtmpl) bind(gen:hasAdmin as ?prop) } union { graph ?g { ?ra a gen:RoleAssignment ; npa:forSpaceRef ?spaceRef ; gen:hasRole ?role ; npa:viaNanopub ?npX . } graph npa:graph { ?npX dct:created ?dateX . } optional { graph npa:graph { ?npX npx:signedBy ?userX . } } bind(1 as ?sortkey) optional { graph ?g { ?ra npa:derivedFromPreset ?assignNp . } graph npa:spacesGraph { ?paRow a npa:PresetAssignment ; npa:viaNanopub ?assignNp ; npa:ofPreset ?presetX . } optional { graph npa:graph { ?presetNp npx:embeds ?presetX ; np:hasAssertion ?paX . } graph ?paX { ?presetX rdfs:label ?presetXlbl . } } } graph npa:spacesGraph { ?roleDecl a npa:RoleDeclaration ; npa:role ?role ; npa:viaNanopub ?role_np . } bind(exists { graph npa:spacesGraph { ?roleDecl npa:hasRoleType gen:MaintainerRole } } as ?isMaintainer) bind(exists { graph npa:spacesGraph { ?roleDecl npa:hasRoleType gen:MemberRole } } as ?isMember) bind(if(?isMaintainer,"Maintainer",if(?isMember,"Member","Observer")) as ?rtier) graph npa:graph { ?role_np np:hasAssertion ?role_a . } optional { graph ?role_a { ?role rdfs:label ?rl1 } } optional { graph ?role_a { ?role dct:title ?rt1 } } optional { graph ?role_a { ?role schema:name ?rn1 } } optional { graph ?role_a { ?role gen:hasRoleAssignmentTemplate ?rtmpl } } bind(coalesce(?rn1, ?rl1, ?rt1) as ?rlbl) optional { { graph npa:spacesGraph { ?roleDecl gen:hasRegularProperty ?prop } } union { graph npa:spacesGraph { ?roleDecl gen:hasInverseProperty ?prop } } } } optional { graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpaceRef ?spaceRef ; npa:forAgent ?member . } optional { graph ?g { ?ri (npa:regularProperty|npa:inverseProperty) ?riPropS } } optional { graph npa:spacesGraph { ?ri (npa:regularProperty|npa:inverseProperty) ?riPropX } } bind(coalesce(?riPropS, ?riPropX) as ?riProp) filter(bound(?prop) && ?riProp = ?prop) } } group by ?role ?sortkey order by ?sortkey desc(max(?dateX)) Lists the sub-spaces of a given space ref (space IRI + root definition) with their type and a link to the source nanopublication. Type and label come from each sub-space's root-definition assertion; sub-spaces whose definitions are all retracted or otherwise invalidated are filtered out. Ordered alphabetically by label. Pass the ref's root nanopub (root_np); the query resolves the ref via npa:rootNanopub and scopes the sub-space edges by the ref-level npa:hasSubSpace (subject = the ref), so it shows only that one ref's sub-spaces rather than merging all refs claiming the IRI. Ref-scoped variant of list-sub-spaces (which is IRI-keyed via npa:hasSubSpace on the space IRI). List sub-spaces of a space (ref-scoped) prefix np: <http://www.nanopub.org/nschema#> prefix npx: <http://purl.org/nanopub/x/> prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> select ?subspace ?subspace_label ?type ?np ("^" as ?np_label) where { { select ?subspace (sample(?label) as ?subspace_label) (coalesce(sample(?typeName), "") as ?type) (sample(?rootNp) as ?np) where { values ?_root_np_multi_iri {} graph npa:spacesGraph { ?spaceRef npa:rootNanopub ?_root_np_multi_iri . } graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?spaceRef npa:hasSubSpace ?subspaceRef . } graph npa:spacesGraph { ?subspaceRef npa:spaceIri ?subspace ; npa:rootNanopub ?rootNp . } graph ?ag { ?subspace a gen:Space ; rdfs:label ?label . optional { ?subspace a ?typeIri . filter(?typeIri != gen:Space) } } graph npa:graph { ?defNp np:hasAssertion ?ag ; npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?inv npx:invalidates ?defNp ; npa:hasValidSignatureForPublicKey ?pubkey . } } bind(if(bound(?typeIri), strafter(str(?typeIri), "terms/"), "") as ?typeName) } group by ?subspace } } order by lcase(str(?subspace_label)) Returns the public key hashes of the admins of a given space ref (space IRI + root definition), not merged across refs. Pass the ref's root nanopub (root_np); the query resolves the ref via npa:rootNanopub and returns, for each trust-state-validated admin RoleInstantiation (npa:inverseProperty gen:hasAdmin) scoped to that ref (npa:forSpaceRef), the admin agent and each of its AccountState pubkey hashes. Ref-scoped variant of get-space-admin-pubkey-hashes (which is IRI-keyed via npa:forSpace and merges all refs of an IRI). Get space admin pubkey hashes (ref-scoped) prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?agent ?pkh where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } values ?_root_np_multi_iri {} graph npa:spacesGraph { ?ref npa:rootNanopub ?_root_np_multi_iri . } graph ?g { ?ri a gen:RoleInstantiation ; npa:inverseProperty gen:hasAdmin ; npa:forSpaceRef ?ref ; npa:forAgent ?agent . ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?pkh . } } Lists the observers of a given space ref (space IRI + root definition): agents holding an observer-tier role and no validated admin/maintainer/member role. Pass the ref's root nanopub (root_np); the query resolves the ref via npa:rootNanopub and its space IRI. Unlike list-space-observers (which reads only the validated current-state graph), this also includes self-declared observers whose key is not trust-validated (no accepted introduction): such rows carry a warning marker in the headerless ?unverified_noheader column. The role label is pinned to the role the space actually assigned (via its RoleAssignment), so it is correct even when several role declarations share a property. Ref-scoped and shows un-introduced observers rather than hiding them. List space observers (ref-scoped, with validation flag) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix schema: <http://schema.org/> select ?member (group_concat(distinct ?grantNp; separator=" ") as ?role_assignments_multi_iri) (group_concat(distinct ?roleLabel; separator="\n") as ?role_assignments_label_multi) (if(max(?val) = 0, "⚠️", "") as ?unverified_noheader) where { values ?_root_np_multi_iri {} graph npa:spacesGraph { ?ref npa:rootNanopub ?_root_np_multi_iri ; npa:spaceIri ?spaceIri . } graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph npa:spacesGraph { ?ri a gen:RoleInstantiation ; npa:forSpace ?spaceIri ; npa:forAgent ?member ; npa:viaNanopub ?grantNp ; (npa:regularProperty|npa:inverseProperty) ?roleProp . } filter exists { graph npa:spacesGraph { ?rdf a npa:RoleDeclaration ; npa:hasRoleType gen:ObserverRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp } } filter not exists { graph npa:graph { ?invNp npx:invalidates ?grantNp . } } filter not exists { graph ?g { ?hri npa:forSpaceRef ?ref ; npa:forAgent ?member ; (npa:regularProperty|npa:inverseProperty) ?hp . } graph npa:spacesGraph { ?hrd a npa:RoleDeclaration ; (gen:hasRegularProperty|gen:hasInverseProperty) ?hp . { ?hrd npa:hasRoleType gen:MemberRole } union { ?hrd npa:hasRoleType gen:MaintainerRole } } } filter not exists { graph ?g { ?ari npa:forSpaceRef ?ref ; npa:forAgent ?member ; npa:inverseProperty gen:hasAdmin . } } bind(if(exists { graph ?g { ?vri npa:forSpaceRef ?ref ; npa:forAgent ?member ; npa:viaNanopub ?grantNp } }, 1, 0) as ?val) optional { graph ?g { ?raRole a gen:RoleAssignment ; npa:forSpaceRef ?ref ; gen:hasRole ?role . } graph npa:spacesGraph { ?rd2 a npa:RoleDeclaration ; npa:role ?role ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp ; npa:viaNanopub ?roleNp . } graph npa:graph { ?roleNp np:hasAssertion ?role_a . } optional { graph ?role_a { ?role schema:name ?rlS } } optional { graph ?role_a { ?role rdfs:label ?rlA } } optional { graph ?role_a { ?role dct:title ?rlB } } bind(coalesce(?rlS, ?rlA, ?rlB) as ?rl) } bind(coalesce(?rl, "role") as ?roleLabel) } group by ?member order by ?unverified_noheader ?member Lists the observers of a given space ref (space IRI + root definition): agents holding an observer-tier role and no validated admin/maintainer/member role. Pass the ref's root nanopub (root_np); the query resolves the ref via npa:rootNanopub and its space IRI. Unlike list-space-observers (which reads only the validated current-state graph), this also includes self-declared observers whose key is not trust-validated (no accepted introduction): such rows carry a warning marker in the headerless ?unverified_noheader column. Ref-scoped and shows un-introduced observers rather than hiding them. List space observers (ref-scoped, with validation flag) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix schema: <http://schema.org/> select ?member (group_concat(distinct ?grantNp; separator=" ") as ?role_assignments_multi_iri) (group_concat(distinct ?roleLabel; separator="\n") as ?role_assignments_label_multi) (if(max(?val) = 0, "⚠️", "") as ?unverified_noheader) where { values ?_root_np_multi_iri {} graph npa:spacesGraph { ?ref npa:rootNanopub ?_root_np_multi_iri ; npa:spaceIri ?spaceIri . } graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph npa:spacesGraph { ?ri a gen:RoleInstantiation ; npa:forSpace ?spaceIri ; npa:forAgent ?member ; npa:viaNanopub ?grantNp ; (npa:regularProperty|npa:inverseProperty) ?roleProp . ?rd a npa:RoleDeclaration ; npa:hasRoleType gen:ObserverRole ; (gen:hasRegularProperty|gen:hasInverseProperty) ?roleProp ; npa:viaNanopub ?roleNp ; npa:role ?role . } filter not exists { graph npa:graph { ?invNp npx:invalidates ?grantNp . } } filter not exists { graph ?g { ?hri npa:forSpaceRef ?ref ; npa:forAgent ?member ; (npa:regularProperty|npa:inverseProperty) ?hp . } graph npa:spacesGraph { ?hrd a npa:RoleDeclaration ; (gen:hasRegularProperty|gen:hasInverseProperty) ?hp . { ?hrd npa:hasRoleType gen:MemberRole } union { ?hrd npa:hasRoleType gen:MaintainerRole } } } filter not exists { graph ?g { ?ari npa:forSpaceRef ?ref ; npa:forAgent ?member ; npa:inverseProperty gen:hasAdmin . } } bind(if(exists { graph ?g { ?vri npa:forSpaceRef ?ref ; npa:forAgent ?member ; npa:viaNanopub ?grantNp } }, 1, 0) as ?val) graph npa:graph { ?roleNp np:hasAssertion ?role_a . } optional { graph ?role_a { ?role schema:name ?rlS } } optional { graph ?role_a { ?role rdfs:label ?rlA } } optional { graph ?role_a { ?role dct:title ?rlB } } bind(coalesce(?rlS, ?rlA, ?rlB, "role") as ?roleLabel) } group by ?member order by ?unverified_noheader ?member Returns the roles assigned within a given space ref (space IRI + root definition), not merged across refs. Pass the ref's root nanopub (root_np); the query resolves the ref via npa:rootNanopub and returns the RoleAssignments scoped to that ref (npa:forSpaceRef) from the current space-state graph (/repo/spaces), joined to each role's declaration (labels, regular/inverse properties, role type) from the spaces graph. Ref-scoped variant of get-space-roles (which is IRI-keyed via npa:forSpace and merges all refs of an IRI). Get space roles (ref-scoped) prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix schema: <http://schema.org/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?role ?roleLabel ?roleName ?roleTitle ?roleAssignmentTemplate ?roleType (group_concat(distinct ?reg; separator=" ") as ?regularProperties) (group_concat(distinct ?inv; separator=" ") as ?inverseProperties) ?ra_np where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } values ?_root_np_multi_iri {} graph npa:spacesGraph { ?ref npa:rootNanopub ?_root_np_multi_iri . } graph ?g { ?ra a gen:RoleAssignment ; npa:forSpaceRef ?ref ; gen:hasRole ?role ; npa:viaNanopub ?ra_np . } graph npa:spacesGraph { ?roleDecl a npa:RoleDeclaration ; npa:role ?role ; npa:viaNanopub ?role_np . optional { ?roleDecl gen:hasRegularProperty ?reg } optional { ?roleDecl gen:hasInverseProperty ?inv } optional { ?roleDecl npa:hasRoleType ?roleType } } graph npa:graph { ?role_np np:hasAssertion ?role_a . } optional { graph ?role_a { ?role rdfs:label ?roleLabel } } optional { graph ?role_a { ?role dct:title ?roleTitle } } optional { graph ?role_a { ?role schema:name ?roleName } } optional { graph ?role_a { ?role gen:hasRoleAssignmentTemplate ?roleAssignmentTemplate } } } group by ?role ?roleLabel ?roleName ?roleTitle ?roleAssignmentTemplate ?roleType ?ra_np Returns the admins of a given space ref (space IRI + root definition), not merged across refs. Pass the ref's root nanopub (root_np); the query resolves the ref via npa:rootNanopub and returns the trust-state-validated admin RoleInstantiations (npa:inverseProperty gen:hasAdmin) scoped to that ref from the current space-state graph (/repo/spaces), with each admin agent and the instantiating nanopublication. Ref-scoped variant of get-space-admins (which is IRI-keyed via npa:forSpace and merges all refs of an IRI). Get space admins (ref-scoped) prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?agent ?np ("^" as ?np_label) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } values ?_root_np_multi_iri {} graph npa:spacesGraph { ?ref npa:rootNanopub ?_root_np_multi_iri . } graph ?g { ?ri a gen:RoleInstantiation ; npa:inverseProperty gen:hasAdmin ; npa:forSpaceRef ?ref ; npa:forAgent ?agent ; npa:viaNanopub ?np . } } Key-value Info table for a PART. Finds the part's latest defining nanopub (npx:introduces/describes/embeds the part 'partid', signed by an owning-resource member pubkey 'pubkey', not invalidated) and shows Type (rdf:type), Subclass of (rdfs:subClassOf), Part of (the owning resource 'context', via dct:partOf), and Defined in (the defining nanopub, labelled by a shortened artifact code, linking to the nanopub). Type and Subclass-of allow multiple values (one row each). Get part info prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?Property_noheader ?Property_label ?Value_noheader ?Value_label where { values ?__pubkey_multi {} graph npa:graph { ?dnp npa:hasValidSignatureForPublicKeyHash ?__pubkey_multi ; (npx:introduces|npx:describes|npx:embeds) ?_partid_iri ; dct:created ?ddate ; np:hasAssertion ?da . filter not exists { ?inv npx:invalidates ?dnp ; npa:hasValidSignatureForPublicKeyHash ?__pubkey_multi . } filter not exists { ?dnp2 npa:hasValidSignatureForPublicKeyHash ?pk2 ; (npx:introduces|npx:describes|npx:embeds) ?_partid_iri ; dct:created ?ddate2 . filter not exists { ?inv2 npx:invalidates ?dnp2 ; npa:hasValidSignatureForPublicKeyHash ?pk2 . } filter(?ddate2 > ?ddate) } } optional { graph ?da { ?_partid_iri a ?typeIri . } } optional { graph ?da { ?_partid_iri rdfs:subClassOf ?superClass . } } bind(substr(replace(str(?dnp), "^.*/np/", ""), 1, 10) as ?npCode) values (?key ?Property_noheader ?Property_label ?ord) { ('Type' rdf:type 'Type:' 1) ('Subclass of' rdfs:subClassOf 'Subclass of:' 2) ('Belongs to' dct:partOf 'Part of:' 3) ('Defined in' 'Defined in:' 'Defined in:' 4) } bind(if(?key = 'Type', ?typeIri, if(?key = 'Subclass of', ?superClass, if(?key = 'Belongs to', ?_context_iri, ?dnp))) as ?Value_noheader) filter(bound(?Value_noheader)) bind(if(?key = 'Type', replace(str(?typeIri), '^.*[/#]', ''), if(?key = 'Subclass of', replace(str(?superClass), '^.*[/#]', ''), if(?key = 'Belongs to', replace(str(?_context_iri), '^.*[/#]', ''), ?npCode))) as ?Value_label) } order by ?ord Lists, for a PART page, the view displays configured on the part's owning resource, flagged (shown_here) for this specific part (read-only-ish; one row per resolved view, latest kept). Auth + display set keyed on the owning resource ('resource'); shown_here via the part's classes ('partclass'), gen:appliesTo the part, or namespace over 'partid'. hasTopLevelView presets never shown on a part; hasView presets fall back to the view's targeting. Ordered shown-here first, then by structural position. List part view displays prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?view (sample(?view_label) as ?view_label) (sample(?shown_here) as ?shown_here) (sample(?position) as ?position) (sample(?via_preset) as ?via_preset) (sample(?via_preset_label) as ?via_preset_label) (sample(?added_by) as ?added_by) (max(?date_added) as ?date_added) (iri(strafter(max(concat(str(?date_added), "\t", str(?np))), "\t")) as ?np) ("^" as ?np_label) where { select ?view ?view_label ?shown_here ?position (if(?shown_here = "", ?target_multi_iri_raw, "") as ?target_multi_iri) (if(?shown_here = "", ?target_label_multi_raw, "") as ?target_label_multi) ?via_preset ?via_preset_label ?added_by ?date_added ?np ?np_label where { select ?view ?view_label ?position (if(bound(?presetScope), ?presetScope, if(bound(?preset), if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), ""), if(?aDApplyHere > 0, "✓", if(?aDHasTarget > 0, if(?aDMatch > 0, "✓", ""), if(?aDHasApply > 0, "", if(?aVHasTarget > 0, if(?aVMatch > 0, "✓", ""), "")))))) as ?shown_here) ?target_multi_iri_raw ?target_label_multi_raw (?preset as ?via_preset) (?preset_label as ?via_preset_label) (?user as ?added_by) (?date as ?date_added) ?np ("^" as ?np_label) where { select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget) (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch) (group_concat(distinct ?targetIri; separator=" ") as ?target_multi_iri_raw) (group_concat(distinct ?targetLabel; separator="\n") as ?target_label_multi_raw) where { { select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np ?dApply ?dTarget ?vTarget where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } } { graph npa:graph { ?np npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?display ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?display gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . optional { values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay } ?display a ?displayMode . } optional { ?display gen:appliesTo ?dApply . } optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . } } } union { select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri { service <https://w3id.org/np/l/nanopub-query-1.1/repo/full> { graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?displayMode . } } filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { ?preset a gen:Preset . optional { ?preset rdfs:label ?preset_label . } { ?preset gen:hasTopLevelView ?viewRef . bind("" as ?presetScope) } union { ?preset gen:hasView ?viewRef } } } } } optional { graph npa:graph { ?np np:hasAssertion ?npAssertion . } graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . } } filter(!bound(?displayMode) || !contains(str(?displayMode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:ViewDisplay ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?display2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?display2 a gen:DeactivatedViewDisplay ; gen:isDisplayOfView ?viewRef ; gen:isDisplayFor ?_resource_multi_iri . } filter(?date2 > ?date) } optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/type/ec6722efa3b44e0a18aa63afe5964158a1fdb7f0413ea5f23bfddf5c03ca0221> { graph npa:graph { ?vnp npx:embeds ?viewRef . } { select ?vnp (max(?hDate) as ?headDate) where { graph npa:networkGraph { ?h (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?k . ?h npa:hasValidSignatureForPublicKey ?k ; dct:created ?hDate . filter not exists { ?i npx:invalidates ?h ; npa:hasValidSignatureForPublicKey ?k . } } } group by ?vnp } graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . } graph npa:graph { ?vnp npa:hasValidSignatureForPublicKey ?vKey . ?headNp npa:hasValidSignatureForPublicKey ?vKey ; dct:created ?headDate ; npx:embeds ?viewLatest ; np:hasAssertion ?hva . filter not exists { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKey ?vKey . } } graph ?hva { ?viewLatest dct:title ?view_label . } optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } } optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } } } } bind(coalesce(?dispPos, ?viewPos, "") as ?position) } } values ?__partclass_multi_iri {} bind(if(coalesce(str(?dApply) = str(?_partid_iri), false), 1, 0) as ?fDApplyHere) bind(if(bound(?dApply), 1, 0) as ?fDHasApply) bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget) bind(if(coalesce(?dTarget = ?__partclass_multi_iri, false) || coalesce(strstarts(str(?_partid_iri), str(?dTarget)), false), 1, 0) as ?fDMatch) bind(if(bound(?vTarget), 1, 0) as ?fVHasTarget) bind(if(coalesce(?vTarget = ?__partclass_multi_iri, false) || coalesce(strstarts(str(?_partid_iri), str(?vTarget)), false), 1, 0) as ?fVMatch) bind(coalesce(?dTarget, ?vTarget) as ?targetIri) bind(replace(str(?targetIri), "^.*[/#]", "") as ?targetLocalName) bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel) bind(coalesce(?viewLatest, ?viewRef) as ?view) } group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np } } } group by ?view order by desc(?shown_here) ?position Lists the roles assigned in a given space as a table: each role (linked, labelled by its schema:name, falling back to its label/title), its tier (Admin/Maintainer/Member/Observer), a count of how many distinct users of the space hold that role, the contributing preset (via_preset, for roles carried by a preset assignment — resolved from the validated role-attachment's npa:derivedFromPreset marker), who added it, and the date. The built-in Admin role is always included as the first row. Also returns the role-assignment template (for the assign-user action) and the source nanopublication. List space roles prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix schema: <http://schema.org/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?role (sample(?rlbl) as ?role_label) (sample(?rtier) as ?tier) (count(distinct ?member) as ?users) (sample(?presetX) as ?via_preset) (sample(?presetXlbl) as ?via_preset_label) (sample(?userX) as ?added_by) (max(?dateX) as ?date_added) (sample(?rtmpl) as ?roleAssignmentTemplate) (sample(?npX) as ?np) where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } values ?_space_multi_iri {} { bind(<https://w3id.org/np/RA_eEJjQbxzSqYSwPzfjzOZi5sMPpUmHskFNsgJYSws8I/adminRole> as ?role) bind(0 as ?sortkey) bind("admin" as ?rlbl) bind("Admin" as ?rtier) bind(<https://w3id.org/np/RAsOQ7k3GNnuUqZuLm57PWwWopQJR_4onnCpNR457CZg8> as ?rtmpl) bind(gen:hasAdmin as ?prop) } union { graph ?g { ?ra a gen:RoleAssignment ; npa:forSpace ?_space_multi_iri ; gen:hasRole ?role ; npa:viaNanopub ?npX . } graph npa:graph { ?npX dct:created ?dateX . } optional { graph npa:graph { ?npX npx:signedBy ?userX . } } bind(1 as ?sortkey) optional { graph ?g { ?ra npa:derivedFromPreset ?assignNp . } graph npa:spacesGraph { ?paRow a npa:PresetAssignment ; npa:viaNanopub ?assignNp ; npa:ofPreset ?presetX . } optional { graph npa:graph { ?presetNp npx:embeds ?presetX ; np:hasAssertion ?paX . } graph ?paX { ?presetX rdfs:label ?presetXlbl . } } } graph npa:spacesGraph { ?roleDecl a npa:RoleDeclaration ; npa:role ?role ; npa:viaNanopub ?role_np . } bind(exists { graph npa:spacesGraph { ?roleDecl npa:hasRoleType gen:MaintainerRole } } as ?isMaintainer) bind(exists { graph npa:spacesGraph { ?roleDecl npa:hasRoleType gen:MemberRole } } as ?isMember) bind(if(?isMaintainer,"Maintainer",if(?isMember,"Member","Observer")) as ?rtier) graph npa:graph { ?role_np np:hasAssertion ?role_a . } optional { graph ?role_a { ?role rdfs:label ?rl1 } } optional { graph ?role_a { ?role dct:title ?rt1 } } optional { graph ?role_a { ?role schema:name ?rn1 } } optional { graph ?role_a { ?role gen:hasRoleAssignmentTemplate ?rtmpl } } bind(coalesce(?rn1, ?rl1, ?rt1) as ?rlbl) optional { { graph npa:spacesGraph { ?roleDecl gen:hasRegularProperty ?prop } } union { graph npa:spacesGraph { ?roleDecl gen:hasInverseProperty ?prop } } } } optional { graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?member . } optional { graph ?g { ?ri (npa:regularProperty|npa:inverseProperty) ?riPropS } } optional { graph npa:spacesGraph { ?ri (npa:regularProperty|npa:inverseProperty) ?riPropX } } bind(coalesce(?riPropS, ?riPropX) as ?riProp) filter(bound(?prop) && ?riProp = ?prop) } } group by ?role ?sortkey order by ?sortkey desc(max(?dateX)) 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: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix dct: <http://purl.org/dc/terms/> prefix fip: <https://w3id.org/fair/fip/terms/> prefix prov: <http://www.w3.org/ns/prov#> select 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 { graph npa:graph { <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> npa:hasValidSignatureForPublicKey ?curators_np_pk . ?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk . filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . } ?latest_curators_np np:hasAssertion ?latest_curators_assertion . } graph npa:networkGraph { ?latest_curators_np (npx:supersedes)* <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> . filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np } } graph npa:graph { ?np npx:hasNanopubType ?__type_iri . ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?retraction npx:retracts ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?newversion npx:supersedes ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np (npx:introduces|npx:describes) ?thing . ?np rdfs:label ?label . optional { ?np dct:description ?description . } ?np dct:created ?date . filter(str(?date) > "2022") } bind(concat(" ",lcase(str(?label))," ",lcase(coalesce(str(?description),""))," ") as ?text) filter( contains(?text, lcase(str(?_searchterm))) ) optional { graph npa:graph { ?disapproval npa:hasValidSignatureForPublicKey ?dpubkey . } graph ?latest_curators_assertion { ?dpubkeys npx:hasPublicKey ?dpubkey . } graph npa:graph { filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . } ?disapproval np:hasAssertion ?da . } graph ?da { ?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np . } } filter(!bound(?disapproval)) # Faster than "filter not exists" for some reason optional { graph npa:graph { ?recommendation_np npx:hasNanopubType fip:recommended-by . ?recommendation_np npa:hasValidSignatureForPublicKey ?rpubkey . filter not exists { ?recommendation_np_x npx:invalidates ?recommendation_np ; npa:hasValidSignatureForPublicKey ?rpubkey . } ?recommendation_np np:hasAssertion ?ra . ?recommendation_np np:hasProvenance ?rp . } graph ?ra { ?thing fip:recommended-by ?recommender . } graph ?rp { ?ra prov:wasDerivedFrom ?rfip_np . } graph npa:graph { ?rfip_np npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile . ?rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey . ?latest_rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey . filter not exists { ?latest_rfip_npx npx:invalidates ?latest_rfip_np ; npa:hasValidSignatureForPublicKey ?rfip_pubkey . } } graph npa:networkGraph { ?latest_rfip_np (npx:supersedes)* ?rfip_np . } graph ?rfip_qa { ?rfip_qualifier npx:qualifies ?latest_rfip_np . } graph npa:graph { ?rfip_qualification_np np:hasAssertion ?rfip_qa . ?rfip_qualification_np npx:hasNanopubType npx:qualifies . ?rfip_qualification_np npa:hasValidSignatureForPublicKey ?rfip_qpubkey . filter not exists { ?rfip_qualification_np_x npx:invalidates ?rfip_qualification_np ; npa:hasValidSignatureForPublicKey ?rfip_qpubkey . } } graph ?latest_curators_assertion { ?rfip_qpubkeys npx:hasPublicKey ?rfip_qpubkey . } } optional { graph npa:graph { ?qualification_np npx:hasNanopubType npx:qualifies . ?qualification_np npa:hasValidSignatureForPublicKey ?qpubkey . } graph ?latest_curators_assertion { ?qpubkeys npx:hasPublicKey ?qpubkey . } graph npa:graph { filter not exists { ?qualification_np_x npx:invalidates ?qualification_np ; npa:hasValidSignatureForPublicKey ?qpubkey . } ?qualification_np np:hasAssertion ?qa . } graph ?qa { ?qualifier npx:qualifies ?np . } } optional { graph npa:graph { ?fairAssessmentLevelNp npx:hasNanopubType fip:has-FAIR-assessment . ?fairAssessmentLevelNp npa:hasValidSignatureForPublicKey ?lpubkey . } graph ?latest_curators_assertion { ?lpubkeys npx:hasPublicKey ?lpubkey . } graph npa:graph { filter not exists { ?fairAssessmentLevelNp_x npx:invalidates ?fairAssessmentLevelNp ; npa:hasValidSignatureForPublicKey ?lpubkey . } ?fairAssessmentLevelNp np:hasAssertion ?la . } graph ?la { ?thing fip:has-FAIR-assessment ?fairAssessmentLevel . } } filter(!bound(?levelNp)) # Faster than "filter not exists" for some reason } group by ?thing ?label ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np order by desc(?recommender_count) asc(?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: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix dct: <http://purl.org/dc/terms/> prefix prov: <http://www.w3.org/ns/prov#> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix tpff: <https://w3id.org/fair/3pff/> prefix schema: <http://schema.org/> select (concat("<span><a href=\"", str(?event), "\" target=\"_blank\">", str(?eventShortName), "</a></span>") as ?Event_ID) (?eventLongName as ?Event_Name) (?eventDate as ?Date) (concat("<span>", group_concat(distinct concat( "<a href=\"", str(?eventOrganizer), "\">", coalesce(?eventOrganizerName, replace(str(?eventOrganizer), "^.*[/#]", "")), "</a>" ); separator=", "), "</span>") as ?Organizers) (concat("<span>", group_concat(distinct concat( "<a href=\"", str(?eventFacilitator), "\">", coalesce(?eventFacilitatorName, replace(str(?eventFacilitator), "^.*[/#]", "")), "</a>" ); separator=", "), "</span>") as ?Facilitators) (concat("<span>", group_concat(distinct concat( "<a href=\"", str(?eventMoreInfoLink), "\">", replace(str(?eventMoreInfoLink), "^.*[/#]", ""), "</a>" ); separator=", "), "</span>") as ?More_Info) (?np as ?Source) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?npDate . ?np dct:creator ?npCreator . ?np np:hasAssertion ?assertion . ?np npx:introduces ?event . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?event a tpff:3PFF-event . ?event rdfs:label ?eventName . # Date Handling: Check for both predicates optional { ?event dct:date ?dateDct . } optional { ?event schema:startDate ?dateSchema . } bind(coalesce(?dateDct, strBefore(str(?dateSchema), "T")) as ?eventDate) bind(replace(str(?eventName), ' ?\\|.*$', '') as ?eventShortName) bind(replace(str(?eventName), '^([A-Z0-9]{2,3}).*$', '$1') as ?eventSeries) bind(replace(str(?eventName), '^.*\\| ?(.*)$', '$1') as ?eventLongName) optional { ?event tpff:has-event-organizer ?eventOrganizer . optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentTrustState ?organizerTrustState . } graph ?organizerTrustState { ?eventOrganizer foaf:name ?eventOrganizerName . } } } } optional { ?event tpff:has-event-facilitator ?eventFacilitator . optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentTrustState ?facilitatorTrustState . } graph ?facilitatorTrustState { ?eventFacilitator foaf:name ?eventFacilitatorName . } } } } optional { ?event rdfs:seeAlso ?eventMoreInfoLink . } } } group by ?event ?eventShortName ?eventLongName ?eventDate ?np order by desc(?eventDate) 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: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix dct: <http://purl.org/dc/terms/> prefix fip: <https://w3id.org/fair/fip/terms/> prefix prov: <http://www.w3.org/ns/prov#> select 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 { graph npa:graph { <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> npa:hasValidSignatureForPublicKey ?curators_np_pk . ?latest_curators_np npa:hasValidSignatureForPublicKey ?curators_np_pk . filter not exists { ?latest_curators_npx npx:invalidates ?latest_curators_np ; npa:hasValidSignatureForPublicKey ?curators_np_pk . } ?latest_curators_np np:hasAssertion ?latest_curators_assertion . } graph npa:networkGraph { ?latest_curators_np (npx:supersedes)* <https://w3id.org/np/RA27Uhopq4MHZziL2lKXX-wTb1jz4KVLbHaupxyAcCt9Y> . filter not exists { ?latest_curators_npxx npx:supersedes ?latest_curators_np } } graph npa:graph { ?np npx:hasNanopubType ?__type_iri . ?np npa:hasValidSignatureForPublicKey ?pubkey . optional { ?retraction npx:retracts ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } optional { ?newversion npx:supersedes ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np (npx:introduces|npx:describes) ?thing . ?np rdfs:label ?label . optional { ?np dct:description ?description . } ?np dct:created ?date . filter(str(?date) > "2022") } bind(concat(" ",lcase(str(?label))," ",lcase(coalesce(str(?description),""))," ") as ?text) filter( contains(?text, lcase(str(?_searchterm))) ) optional { graph npa:graph { ?disapproval npa:hasValidSignatureForPublicKey ?dpubkey . } graph ?latest_curators_assertion { ?dpubkeys npx:hasPublicKey ?dpubkey . } graph npa:graph { filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . } ?disapproval np:hasAssertion ?da . } graph ?da { ?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np . } } filter(!bound(?disapproval)) # Faster than "filter not exists" for some reason optional { graph npa:graph { ?recommendation_np npx:hasNanopubType fip:recommended-by . ?recommendation_np npa:hasValidSignatureForPublicKey ?rpubkey . filter not exists { ?recommendation_np_x npx:invalidates ?recommendation_np ; npa:hasValidSignatureForPublicKey ?rpubkey . } ?recommendation_np np:hasAssertion ?ra . ?recommendation_np np:hasProvenance ?rp . } graph ?ra { ?thing fip:recommended-by ?recommender . } graph ?rp { ?ra prov:wasDerivedFrom ?rfip_np . } graph npa:graph { ?rfip_np npx:hasNanopubType fip:Reference-FAIR-Implementation-Profile . ?rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey . ?latest_rfip_np npa:hasValidSignatureForPublicKey ?rfip_pubkey . filter not exists { ?latest_rfip_npx npx:invalidates ?latest_rfip_np ; npa:hasValidSignatureForPublicKey ?rfip_pubkey . } } graph npa:networkGraph { ?latest_rfip_np (npx:supersedes)* ?rfip_np . } graph ?rfip_qa { ?rfip_qualifier npx:qualifies ?latest_rfip_np . } graph npa:graph { ?rfip_qualification_np np:hasAssertion ?rfip_qa . ?rfip_qualification_np npx:hasNanopubType npx:qualifies . ?rfip_qualification_np npa:hasValidSignatureForPublicKey ?rfip_qpubkey . filter not exists { ?rfip_qualification_np_x npx:invalidates ?rfip_qualification_np ; npa:hasValidSignatureForPublicKey ?rfip_qpubkey . } } graph ?latest_curators_assertion { ?rfip_qpubkeys npx:hasPublicKey ?rfip_qpubkey . } } optional { graph npa:graph { ?qualification_np npx:hasNanopubType npx:qualifies . ?qualification_np npa:hasValidSignatureForPublicKey ?qpubkey . } graph ?latest_curators_assertion { ?qpubkeys npx:hasPublicKey ?qpubkey . } graph npa:graph { filter not exists { ?qualification_np_x npx:invalidates ?qualification_np ; npa:hasValidSignatureForPublicKey ?qpubkey . } ?qualification_np np:hasAssertion ?qa . } graph ?qa { ?qualifier npx:qualifies ?np . } } optional { graph npa:graph { ?fairAssessmentLevelNp npx:hasNanopubType fip:has-FAIR-assessment . ?fairAssessmentLevelNp npa:hasValidSignatureForPublicKey ?lpubkey . } graph ?latest_curators_assertion { ?lpubkeys npx:hasPublicKey ?lpubkey . } graph npa:graph { filter not exists { ?fairAssessmentLevelNp_x npx:invalidates ?fairAssessmentLevelNp ; npa:hasValidSignatureForPublicKey ?lpubkey . } ?fairAssessmentLevelNp np:hasAssertion ?la . } graph ?la { ?thing fip:has-FAIR-assessment ?fairAssessmentLevel . } } filter(!bound(?levelNp)) # Faster than "filter not exists" for some reason } group by ?thing ?label ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np order by desc(?recommender_count) asc(?label) Nanopublications which advertise that they're trying to assist Iolanta visualizations of other pieces of Linked Data. List Iolanta visualizations prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix iolanta: <https://iolanta.tech/> select distinct ?np ?label ?visualized ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey ; np:hasAssertion ?assertion ; np:hasProvenance ?provenance ; dct:created ?date . optional { ?np rdfs:label ?label . } filter not exists { ?invalidator npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?newer npx:supersedes ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:retracts . } } graph ?provenance { ?assertion iolanta:visualizes ?visualized . } } order by desc(?date) Lists the currently active 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; deactivated assignments (and assignments with a newer deactivation for the same pair) are excluded. Shows each assigned preset, who added it, the date, and the source nanopub. The deactivatePreset column feeds the per-row deactivate action. List preset assignments prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?preset ?preset_label (str(?preset) as ?deactivatePreset) (?user as ?added_by) (?date as ?date_added) ?np ("^" as ?np_label) where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } { graph ?stateG { ?_resource_multi_iri npa:isMaintainedBy? ?space . ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?authAgent ; (npa:inverseProperty|npa:regularProperty) ?roleProp . ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey . } optional { graph npa:spacesGraph { ?rd a npa:RoleDeclaration ; npa:forSpace ?space ; npa:hasRoleType gen:MaintainerRole ; (npa:inverseProperty|npa:regularProperty) ?roleProp . bind(true as ?isMaintainer) } } filter(?roleProp = gen:hasAdmin || bound(?isMaintainer)) } union { graph ?stateG { ?selfAcct a npa:AccountState ; npa:agent ?_resource_multi_iri ; npa:pubkey ?pubkey . } } } graph npa:graph { ?np npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; dct:created ?date ; npx:embeds ?assignment ; np:hasAssertion ?a . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } optional { ?np npx:signedBy ?user } } graph ?a { ?assignment gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . optional { values ?mode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment } ?assignment a ?mode . } } filter(!bound(?mode) || !contains(str(?mode), "Deactivated")) filter not exists { graph npa:graph { ?np2 npx:hasNanopubType gen:PresetAssignment ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 ; dct:created ?date2 ; npx:embeds ?assignment2 ; np:hasAssertion ?a2 . filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . } } graph ?a2 { ?assignment2 a gen:DeactivatedPresetAssignment ; gen:isAssignmentFor ?_resource_multi_iri ; gen:isAssignmentOfPreset ?preset . } filter(?date2 > ?date) } optional { graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . } graph ?pa { optional { ?preset rdfs:label ?preset_label . } } } } order by desc(?date) Returns the events related to the Three Point FAIRification Framework (3PFF) that are connected to a given Space: events that name the Space or one of its alternative IDs as participating community or as event sponsor. Intended as a view query for Space pages, with the optional multi-value 'space' parameter bound to the Space IRI and its owl:sameAs alternative IDs. Without parameter values, all 3PFF events are returned. One row per event with date and facilitators (facilitator names resolved from the trust repository, falling back to the URI's local name). Get 3PFF events for Space prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix tpff: <https://w3id.org/fair/3pff/> prefix schema: <http://schema.org/> select ?Event (max(?eventShortName) as ?Event_label) (max(?eventLongName) as ?Name) (max(?eventDate) as ?Date) (group_concat(distinct str(?eventFacilitator); separator=" ") as ?Facilitators_multi_iri) (group_concat(distinct replace(replace(coalesce(?eventFacilitatorName, replace(str(?eventFacilitator), "^.*[/#]", "")), "\\\\", "\\\\\\\\"), "[\\r\\n]+", "\\\\n"); separator="\n") as ?Facilitators_label_multi) (sample(?np0) as ?np) ("^" as ?np_label) where { values ?__space_multi_iri {} graph npa:graph { ?np0 npa:hasValidSignatureForPublicKey ?pubkey . ?np0 np:hasAssertion ?assertion . ?np0 npx:introduces ?Event . filter not exists { ?npx npx:invalidates ?np0 ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?Event a tpff:3PFF-event . { ?Event tpff:has-participating-community ?__space_multi_iri . } union { ?Event tpff:has-event-sponsor ?__space_multi_iri . } ?Event rdfs:label ?eventName . optional { ?Event dct:date ?dateDct . } optional { ?Event schema:startDate ?dateSchema . } bind(coalesce(?dateDct, strBefore(str(?dateSchema), "T")) as ?eventDate) bind(replace(str(?eventName), ' ?\\|.*$', '') as ?eventShortName) bind(replace(str(?eventName), '^.*\\| ?(.*)$', '$1') as ?eventLongName) optional { ?Event tpff:has-event-facilitator ?eventFacilitator . optional { service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentTrustState ?trustState . } graph ?trustState { ?eventFacilitator foaf:name ?eventFacilitatorName . } } } } } } group by ?Event order 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 definition assertion; resources whose definitions are all retracted or otherwise invalidated are filtered out. Ordered alphabetically by label. List maintained resources of a space prefix np: <http://www.nanopub.org/nschema#> prefix npx: <http://purl.org/nanopub/x/> prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> select ?resource ?resource_label ?np ("^" as ?np_label) where { { select ?resource (sample(?label) as ?resource_label) (sample(?viaNp) as ?np) where { values ?_space_multi_iri {} graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?_space_multi_iri npa:hasMaintainedResource ?resource . } graph ?ag { ?resource a gen:MaintainedResource ; rdfs:label ?label . } graph npa:graph { ?defNp np:hasAssertion ?ag ; npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?inv npx:invalidates ?defNp ; npa:hasValidSignatureForPublicKey ?pubkey . } } optional { graph npa:spacesGraph { ?d a npa:MaintainedResourceDeclaration ; npa:resourceIri ?resource ; npa:maintainerSpace ?_space_multi_iri ; npa:viaNanopub ?viaNp } } } group by ?resource } } order by lcase(str(?resource_label)) 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; sub-spaces whose definitions are all retracted or otherwise invalidated are filtered out. Ordered alphabetically by label. List sub-spaces of a space prefix np: <http://www.nanopub.org/nschema#> prefix npx: <http://purl.org/nanopub/x/> prefix npa: <http://purl.org/nanopub/admin/> prefix gen: <https://w3id.org/kpxl/gen/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> select ?subspace ?subspace_label ?type ?np ("^" as ?np_label) where { { select ?subspace (sample(?label) as ?subspace_label) (coalesce(sample(?typeName), "") as ?type) (sample(?rootNp) as ?np) where { values ?_space_multi_iri {} graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } graph ?g { ?_space_multi_iri npa:hasSubSpace ?subspace . } graph ?ag { ?subspace a gen:Space ; rdfs:label ?label . optional { ?subspace a ?typeIri . filter(?typeIri != gen:Space) } } graph npa:graph { ?defNp np:hasAssertion ?ag ; npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?inv npx:invalidates ?defNp ; npa:hasValidSignatureForPublicKey ?pubkey . } } bind(if(bound(?typeIri), strafter(str(?typeIri), "terms/"), "") as ?typeName) optional { graph npa:spacesGraph { ?ref a npa:SpaceRef ; npa:spaceIri ?subspace ; npa:rootNanopub ?rootNp } } } group by ?subspace } } order 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: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?content ?np where { values ?_space_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?ri a gen:RoleInstantiation ; npa:inverseProperty gen:hasAdmin ; npa:forSpace ?_space_multi_iri ; npa:forAgent ?admin . ?acct a npa:AccountState ; npa:agent ?admin ; npa:pubkey ?pubkey . } } graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } ?np dct:created ?date ; np:hasAssertion ?a . } graph ?a { ?_space_multi_iri a gen:Space ; dct:description ?content . } } order by desc(?date) limit 1 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: <http://www.nanopub.org/nschema#> prefix npx: <http://purl.org/nanopub/x/> prefix npa: <http://purl.org/nanopub/admin/> prefix dct: <http://purl.org/dc/terms/> select (max(?date0) as ?date) (sample(str(?keyLocation)) as ?location) (group_concat(distinct ?keyAnnotated; separator=", ") as ?keys) ?np ("^" as ?np_label) (if(max(?isOwner) > 0 && max(?signedByLocal) > 0 && sum(?localDeclOk) > 0 && ?localCount > 1, str(?np), "") as ?retract_target) (if(max(?isOwner) > 0 && (max(?signedByLocal) = 0 || sum(?localDeclOk) = 0) && ?localCount = 0 && max(?lpkBound) > 0, str(?np), "") as ?derive_target) (sample(?lpk) as ?local_pubkey) (sample(?lpkShort) as ?local_pubkey_short) (sample(?siteUrl) as ?site_url) where { values ?__LOCALPUBKEY_multi {} values ?__SITEURL_multi {} values ?__CURRENTUSER_multi_iri {} graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?introPubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?introPubkey . } ?np dct:created ?date0 . ?np np:hasAssertion ?a . } graph ?a { ?keydeclaration npx:declaredBy ?_user_iri . ?keydeclaration npx:hasPublicKey ?pubkey . optional { ?keydeclaration npx:hasKeyLocation ?keyLocation . } bind(substr(sha256(?pubkey), 1, 10) as ?keyHash) bind(lcase(sha256(str(?pubkey))) as ?keyHashFull) } bind(if(exists { service <https://w3id.org/np/l/nanopub-query-1.1/repo/trust> { graph npa:graph { npa:thisRepo npa:hasCurrentTrustState ?tg . } graph ?tg { ?acct npa:agent ?_user_iri ; npa:pubkey ?keyHashFull ; npa:trustStatus npa:loaded . } } }, concat("✅ ", ?keyHash), concat("⚠️ ", ?keyHash)) as ?keyAnnotated) bind(coalesce(if(str(?pubkey) = str(?__LOCALPUBKEY_multi), 1, 0), 0) as ?isLocal) 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) bind(coalesce(if(str(?introPubkey) = str(?__LOCALPUBKEY_multi), 1, 0), 0) as ?signedByLocal) bind(if(bound(?__LOCALPUBKEY_multi), 1, 0) as ?lpkBound) bind(coalesce(if(?_user_iri = ?__CURRENTUSER_multi_iri, 1, 0), 0) as ?isOwner) bind(coalesce(str(?__LOCALPUBKEY_multi), "") as ?lpk) bind(if(strlen(?lpk) >= 45, concat(substr(?lpk, 1, 1), "..", substr(?lpk, 41, 5), ".."), "") as ?lpkShort) bind(coalesce(str(?__SITEURL_multi), "") as ?siteUrl) { select (count(distinct ?lnp) as ?localCount) where { values ?__LOCALPUBKEY_multi {} values ?__SITEURL_multi {} graph npa:graph { ?lnp npa:hasValidSignatureForPublicKey ?lsign . filter not exists { ?lnpx npx:invalidates ?lnp ; npa:hasValidSignatureForPublicKey ?lsign . } ?lnp np:hasAssertion ?la . } graph ?la { ?lkd npx:declaredBy ?_user_iri ; npx:hasPublicKey ?lpubkey . optional { ?lkd npx:hasKeyLocation ?lloc . } } filter(coalesce(str(?lsign) = str(?__LOCALPUBKEY_multi), false)) filter(coalesce(str(?lpubkey) = str(?__LOCALPUBKEY_multi), false)) filter(!bound(?lloc) || coalesce(str(?lloc) = str(?__SITEURL_multi), false) || coalesce(replace(str(?lloc), "nanobench", "nanodash") = str(?__SITEURL_multi), false)) } } } group by ?np ?localCount order 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: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix schema: <http://schema.org/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select ?role ?roleLabel ?roleName ?roleTitle ?roleAssignmentTemplate ?roleType (group_concat(distinct ?reg; separator=" ") as ?regularProperties) (group_concat(distinct ?inv; separator=" ") as ?inverseProperties) ?ra_np where { graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?g . } values ?_space_multi_iri {} graph ?g { ?ra a gen:RoleAssignment ; npa:forSpace ?_space_multi_iri ; gen:hasRole ?role ; npa:viaNanopub ?ra_np . } graph npa:spacesGraph { ?roleDecl a npa:RoleDeclaration ; npa:role ?role ; npa:viaNanopub ?role_np . optional { ?roleDecl gen:hasRegularProperty ?reg } optional { ?roleDecl gen:hasInverseProperty ?inv } optional { ?roleDecl npa:hasRoleType ?roleType } } graph npa:graph { ?role_np np:hasAssertion ?role_a . } optional { graph ?role_a { ?role rdfs:label ?roleLabel } } optional { graph ?role_a { ?role dct:title ?roleTitle } } optional { graph ?role_a { ?role schema:name ?roleName } } optional { graph ?role_a { ?role gen:hasRoleAssignmentTemplate ?roleAssignmentTemplate } } } 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: <http://www.w3.org/2000/01/rdf-schema#> prefix fip: <https://w3id.org/fair/fip/terms/> prefix dct: <http://purl.org/dc/terms/> prefix dce: <http://purl.org/dc/elements/1.1/> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix np: <http://www.nanopub.org/nschema#> prefix dcat: <https://www.w3.org/ns/dcat#> prefix schema: <https://schema.org/> select ?decl_np ?community ?c ?question ?q ?sort ?nochoice ?decl ?rel ?resource_id_used ?startdate ?enddate ?date ?version where { graph npa:graph { ?decl_np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?decl_np_x npx:invalidates ?decl_np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?decl_np npx:hasNanopubType fip:FIP-Declaration . ?decl_np dct:created ?date . ?decl_np np:hasAssertion ?assertion . } graph ?assertion { ?decl a fip:FIP-Declaration . ?decl fip:refers-to-question ?question . { { ?decl fip:declares-current-use-of ?resource_id_used . bind(fip:declares-current-use-of as ?rel) } union { ?decl fip:declares-planned-use-of ?resource_id_used . bind(fip:declares-planned-use-of as ?rel) } union { ?decl fip:declares-planned-replacement-of ?resource_id_used . bind(fip:declares-planned-replacement-of as ?rel) } union { ?decl fip:declares-replacement-from ?resource_id_used . bind(fip:declares-replacement-from as ?rel) } union { ?decl fip:declares-replacement-to ?resource_id_used . bind(fip:declares-replacement-to as ?rel) } } # grlc gives an error for some reason if these two optional statements are at the end of the graph block: optional { ?decl dcat:startDate ?startdate . } optional { ?decl dcat:endDate ?enddate . } ?decl fip:declared-by ?community . optional { ?decl schema:version ?version . } } bind (replace(str(?community), ".*[#/]", "") as ?c) bind (replace(str(?supercommunity), ".*[#/]", "") as ?sc) bind (replace(str(?question), "^.*-([^-MD]+(-[MD]+)?)$", "$1") as ?q) bind (concat(replace(?q, "F|M", "0"), "x") as ?sort) bind ("" as ?nochoice) } This query returns a list of all FIP communities that have supercommunities. Get FIP supercommunities prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix fip: <https://w3id.org/fair/fip/terms/> select distinct ?community (group_concat(distinct ?supercommunity; separator=" ") as ?supercommunities) (group_concat(distinct ?sc; separator=" ") as ?sc) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np npx:hasNanopubType fip:FAIR-Implementation-Community . ?np (npx:introduces|npx:describes) ?community . ?np np:hasAssertion ?a . } graph ?a { ?community dct:isPartOf ?supercommunity . } optional { graph npa:graph { ?disapproval np:hasAssertion ?da . ?disapproval npa:hasValidSignatureForPublicKey ?dpubkey . filter not exists { ?disapproval_x npx:invalidates ?disapproval ; npa:hasValidSignatureForPublicKey ?dpubkey . } } graph <https://w3id.org/np/RAkVk6aKWsmgcuKtPA7OSp2h-GbDfx8xrz_kJAAgY8Xa4#assertion> { ?dpubkeys npx:hasPublicKey ?dpubkey . } graph ?da { ?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np . } } filter(!bound(?disapproval)) # for some reason this is much faster than "filter not exists" bind(replace(str(?supercommunity), ".*[#/]", "") as ?sc) } group by ?community