Extract gen:isSubSpaceOf declarations and id-prefix triples (#93, PR 1/3)#94
Merged
Conversation
Adds raw-layer extraction for sub-space relations: scans embedded triples in gen:Space nanopubs and standalone gen:isSubSpaceOf nanopubs, emitting one npa:SubSpaceDeclaration per (child, parent) pair. Self-loops are rejected. Also enumerates path-prefixes of every Space IRI as npa:hasIdPrefix triples on the SpaceRef aggregate, powering the future URL-prefix fallback. Pure-additive output in npa:spacesGraph; the materializer doesn't read these triples yet, so downstream behaviour is unchanged. Materializer admit pass (Mode A + Mode B) and URL-prefix fallback follow in PR 2 / 3. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…s-is (#93) Following the existing RoleAssignment / RoleInstantiation pattern: validated SubSpaceDeclaration rows are copied into npass:<…> keeping their npasub: subject. Mode B produces two rows per logical link; consumers dedupe via EXISTS / DISTINCT, same shape they use for role tiers. Per-viaNanopub DELETE works uniformly during invalidation. URL-prefix fallback still emits direct npa:isSubSpaceOf / npa:hasSubSpace triples plus a reified npa:DerivedSubSpaceLink tag so consumers can hide derived links. The tag class is genuinely distinct from declarations (no nanopub source, heuristic derivation) and isn't redundant. Code-only PR 1 is unaffected — npasl: only existed in the doc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… declarations (#93) The fallback admit pass now checks against validated SubSpaceDeclaration rows in npass:<…> rather than raw declarations in npa:spacesGraph. Rule becomes "once a space has *successfully* spoken (admin-of-both gate passed), its declarations are canonical" instead of "once a space has tried to speak". Children whose only declarations are unapproved or mid-flight Mode B no longer get silently dropped — they still pick up URL-prefix fallback edges. Run-order requirement: the explicit-declaration admit pass must commit before the fallback pass runs (already documented). PR 1 unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 6, 2026
Closed
|
🎉 This PR is included in version 1.11.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First of three PRs implementing #93 (sub-space handling). Pure raw-layer extraction — no materialiser changes, no behaviour change downstream.
gen:isSubSpaceOfin two paths and emits onenpa:SubSpaceDeclarationper(child, parent)pair intonpa:spacesGraph:gen:Spacenanopub (<thisSpaceIri> gen:isSubSpaceOf <parent>triples in the assertion).gen:isSubSpaceOfnanopub (single-triple-assertion type dispatch).<X> gen:isSubSpaceOf <X>) at extraction.npa:hasIdPrefixtriples on thenpa:SpaceRefaggregate. Powers the URL-prefix sub-space fallback in PR 3.The materialiser doesn't read any of the new triples yet, so downstream behaviour is unchanged.
Follow-up PRs
AuthorityResolveradmit pass for explicit declarations (Mode A + Mode B), structural-rebuild flag onnpa:SubSpaceLinkDELETE.SpaceRepository.findSubspaces(...)URL regex with the SPARQL consumer pattern.Test plan
SpacesExtractorTestextended from 17 → 27 tests, all green.🤖 Generated with Claude Code