Skip to content

fix(sparql): scope contributor data per document to prevent cross-gra…#191

Open
torbjokv wants to merge 1 commit into
restoredfrom
experiment-with-blank-nodes
Open

fix(sparql): scope contributor data per document to prevent cross-gra…#191
torbjokv wants to merge 1 commit into
restoredfrom
experiment-with-blank-nodes

Conversation

@torbjokv
Copy link
Copy Markdown
Contributor

…ph merging

In Neptune, contributor triples from different publications/NVI candidates sharing the same person URI (e.g. cristin/person/14967) merge across
named graphs. This causes queries to return affiliations from all publications instead of just the relevant one.

  • CONSTRUCT views: Replace person URI subjects with per-document scoped nodes that preserve the person URI via :identity
    • Publications: use the existing ?contributor blank node from the WHERE sub-select
    • NVI candidates: use a Skolem IRI derived from the candidate URI + contributor URI (blank nodes can't be reused across solution rows in SPARQL CONSTRUCT due to the Cartesian product with approval data)
  • SELECT templates (contributor, affiliation, nvi, nvi-institution-status): navigate through ?contributor :identity ?contributorUri to extract the person identifier
  • Test data (.nt files): updated to match the new CONSTRUCT output structure

…ph merging

In Neptune, contributor triples from different publications/NVI candidates sharing the same person URI (e.g. cristin/person/14967) merge across
  named graphs. This causes queries to return affiliations from all publications instead of just the relevant one.

  - CONSTRUCT views: Replace person URI subjects with per-document scoped nodes that preserve the person URI via :identity
    - Publications: use the existing ?contributor blank node from the WHERE sub-select
    - NVI candidates: use a Skolem IRI derived from the candidate URI + contributor URI (blank nodes can't be reused across solution rows in SPARQL
   CONSTRUCT due to the Cartesian product with approval data)
  - SELECT templates (contributor, affiliation, nvi, nvi-institution-status): navigate through ?contributor :identity ?contributorUri to extract
  the person identifier
  - Test data (.nt files): updated to match the new CONSTRUCT output structure
@torbjokv torbjokv requested a review from brinxmat February 20, 2026 14:37
@github-actions
Copy link
Copy Markdown

Test Results

 15 files   15 suites   53s ⏱️
 96 tests  96 ✅ 0 💤 0 ❌
109 runs  109 ✅ 0 💤 0 ❌

Results for commit 6b7bb34.

@codacy-production
Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 4b12c2e1
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (4b12c2e) Report Missing Report Missing Report Missing
Head commit (6b7bb34) 921 894 97.07%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#191) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant