Skip to content

fix(spaces): ingest gen:hasGuest / gen:hasHost member RIs (#114)#116

Merged
tkuhn merged 1 commit into
mainfrom
fix/issue-114-guest-host
May 27, 2026
Merged

fix(spaces): ingest gen:hasGuest / gen:hasHost member RIs (#114)#116
tkuhn merged 1 commit into
mainfrom
fix/issue-114-guest-host

Conversation

@tkuhn
Copy link
Copy Markdown
Contributor

@tkuhn tkuhn commented May 27, 2026

Fixes #114.

Problem

gen:hasGuest and gen:hasHost were missing from BackcompatRolePredicates.DIRECTIONS. A member role-instantiation like <space> gen:hasGuest <agent> is a single-triple assertion, so the registry auto-types it with the predicate IRI itself. Since that IRI wasn't in TRIGGER_TYPES, isSpaceRelevant(...) returned false and SpacesExtractor.extract(...) dropped the nanopub entirely (not even stored). Guest/host members silently vanished, while their sibling predicates (hasObserver, hasAdmin, hasProjectLead, hasTeamMember) — all present in the list — worked fine.

Fix

Add both predicates as Direction.INVERSE (space-centric, matching hasObserver/hasAdmin):

Map.entry(iri("https://w3id.org/kpxl/gen/terms/hasGuest"), Direction.INVERSE),
Map.entry(iri("https://w3id.org/kpxl/gen/terms/hasHost"),  Direction.INVERSE),

A re-materialization then picks up the existing guest/host RIs (e.g. for https://w3id.org/spaces/TheNanoPub: 6 guests + 1 host). Also added to the backcompat-predicate list in doc/design-space-repositories.md.

Verification

  • New test extract_backcompatHasGuestAndHost_emitsRoleInstantiation_issue114 (mirrors the existing INVERSE backcompat test) confirms both predicates now produce a gen:RoleInstantiation with npa:inverseProperty and the right space/agent binding.
  • Full unit suite green (216 tests).

Independent of #113 / #115 (that one is about roles attached to an owl:sameAs alias); here everything is on the canonical IRI — the predicate was simply unrecognized.

🤖 Generated with Claude Code

gen:hasGuest and gen:hasHost were missing from BackcompatRolePredicates, so a
single-triple member RI like <space> gen:hasGuest <agent> — auto-typed by the
predicate via the registry's single-triple-assertion trick — was not in
TRIGGER_TYPES. isSpaceRelevant returned false and extract() dropped the nanopub
entirely (not even stored), so guest/host members silently vanished while their
sibling predicates (hasObserver, hasAdmin, hasProjectLead, hasTeamMember) worked.

Add both as Direction.INVERSE (space-centric, matching hasObserver/hasAdmin). A
re-materialization then picks up the existing guest/host role instantiations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tkuhn tkuhn merged commit b810291 into main May 27, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.14.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spaces extractor drops gen:hasGuest / gen:hasHost member RIs (missing from BackcompatRolePredicates)

1 participant