Skip to content

Improve Pseudonym Creation For Each Artifact by Cleaning Entity IDs #2

Description

@victoriahendersonn

Summary

Update the pseudonym creation logic to include a more robust approach for handling and cleaning entity_ids, improving pseudonym consistency and readability.

Problem Statement

Currently, the pseudonym creation method (create_pseudonym) directly converts entity_ids into pseudonyms without a comprehensive cleanup process. Some IDs may include characters or formats that lead to unreadable or inconsistent pseudonyms, especially if IDs contain slashes (/), whitespace, or other special characters. Improving this will make pseudonyms more user-friendly (for the future) and reduce potential conflicts or errors in file handling. This logic exists in the create_pseudonym function, located in artifact_manager.py.

Proposed Solution

  1. Implement a cleaning function for entity_id that:
    • Replaces or removes special characters (e.g., /, whitespace) with safe alternatives (e.g., underscores _).
    • Limits the length if necessary to improve readability.
  2. Use this function within create_pseudonym to ensure consistent pseudonyms.
  3. Document the cleaning process in code comments for future reference.
  4. Write and refactor tests to verify this change works as intended.

Acceptance Criteria

  • Pseudonyms are free from special characters that could interfere with file system operations.
  • Pseudonym readability is improved, will ensuring uniqueness across similar entity IDs.
  • Updated code is tested to verify that pseudonym creation works for a variety of entity_id inputs.

Note: This change affects the create_pseudonym function within the Artifact class and will impact how pseudonyms are generated across different artifact types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    artifact-managerIssues related to artifact extraction/handling, pseudonym creation and symbolic link generation.enhancementNew feature or requestro-crate-pluginWork on the RO-Crate plugin, covering integration with other tools or libraries.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions