Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/design-space-repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Two things in one repo:
- `<https://w3id.org/fair/3pff/participatedAsImplementerAspirantIn>`
- `<https://w3id.org/fair/3pff/participatedAsParticipantIn>`
- `<https://w3id.org/kpxl/gen/terms/hasAdmin>`
- `<https://w3id.org/kpxl/gen/terms/hasGuest>`
- `<https://w3id.org/kpxl/gen/terms/hasHost>`
- `<https://w3id.org/kpxl/gen/terms/hasObserver>`
- `<https://w3id.org/kpxl/gen/terms/hasProjectLead>`
- `<https://w3id.org/kpxl/gen/terms/hasTeamMember>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ private static IRI iri(String s) {
Map.entry(iri("https://w3id.org/fair/3pff/participatedAsTrainerIn"), Direction.REGULAR),
// KPXL gen terms
Map.entry(iri("https://w3id.org/kpxl/gen/terms/hasAdmin"), Direction.INVERSE),
Map.entry(iri("https://w3id.org/kpxl/gen/terms/hasGuest"), Direction.INVERSE),
Map.entry(iri("https://w3id.org/kpxl/gen/terms/hasHost"), Direction.INVERSE),
Map.entry(iri("https://w3id.org/kpxl/gen/terms/hasObserver"), Direction.INVERSE),
Map.entry(iri("https://w3id.org/kpxl/gen/terms/hasProjectLead"), Direction.INVERSE),
Map.entry(iri("https://w3id.org/kpxl/gen/terms/hasTeamMember"), Direction.INVERSE),
Expand Down
24 changes: 24 additions & 0 deletions src/test/java/com/knowledgepixels/query/SpacesExtractorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,30 @@ void extract_backcompatInverseDirection_emitsRoleInstantiation() throws Exceptio
assertDoesNotContain(out, subject, REGULAR_PROPERTY, hasTeamMember);
}

@Test
void extract_backcompatHasGuestAndHost_emitsRoleInstantiation_issue114() throws Exception {
// gen:hasGuest / gen:hasHost are space-centric (INVERSE), like hasObserver/hasAdmin.
// They were missing from BackcompatRolePredicates, so the extractor dropped
// guest/host member RIs entirely (issue #114).
for (String pred : new String[] {
"https://w3id.org/kpxl/gen/terms/hasGuest",
"https://w3id.org/kpxl/gen/terms/hasHost" }) {
IRI predicate = vf.createIRI(pred);
// Single-triple assertion → auto-typed by the predicate via NanopubUtils.getTypes.
Nanopub np = creator()
.assertion(SPACE_IRI_1, predicate, MEMBER_AGENT)
.finalizeNanopub();

List<Statement> out = SpacesExtractor.extract(np, defaultContext());
IRI subject = forRoleInstantiation(ARTIFACT_CODE);

assertContains(out, subject, RDF.TYPE, GEN.ROLE_INSTANTIATION);
assertContains(out, subject, FOR_SPACE, SPACE_IRI_1);
assertContains(out, subject, INVERSE_PROPERTY, predicate);
assertContains(out, subject, FOR_AGENT, MEMBER_AGENT);
}
}

@Test
void extract_backcompatRegularDirection_swapsSpaceAndAgent() throws Exception {
// Agent-centric source: <agent> <predicate> <space>. REGULAR under the publisher
Expand Down