Skip to content

Bug Fix: Static Edge Type ID Collision in tkgl-smallpedia and tkgl-wikidata#123

Open
JuliaGast wants to merge 4 commits into
shenyangHuang:mainfrom
JuliaGast:main
Open

Bug Fix: Static Edge Type ID Collision in tkgl-smallpedia and tkgl-wikidata#123
JuliaGast wants to merge 4 commits into
shenyangHuang:mainfrom
JuliaGast:main

Conversation

@JuliaGast
Copy link
Copy Markdown
Contributor

Problem (before PR):
When preprocessing static edges for (tkgl-smallpedia and tkgl-wikidata), the original code assigned static edge type IDs starting from 0.
As a result:

  • The first static edge type had the same ID as the first temporal edge type.
  • If a static edge was already present in the temporal data, it was assigned two different ids.

This caused inconsistent edge type mappings.

Affected datasets:

  • tkgl-smallpedia
  • tkgl-wikidata

Fix:

  • Edge type IDs are now saved to a .pkl file (similar to how node IDs are stored).
  • During preprocessing, static edge types are checked against temporal edge types.
  • Any static edge type not already present in the temporal edge types is assigned an ID starting from number_of_temporal_edge_types + 1.
  • This ensures that all edge type IDs are globally unique and consistent.

…tatic edge types, but check if the static edge types are in the temporal edge types and increase id counter if new edge type
…verse edge ids of static edges as well, before assigning the new inverse edge ids
@JuliaGast
Copy link
Copy Markdown
Contributor Author

JuliaGast commented Nov 18, 2025

Commit: a9ba593

Previously, when assigning edge IDs for static edges, we started the new IDs at num_edges + 1.
However, because each edge has an inverse edge, the range 0 … (num_edges * 2 - 1) is already occupied.
For example, with num_edges = 100, the valid existing IDs are 0–199. Starting static edges at 101 caused ID collisions.

This update changes the starting ID for new static edges to num_edges * 2, ensuring no overlap with existing edge or inverse-edge IDs.

…d when doing a per-query prediction. this ensures to reach mrrs reported in original paper for icews14/18. it seems not to impact yago and wiki-based datasets
…r. this does not significantly affect the final mrr in my experiments, but might be important for further experiments.
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.

1 participant