Skip to content

As a data user, I want systematic target synonym and alias expansionΒ #153

@jordanpadams

Description

@jordanpadams

Checked for duplicates

Yes - I've already checked

πŸ§‘β€πŸ”¬ User Persona(s)

Data User, Planetary Scientist, Educational Users, Automated Systems

πŸ’ͺ Motivation

...so that I can find data using common names, NAIF IDs, or alternative designations without needing to know exact PDS terminology.

πŸ“– Additional Details

Current Behavior:

  • βœ… Fuzzy matching via Context.TARGETS.search() handles typos
  • ❌ No systematic synonyms (e.g., "Mars" ↔ "Red Planet", "499")
  • ❌ No asteroid number support (e.g., "101955" for Bennu)
  • ❌ TODO comment indicates NAIF host ID integration not implemented (contexts.py:126)

Proposed Solution:
Hybrid synonym system combining PDS API metadata with user-configurable aliases:

# Should all find Mars data
products.has_target("Mars")
products.has_target("Red Planet")
products.has_target("499")  # NAIF ID

# Should all find Bennu data
products.has_target("Bennu")
products.has_target("101955")  # Asteroid number
products.has_target("1999 RQ36")  # Provisional designation

# Refresh synonym cache
context = pep.Context()
context.refresh_synonyms(force=True)

Implementation Approach:

  1. Primary source: Load from PDS API (pds:Alias.pds:alternate_title, NAIF IDs)
  2. Secondary source: User-configurable file (~/.pds/peppi/target_synonyms.yaml)
  3. Caching: TTL-based cache with refresh_synonyms(force=True) method
  4. Priority: user config > packaged config > API metadata
  5. Introspection: Add get_synonyms() and resolve() methods

Configuration Example:

# ~/.pds/peppi/target_synonyms.yaml
targets:
  mars:
    synonyms:
      - "red planet"
      - "499"
  bennu:
    synonyms:
      - "101955"
      - "1999 rq36"
cache:
  ttl_seconds: 86400

Related:


For Internal Dev Team To Complete

Acceptance Criteria

Given a user wants to search for Mars using its common name
When I perform products.has_target("Red Planet")
Then I expect products matching the Mars LID

βš™οΈ Engineering Details

To be filled by Engineering Node Team

πŸŽ‰ I&T

To be filled by Engineering Node Team

Metadata

Metadata

Assignees

Type

No type

Projects

Status

ToDo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions