Libshift Knowledge Graph

Temporal Reasoning for API Deprecation and Migration

393
Methods
214
Migration Edges
2
Libraries
append()
concat()
migration.py
- df.append(df2)
+ pd.concat([df, df2])

Overview

πŸ”„

Temporal API Evolution

API deprecation is not a single event but an ongoing, contextual process that requires long-term adaptation and understanding of migration patterns over time.

πŸ•ΈοΈ

Knowledge Graph Model

Libshift models API migration as a temporal knowledge graph, capturing relationships between deprecated methods and their replacements across different versions.

🧠

Multi-hop Reasoning

Supports complex migration patterns through multi-hop mappings, version-aware reasoning, and evidence tracing from multiple sources including docstrings and code.

Migration Patterns

One-to-One Migration

+

Pattern: append β†’ concat

# Deprecated approach
df1.append(df2)

# Recommended replacement
pd.concat([df1, df2])

Simple direct replacement where one deprecated method maps to a single recommended alternative.

One-to-Many Migration

+

Pattern: lookup β†’ melt, factorize

# Deprecated approach
df.lookup(row_indexer, col_indexer)

# Multiple replacement options
df.melt()  # For reshaping data
pd.factorize(df[col])  # For categorical encoding

Complex migration where one deprecated method has multiple context-dependent replacements.

Transitive Migration

+

Pattern: where β†’ applymap β†’ map

# Original deprecated method
df.where(condition)

# Intermediate replacement (also deprecated)
df.applymap(func)

# Current recommended approach
df.map(func)

Multi-step migration path where replacements themselves become deprecated over time.

Paper Highlights

⏰

Temporal Graph Model

Version-aware edges that capture the evolution of API recommendations across different library versions and time periods.

πŸ€–

LLM-Powered Extraction

Advanced mapping extraction using Perplexity Sonar and Qwen models to identify deprecation patterns from documentation.

πŸ“Š

Multi-Source Signals

Comprehensive analysis of docstrings, comments, and code to build robust deprecation mappings with high confidence.

🎯

Confidence Scoring

Sophisticated confidence and decay scoring system for migration edges to prioritize the most reliable recommendations.

πŸ“ˆ

Comprehensive Dataset

393 methods and 214 validated migration edges covering pandas and pydantic libraries with rich temporal metadata.

πŸ”

Evidence Tracing

Full traceability from source documentation to final recommendations, enabling verification and quality assessment.

Explore the Graph

Citation

BibTeX Citation

Soon......