[ { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc/pubinfo", "@graph": [ { "@id": "https://orcid.org/0000-0002-1267-0234", "http://xmlns.com/foaf/0.1/name": [ { "@value": "Tobias Kuhn" } ] }, { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc", "http://purl.org/dc/terms/created": [ { "@value": "2026-09-25T06:58:57Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } ], "http://purl.org/dc/terms/creator": [ { "@id": "https://orcid.org/0000-0002-1267-0234" } ], "http://purl.org/dc/terms/license": [ { "@id": "https://creativecommons.org/licenses/by/4.0/" } ], "http://purl.org/nanopub/x/embeds": [ { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc/list-view-displays-space" } ], "http://purl.org/nanopub/x/supersedes": [ { "@id": "https://w3id.org/np/RAcwuU0NRoGXDxnGJi_mbgApZy5vzeT7EGNKvTxo-SsOk" } ], "http://www.w3.org/2004/02/skos/core#changeNote": [ { "@value": "Performance rewrite (most space pages were hitting the 60s cap with 502; same rows, a few seconds now): the authority gate is materialized once as a single row of admin/maintainer key hashes and checked with contains() after the display/preset union, because joining the gate's ?pubkey rows directly made rdf4j walk every nanopub those keys ever signed; the latest-version resolution compares signing keys by FILTER instead of a shared ?vKey join variable, for the same reason; and the governed winners of all (kind, space) pairs are computed once as a single string and looked up per pin, instead of a winner sub-select with its SERVICE that rdf4j re-ran per row." } ], "https://w3id.org/np/o/ntemplate/wasCreatedFromProvenanceTemplate": [ { "@id": "https://w3id.org/np/RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU" } ], "https://w3id.org/np/o/ntemplate/wasCreatedFromPubinfoTemplate": [ { "@id": "https://w3id.org/np/RACJ58Gvyn91LqCKIO9zu1eijDQIeEff28iyDrJgjSJF8" }, { "@id": "https://w3id.org/np/RAKc76yHLDbloE6ObluzYQsfX37v6qrZXbYeIKpe8-YUo" }, { "@id": "https://w3id.org/np/RAoTD7udB2KtUuOuAe74tJi1t3VzK0DyWS7rYVAq1GRvw" } ], "https://w3id.org/np/o/ntemplate/wasCreatedFromTemplate": [ { "@id": "https://w3id.org/np/RAEFAt-QcFK0ZhqfvlsmS10BnzGJA0xwOICZXkO-ai87k" } ] }, { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc/sig", "http://purl.org/nanopub/x/hasAlgorithm": [ { "@value": "RSA" } ], "http://purl.org/nanopub/x/hasPublicKey": [ { "@value": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB" } ], "http://purl.org/nanopub/x/hasSignature": [ { "@value": "Y/Kkg1SD6CmlXStREyf6oDWOFH++KVSIWwL32zQ6e8F2d4Z6MgiilvcdIB2aMDbvfziBuGsuO7WEeS4+F+GXmgVWrLMe8HM8RjKxlsTobeZy7hwQfP71QPA22m0XtSojO39p6C9i0AmTpxBZ+h5poQTvtFiPKd2d/sgOIlm2ri0=" } ], "http://purl.org/nanopub/x/hasSignatureTarget": [ { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc" } ], "http://purl.org/nanopub/x/signedBy": [ { "@id": "https://orcid.org/0000-0002-1267-0234" } ] } ] }, { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc/assertion", "@graph": [ { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc/list-view-displays-space", "http://purl.org/dc/terms/description": [ { "@value": "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. Federation footprint (2026-08-20): endpoint rebased onto repo/full, so the former SERVICE hops to repo/full (preset branch) and to the ResourceView type repo (latest-version resolution, governed-version candidates and metadata) are local patterns; only the space-state lookups remain federated, to repo/spaces. The latest-version resolution was rewritten from a run-once repo-wide max-date sub-select (which cannot see outer bindings and would enumerate the whole repository on repo/full, timing out) to bound per-view lookups choosing the same-key, non-invalidated supersedes-head with no newer such sibling -- same heads, ties preserved. In the governed-resolution sub-select the candidate block is wrapped in a projecting sub-select; this wrapper is load-bearing on rdf4j 6.0.0, where bindings from raw local patterns are silently not joined into a following SERVICE clause. Validated result-identical to the previous version across spaces, refs, user and resource pages (columns produced by sample(), non-deterministic by definition, may vary as they already did between runs of the previous version). The per-hop loopback federation was an amplifier of the rdf4j connection-pool deadlock behind the fleet-wide /api wedges. Adds three columns for the per-row override actions (nanodash issue #664): override_target, the row's own view-display nanopublication, which the override action reopens in place; override_template, the template that nanopublication was created from, so each display reopens in the template it was made with; and override_view, the row's view, filled only on preset-borne rows. A preset-borne row has no view-display nanopublication of its own -- its source is the preset assignment -- so it cannot be overridden in place; it is overridden instead by publishing a standalone view display for the same view on this resource, which wins latest-wins over the preset-supplied one. override_target and override_view are exactly complementary, so each row is offered precisely one of the two override actions. All three are action-mapping sources and are therefore not rendered as table columns. They are produced by a wrapping projection that leaves the aggregation below unchanged; results on all previous columns are unaffected." } ], "http://purl.org/dc/terms/license": [ { "@id": "http://www.apache.org/licenses/LICENSE-2.0" } ], "@type": [ "https://w3id.org/kpxl/grlc/grlc-query" ], "http://www.w3.org/2000/01/rdf-schema#label": [ { "@value": "List view displays (space)" } ], "https://w3id.org/kpxl/grlc/endpoint": [ { "@id": "https://w3id.org/np/l/nanopub-query-1.1/repo/full" } ], "https://w3id.org/kpxl/grlc/sparql": [ { "@value": "prefix rdfs: \nprefix dct: \nprefix np: \nprefix npa: \nprefix npx: \nprefix gen: \nprefix nt: \n\n# Wrapping projection adding the three columns the per-row override actions need:\n# the display's own nanopublication, the template it was created from, and -- for\n# preset-borne rows, which have no display nanopublication of their own -- the view\n# to pin here with a fresh standalone display. All three are action-mapping sources\n# and are therefore hidden from the rendered table. They are added here, around the\n# untouched aggregation below, so that the resolution and latest-wins logic keeps\n# evaluating exactly as before.\nselect ?view ?view_label ?displayed_here ?position ?position_label\n ?via_preset ?via_preset_label ?added_by ?deactivateView ?date_added\n (if(bound(?via_preset), \"\", str(?np)) as ?override_target)\n (if(bound(?via_preset), str(?view), \"\") as ?override_view)\n (str(?srcTemplate) as ?override_template)\n ?np ?np_label\nwhere {\n{\nselect (?view_g as ?view) ?deact_g\n (?view_label_g as ?view_label)\n (?displayed_here_g as ?displayed_here)\n (?position_g as ?position)\n (substr(?position_g, 1, 3) as ?position_label)\n (if(strlen(?via_preset_g) > 0, iri(?via_preset_g), ?undef_vp) as ?via_preset)\n (?via_preset_label_g as ?via_preset_label)\n (if(strlen(?added_by_g) > 0, iri(?added_by_g), ?undef_ab) as ?added_by)\n (?deactivateView_g as ?deactivateView)\n (?date_added_g as ?date_added)\n (?np_g as ?np)\n (?np_label_g as ?np_label) where {\n# Collapse to one deterministic row per view KIND (dct:isVersionOf of the pinned reference). The page can reach a view through several\n# rows (a direct ViewDisplay AND a preset, multiple display nanopubs, class+namespace targets);\n# group by ?viewKind picks ONE: the NEWEST row (display or preset assignment) of that kind,\n# which is what nanodash filterViewDisplays renders; its deactivation state decides whether the\n# kind appears at all (?deact_g, filtered in the wrapper). Every column is pinned to that single\n# newest row via an argmax over (date_added, np) --\n# the same trick already used for ?np -- so the detail columns stay mutually consistent\n# (no value mixed in from a different source row) instead of independently SAMPLE()d at random.\nselect ?viewKind\n (iri(strafter(strafter(max(concat(str(?date_added), \"\\\\t\", str(?np), \"\\\\t\", str(?view))), \"\\\\t\"), \"\\\\t\")) as ?view_g)\n (strafter(strafter(max(concat(str(?date_added), \"\\\\t\", str(?np), \"\\\\t\", coalesce(str(?view_label), \"\"))), \"\\\\t\"), \"\\\\t\") as ?view_label_g)\n (strafter(strafter(max(concat(str(?date_added), \"\\\\t\", str(?np), \"\\\\t\", str(?displayed_here))), \"\\\\t\"), \"\\\\t\") as ?displayed_here_g)\n (strafter(strafter(max(concat(str(?date_added), \"\\\\t\", str(?np), \"\\\\t\", str(?deact))), \"\\\\t\"), \"\\\\t\") as ?deact_g)\n (strafter(strafter(max(concat(str(?date_added), \"\\\\t\", str(?np), \"\\\\t\", str(?position))), \"\\\\t\"), \"\\\\t\") as ?position_g)\n (strafter(strafter(max(concat(str(?date_added), \"\\\\t\", str(?np), \"\\\\t\", coalesce(str(?via_preset), \"\"))), \"\\\\t\"), \"\\\\t\") as ?via_preset_g)\n (strafter(strafter(max(concat(str(?date_added), \"\\\\t\", str(?np), \"\\\\t\", coalesce(str(?via_preset_label), \"\"))), \"\\\\t\"), \"\\\\t\") as ?via_preset_label_g)\n (strafter(strafter(max(concat(str(?date_added), \"\\\\t\", str(?np), \"\\\\t\", coalesce(str(?added_by), \"\"))), \"\\\\t\"), \"\\\\t\") as ?added_by_g)\n (strafter(strafter(max(concat(str(?date_added), \"\\\\t\", str(?np), \"\\\\t\", str(?deactivateView))), \"\\\\t\"), \"\\\\t\") as ?deactivateView_g)\n (max(?date_added) as ?date_added_g)\n (iri(strafter(max(concat(str(?date_added), \"\\\\t\", str(?np))), \"\\\\t\")) as ?np_g)\n (\"^\" as ?np_label_g) where {\nselect ?view ?view_label ?displayed_here ?position\n (if(?displayed_here = \"\", ?target_multi_iri_raw, \"\") as ?target_multi_iri)\n (if(?displayed_here = \"\", ?target_label_multi_raw, \"\") as ?target_label_multi)\n ?via_preset ?via_preset_label ?added_by ?date_added ?deactivateView ?np ?np_label ?viewKind ?deact\nwhere {\n select ?view ?view_label ?position\n (if(bound(?presetScope), ?presetScope,\n if(bound(?preset),\n if(?aVHasTarget > 0, if(?aVMatch > 0, \"✓\", \"\"), \"\"),\n if(?aDApplyHere > 0, \"✓\",\n if(?aDHasTarget > 0, if(?aDMatch > 0, \"✓\", \"\"),\n if(?aDHasApply > 0, \"\",\n if(?aVHasTarget > 0, if(?aVMatch > 0, \"✓\", \"\"), \"\")))))) as ?displayed_here)\n ?target_multi_iri_raw ?target_label_multi_raw\n (?preset as ?via_preset) (?preset_label as ?via_preset_label)\n (?user as ?added_by) (?date as ?date_added)\n ?deactivateView ?np ?viewKind ?deact (\"^\" as ?np_label) where {\n select ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np ?viewKind ?deact\n (max(?fDApplyHere) as ?aDApplyHere) (max(?fDHasApply) as ?aDHasApply) (max(?fDHasTarget) as ?aDHasTarget)\n (max(?fDMatch) as ?aDMatch) (max(?fVHasTarget) as ?aVHasTarget) (max(?fVMatch) as ?aVMatch)\n (group_concat(distinct ?targetIri; separator=\" \") as ?target_multi_iri_raw)\n (group_concat(distinct ?targetLabel; separator=\"\\\\n\") as ?target_label_multi_raw)\n where {\n {\n select ?_resource_multi_iri ?viewRef ?viewLatest ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?np\n ?ownClass ?dApply ?dTarget ?effVTarget ?pinSpace ?governedLatest ?displayMode ?refKind where {\n values ?_resource_multi_iri {}\n # Governed winners of all (kind, space) pairs, computed once as a single row\n # (see the space-governed resolution below).\n {\n select (concat(\"|\", group_concat(concat(str(?wKind), \">\", str(?wSpace), \">\", str(?wLatest)); separator=\"|\"), \"|\") as ?govWinners) where {\n select ?wKind ?wSpace (iri(strafter(max(concat(str(?cDate), \">\", str(?cver))), \">\")) as ?wLatest) where {\n # Candidate versions. The sub-select wrapper is LOAD-BEARING: on rdf4j 6.0.0,\n # bindings from raw local patterns are silently NOT joined into a following\n # SERVICE clause (the spaces lookup below); a projecting sub-select restores\n # the join (verified empirically, 2026-08-20).\n { select ?wKind ?wSpace ?cver ?cpk ?cDate where {\n graph npa:graph {\n ?cnp dct:created ?cDate ; npa:hasValidSignatureForPublicKeyHash ?cpk ; npx:embeds ?cver ; np:hasAssertion ?ca .\n filter not exists { ?ci npx:invalidates ?cnp ; npa:hasValidSignatureForPublicKeyHash ?cpk . }\n }\n graph ?ca { ?cver dct:isVersionOf ?wKind ; gen:governedBy ?wSpace . }\n } }\n service {\n graph npa:graph { npa:hasCurrentSpaceState ?gsg . }\n graph ?gsg {\n ?wKind npa:isMaintainedBy ?wSpace ; npa:hasGoverningSpaceRef ?gref .\n ?gri a gen:RoleInstantiation ; npa:forSpace ?wSpace ; npa:forSpaceRef ?gref ; npa:hasRoleType ?gtier ; npa:forAgent ?gag .\n filter(?gtier = gen:AdminRole || ?gtier = gen:MaintainerRole || ?gtier = gen:MemberRole)\n ?gacct a npa:AccountState ; npa:agent ?gag ; npa:pubkey ?cpk .\n }\n }\n } group by ?wKind ?wSpace\n }\n }\n # Authority gate, materialized ONCE as a single row (?authKeys) that\n # shares no variable with the rest of this block. Joining the gate's ?pubkey rows\n # directly made rdf4j start the display/preset lookups from the signing keys --\n # i.e. walk every nanopub the space's admins ever signed (13k+ for knowledgepixels/\n # nanodash) -- instead of from the few displays of this resource. The keys are\n # checked with contains() after the union instead (hex hashes, space-separated).\n {\n select ?authKeys where {\n service {\n select (group_concat(distinct ?pubkey; separator=\" \") as ?authKeys) where {\n values ?_resource_multi_iri {}\n values ?_root_np_multi_iri {}\n graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }\n graph npa:spacesGraph { ?passedRef npa:rootNanopub ?_root_np_multi_iri . }\n # Authority gate (space-scoped, no-UNION variant of list-view-displays): a single\n # mandatory hop through the governing space ref. For a gen:Space resource, issue #130's\n # reflexive self-edge (?space npa:hasGoverningSpaceRef ?ownRef) already exposes the\n # space's own admins/maintainers through this same hop, so the agent-self UNION branch\n # carried by the general list-view-displays is redundant here and is dropped. That leaves\n # a single non-UNION join under the variable ?stateG, avoiding the RDF4J planner timeout\n # documented in nanopub-query doc/sparql-quirks.md (variable hasCurrentSpaceState pointer\n # + multi-join + UNION => intermittent 504).\n graph ?stateG {\n ?_resource_multi_iri npa:hasGoverningSpaceRef ?passedRef .\n ?ri a gen:RoleInstantiation ; npa:forSpaceRef ?passedRef ; npa:hasRoleType ?roleType ; npa:forAgent ?authAgent .\n filter(?roleType = gen:AdminRole || ?roleType = gen:MaintainerRole)\n ?authAcct a npa:AccountState ; npa:agent ?authAgent ; npa:pubkey ?pubkey .\n }\n }\n }\n }\n }\n # ?ownClass is the constant gen:Space (this query only backs gen:Space views).\n bind(gen:Space as ?ownClass)\n {\n graph npa:graph {\n ?np npx:hasNanopubType gen:ViewDisplay ;\n npa:hasValidSignatureForPublicKeyHash ?pubkey ;\n dct:created ?date ;\n npx:embeds ?display ;\n np:hasAssertion ?a .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n optional { ?np npx:signedBy ?user }\n }\n graph ?a {\n ?display gen:isDisplayOfView ?viewRef ;\n gen:isDisplayFor ?_resource_multi_iri .\n optional {\n values ?displayMode { gen:ActivatedViewDisplay gen:DeactivatedViewDisplay }\n ?display a ?displayMode .\n }\n optional { ?display gen:appliesTo ?dApply . }\n optional { ?display (gen:appliesToInstancesOf|gen:appliesToNamespace) ?dTarget . }\n }\n }\n union\n {\n select ?viewRef ?displayMode ?preset ?preset_label ?presetScope ?user ?date ?np ?pubkey ?_resource_multi_iri {\n { # was: service repo/full — now local on the repo/full endpoint\n graph npa:graph {\n ?np npx:hasNanopubType gen:PresetAssignment ;\n npa:hasValidSignatureForPublicKeyHash ?pubkey ;\n dct:created ?date ;\n npx:embeds ?assignment ;\n np:hasAssertion ?a .\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }\n optional { ?np npx:signedBy ?user }\n }\n graph ?a {\n ?assignment gen:isAssignmentFor ?_resource_multi_iri ;\n gen:isAssignmentOfPreset ?preset .\n optional {\n values ?displayMode { gen:ActivatedPresetAssignment gen:DeactivatedPresetAssignment }\n ?assignment a ?displayMode .\n }\n }\n filter not exists {\n graph npa:graph {\n ?np2 npx:hasNanopubType gen:PresetAssignment ;\n npa:hasValidSignatureForPublicKeyHash ?pubkey2 ;\n dct:created ?date2 ;\n npx:embeds ?assignment2 ;\n np:hasAssertion ?a2 .\n filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }\n }\n graph ?a2 {\n ?assignment2 a gen:DeactivatedPresetAssignment ;\n gen:isAssignmentFor ?_resource_multi_iri ;\n gen:isAssignmentOfPreset ?preset .\n }\n filter(?date2 > ?date)\n }\n graph npa:graph { ?presetNp npx:embeds ?preset ; np:hasAssertion ?pa . }\n graph ?pa {\n ?preset a gen:Preset .\n optional { ?preset rdfs:label ?preset_label . }\n { ?preset gen:hasTopLevelView ?viewRef . bind(\"✓\" as ?presetScope) }\n union { ?preset gen:hasView ?viewRef }\n }\n }\n }\n }\n filter(contains(?authKeys, ?pubkey))\n optional {\n graph npa:graph { ?np np:hasAssertion ?npAssertion . }\n graph ?npAssertion { ?npDisplay gen:hasStructuralPosition ?dispPos . }\n }\n # Deactivated displays are kept here on purpose: the per-kind newest-wins step below\n # decides, exactly as nanodash filterViewDisplays does (a deactivated display that is the\n # newest of its kind hides the kind; an older activated one never resurfaces).\n optional {\n # Resolve ?viewRef to its latest same-key non-invalidated version. Was a\n # service on the ResourceView type shard with a run-once max-date sub-select;\n # a sub-select cannot see outer bindings, so localized on repo/full it would\n # enumerate the whole repository (measured: times out >10s). Rewritten as\n # BOUND point lookups per ?viewRef: the head is the supersedes-connected,\n # same-key, non-invalidated version with no newer such sibling (ties kept,\n # matching the old max+join). Filters stay OUTSIDE graph blocks (rdf4j\n # planner trap).\n # Same-key comparisons are FILTERs on separately bound key variables, never a\n # shared join variable: a shared ?vKey let rdf4j start from the signing key and\n # walk every nanopub signed with it (thousands for active keys), >10s per page.\n graph npa:graph { ?vnp npx:embeds ?viewRef ; npa:hasValidSignatureForPublicKeyHash ?vKey . }\n graph npa:networkGraph { ?headNp (npx:supersedes)* ?vnp . }\n graph npa:graph { ?headNp npa:hasValidSignatureForPublicKeyHash ?hKey ; dct:created ?headDate ;\n npx:embeds ?viewLatest ; np:hasAssertion ?hva . }\n filter(str(?hKey) = str(?vKey))\n filter not exists { graph npa:graph { ?i2 npx:invalidates ?headNp ; npa:hasValidSignatureForPublicKeyHash ?i2Key . } filter(str(?i2Key) = str(?vKey)) }\n filter not exists {\n graph npa:networkGraph { ?h2 (npx:supersedes)* ?vnp . }\n graph npa:graph { ?h2 npa:hasValidSignatureForPublicKeyHash ?h2Key ; dct:created ?h2Date . }\n filter(str(?h2Key) = str(?vKey))\n filter not exists { graph npa:graph { ?i3 npx:invalidates ?h2 ; npa:hasValidSignatureForPublicKeyHash ?i3Key . } filter(str(?i3Key) = str(?vKey)) }\n filter(?h2Date > ?headDate)\n }\n graph ?hva { ?viewLatest dct:title ?supLabel . }\n optional { graph ?hva { ?viewLatest gen:hasStructuralPosition ?viewPos . } }\n optional { graph ?hva { ?viewLatest (gen:appliesToInstancesOf|gen:appliesToNamespace) ?vTarget . } }\n }\n # Space-governed resolution (gen:governedBy; nanodash docs/views-and-presets-as-\n # maintained-resources.md): if the pinned version declares a governing space, the\n # newest version of its (kind, space) pair signed by a current member+ of that\n # space wins, with the kind validated as maintained by the space. No valid\n # candidate -> the pin stands. The winners of ALL governed (kind, space) pairs are\n # computed once, as a single \"|kind>space>winner|...\" string (?govWinners, bound by\n # the zero-shared-variable sub-select at the top of this block), and looked up per\n # pin by string. The previous shape joined the winner sub-select on ?pinKind/\n # ?pinSpace inside this OPTIONAL, which made rdf4j re-run it -- SERVICE included --\n # once per row. '>' and '|' cannot occur in IRIs, so the keys are unambiguous.\n optional {\n graph npa:graph { ?pinNp npx:embeds ?viewRef ; np:hasAssertion ?pinA . }\n graph ?pinA { ?viewRef dct:isVersionOf ?pinKind ; gen:governedBy ?pinSpace0 . }\n }\n bind(coalesce(iri(strbefore(strafter(?govWinners, concat(\"|\", str(?pinKind), \">\", str(?pinSpace0), \">\")), \"|\")),\n ) as ?govJoin)\n optional {\n # Governed-winner metadata. ?govJoin is a dummy IRI when there is no winner, so\n # this lookup never runs unbound.\n graph npa:graph { ?gnp npx:embeds ?govJoin ; np:hasAssertion ?gva . }\n graph ?gva { ?govJoin dct:title ?gTitle . }\n optional { graph ?gva { ?govJoin gen:hasStructuralPosition ?gPos . } }\n optional { graph ?gva { ?govJoin (gen:appliesToInstancesOf|gen:appliesToNamespace) ?gTarget . } }\n }\n bind(if(bound(?gTitle), ?govJoin, ?unboundGov) as ?governedLatest)\n bind(if(bound(?gTitle), ?pinSpace0, ?unboundGov) as ?pinSpace)\n # The view kind of the pinned reference (versions share it); falls back to the reference\n # itself for kind-less views, mirroring nanodash ViewDisplay.getViewKindIri().\n optional {\n graph npa:graph { ?kNp npx:embeds ?viewRef ; np:hasAssertion ?kA . }\n graph ?kA { ?viewRef dct:isVersionOf ?refKind . }\n }\n bind(if(bound(?governedLatest), ?gTitle, ?supLabel) as ?view_label)\n bind(if(bound(?governedLatest), ?gPos, ?viewPos) as ?effViewPos)\n bind(if(bound(?governedLatest), ?gTarget, ?vTarget) as ?effVTarget)\n bind(coalesce(?dispPos, ?effViewPos, \"\") as ?position)\n }\n }\n bind(if(coalesce(str(?dApply) = str(?_resource_multi_iri), false), 1, 0) as ?fDApplyHere)\n bind(if(bound(?dApply), 1, 0) as ?fDHasApply)\n bind(if(bound(?dTarget), 1, 0) as ?fDHasTarget)\n bind(if(coalesce(str(?dTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?dTarget)), false), 1, 0) as ?fDMatch)\n bind(if(bound(?effVTarget), 1, 0) as ?fVHasTarget)\n bind(if(coalesce(str(?effVTarget) = str(?ownClass), false) || coalesce(strstarts(str(?_resource_multi_iri), str(?effVTarget)), false), 1, 0) as ?fVMatch)\n bind(coalesce(?dTarget, ?effVTarget) as ?targetIri)\n bind(replace(str(?targetIri), \"^.*[/#]\", \"\") as ?targetLocalName)\n bind(if(coalesce(strlen(?targetLocalName) > 0, false), ?targetLocalName, str(?targetIri)) as ?targetLabel)\n bind(if(bound(?pinSpace), coalesce(?governedLatest, ?viewRef), coalesce(?viewLatest, ?viewRef)) as ?view)\n bind(str(?viewRef) as ?deactivateView)\n bind(coalesce(str(?refKind), str(?viewRef)) as ?viewKind)\n bind(if(coalesce(contains(str(?displayMode), \"Deactivated\"), false), \"1\", \"0\") as ?deact)\n }\n group by ?view ?view_label ?position ?preset ?preset_label ?presetScope ?user ?date ?deactivateView ?np ?viewKind ?deact\n }\n}\n}\ngroup by ?viewKind\n}\n}\n# A preset-borne row's ?np is the preset assignment rather than a view display, so\n# there is nothing to override in place there; ?override_target is blanked for those\n# rows above, which hides that action (an empty raw-key mapping value hides the\n# button). Such a row is instead overridden by publishing a standalone view display\n# for the same view on this resource, which wins latest-wins over the preset-supplied\n# one -- that is what ?override_view feeds, and it is blank on every other row, so\n# exactly one of the two override actions is offered per row.\nfilter(?deact_g = \"0\")\noptional {\n graph npa:graph { ?np np:hasPublicationInfo ?srcPubinfo . }\n graph ?srcPubinfo { ?np nt:wasCreatedFromTemplate ?srcTemplate . }\n}\n}\norder by desc(?displayed_here) ?position" } ] } ] }, { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc/provenance", "@graph": [ { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc/assertion", "http://www.w3.org/ns/prov#wasAttributedTo": [ { "@id": "https://orcid.org/0000-0002-1267-0234" } ], "http://www.w3.org/ns/prov#wasDerivedFrom": [ { "@id": "https://w3id.org/np/RAfGpyfUX8qjSMN5-aRWOPeVqHajs3f6zUzcnMuRibk1g" } ] } ] }, { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc/Head", "@graph": [ { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc", "http://www.nanopub.org/nschema#hasAssertion": [ { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc/assertion" } ], "http://www.nanopub.org/nschema#hasProvenance": [ { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc/provenance" } ], "http://www.nanopub.org/nschema#hasPublicationInfo": [ { "@id": "https://w3id.org/np/RAK-G8qJavgwflEUG1ArhvrxE_hw4LcOgtFpG-tthhGmc/pubinfo" } ], "@type": [ "http://www.nanopub.org/nschema#Nanopublication" ] } ] } ]