Early alpha. Not production-ready. No package publication or broad PHP compatibility claim.

Scientific identity · NexusScholar.Shared

Shared identity

Normalized scholarly identifiers and transitive membership semantics that let Search, Deduplication, and Bundles refer to works without falling back to titles or object identity.

Purpose and authority boundary

Shared owns cross-module identity primitives, not provider records or deduplication decisions. WorkId expresses a stable namespace/value pair. ScholarlyWork groups identifiers and metadata. CorpusSlice defines membership through identifier overlap and connected components.

Titles, authors, publication year, array position, and runtime object identity are not stable work identity. A record with no accepted stable identifier remains unresolved; Shared does not fabricate one.

Key types

  • WorkIdNamespace closes the accepted set to DOI, arXiv, OpenAlex, Semantic Scholar (s2), PubMed, PMCID, IEEE, DOAJ, and internal identifiers.
  • WorkId parses and canonicalizes namespace/value pairs; namespace-specific rules normalize DOI prefixes/URLs and other provider forms.
  • WorkIdSet rejects empty/default/duplicate identity and exposes deterministic primary-id selection.
  • ScholarlyWork carries an immutable identifier set plus bibliographic metadata. Metadata enriches display and comparison but does not replace identifiers.
  • CorpusSlice closes over transitive identifier overlap: if A shares with B and B shares with C, all three belong to one identity component even when A and C do not directly overlap.

Source: SharedIdentity.cs. Contract: ADR 0007.

Transitive identity model

A = {doi:10.x/a, scopus:1}
B = {scopus:1, pmid:2}
C = {pmid:2, openalex:W3}

A ↔ B ↔ C  ⇒ one connected identity component

No stable ID ⇒ unresolved candidate, not title-derived membership

Primary-id precedence and canonical string forms make ordering reproducible. Set equality is based on normalized identities rather than input order. Hardening protects against adding a bridge record that would silently collapse previously distinct components through transitive overlap.

Typical developer flow

  1. Normalize provider identifiers at ingestion into WorkId values.
  2. Retain all observed stable identifiers; do not discard aliases after choosing a primary id.
  3. Create immutable ScholarlyWork records and a CorpusSlice.
  4. Compare membership through normalized identifier components.
  5. Route no-id records to the owning unresolved-candidate workflow instead of assigning a title hash.

Failure and refusal behavior

Stable rules reject unknown/blank namespaces, malformed or empty values, duplicate IDs, default identities, empty work sets, inconsistent primary IDs, no-ID records entering canonical membership, and transitive bridge additions that would change authority without an explicit owning decision.

Tests, extension points, and nonclaims

SharedIdentityTests exercise normalization, immutable sets, transitive membership, and bridge rejection. SharedIdentityFixtureTests replay the shared identity fixtures. Narrow PHP comparator evidence, where present, is fixture-scoped rather than a broad compatibility claim.

Adding a namespace requires explicit normalization, canonical rendering, precedence, collisions, and fixtures. Shared provides no fuzzy matching, DOI resolution, provider lookup, title similarity, deduplication decision, corpus snapshot publication, or guarantee that two provider identifiers truly describe the same real-world work beyond the accepted evidence.