Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 10, 2025

πŸ€– AI-Powered Solution

This pull request implements full string ID support as requested in issue #11.

πŸ“‹ Issue Reference

Fixes #11

βœ… Implementation Details

Core Enhancement:

  • Enhanced TryParseLinkId function to support string aliases alongside existing numeric ID parsing
  • Added overloaded version that uses NamedLinksDecorator for alias resolution
  • Updated all parser calls in AdvancedMixedQueryProcessor to use the new string-aware parsing

Key Features:

  • String Aliases as IDs: Users can now use string identifiers like person, name, value instead of numeric IDs
  • Automatic ID Mapping: String aliases are automatically mapped to internal numeric link IDs when creating new links
  • Backward Compatibility: All existing numeric ID functionality continues to work unchanged
  • Key-Value Store: Effectively provides Redis-like key-value store functionality using string aliases

Example Usage:

# Create links with string IDs
clink '(() ((person: name john)))' --after
# Output: (name: name name), (john: john john), (person: name john)

# Query using string IDs  
clink '((($id: name $value)) (($id: name $value)))' --changes
# Output: Shows all name-value pairs using string identifiers

# Mixed numeric and string IDs work together
clink '(() ((1: person address) (location: 2 city)))' --after

πŸ§ͺ Testing

  • 124/124 tests pass - Full backward compatibility maintained
  • Comprehensive string ID tests already exist in the test suite
  • Manual CLI testing confirms string ID functionality works end-to-end

πŸ—οΈ Architecture

The implementation leverages the existing NamedLinksDecorator infrastructure:

  • String aliases are stored in separate .names.links file alongside main database
  • Namify() function in Program.cs already converts numeric IDs back to names in output
  • No breaking changes to existing APIs or data formats

This provides the key-value store functionality requested in the issue, where string aliases effectively serve as keys that map to link relationships, giving users a Redis-like interface for link manipulation.


πŸ€– Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #11
@konard konard self-assigned this Sep 10, 2025
konard and others added 2 commits September 10, 2025 17:37
- Enhanced TryParseLinkId to support string aliases alongside numeric IDs
- Added overloaded version that uses NamedLinksDecorator for alias resolution
- Updated all parser calls to use new string-aware ID parsing
- String IDs are automatically mapped to numeric IDs when creating new links
- Output formatting already converts numeric IDs back to string aliases
- All 124 existing tests pass, confirming backward compatibility

This implements the key-value store functionality requested in issue #11,
where string aliases serve as keys that map to link IDs.

πŸ€– Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@konard konard changed the title [WIP] Support full string ids Support full string ids Sep 10, 2025
@konard konard marked this pull request as ready for review September 10, 2025 14:46
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.

Support full string ids

2 participants