Skip to content
Back to skills

Link Prediction Kg

ASecurity

"Guides StellarGraph link prediction, link regression, edge

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 9, 2026
toolspythonbashnodedebuggingapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill link-prediction-kg --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Link Prediction Kg?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Link Prediction Kg
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-link-prediction-kg/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-link-prediction-kg)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: link-prediction-kg
description: "Guides StellarGraph link prediction, link regression, edge
  splitting, temporal link workflows, and knowledge graph completion with
  ComplEx, DistMult, RotatE, RotE, and RotH."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Link Prediction and Knowledge Graphs

Use this sub-skill when a StellarGraph task predicts edges/ratings/relations,
performs link regression/classification, splits graph edges into train/test
sets, or scores triples in a knowledge graph.

## Read first

- [`references/link-workflows.md`](references/link-workflows.md) for edge
  splitting, link generators, Keras link heads, temporal link prediction, and
  leakage checks.
- [`references/knowledge-graphs.md`](references/knowledge-graphs.md) for
  `KGTripleGenerator`, `ComplEx`, `DistMult`, `RotatE`, `RotE`, `RotH`, negative
  sampling, and ranking.
- [`references/api-reference.md`](references/api-reference.md) for verified
  signatures and link/KG object responsibilities.
- [`references/troubleshooting.md`](references/troubleshooting.md) for edge
  leakage, invalid endpoints, target-shape, negative sampling, and relation-type
  failures.
- [`scripts/link_prediction_smoke.py`](scripts/link_prediction_smoke.py) for a
  tiny GCN link-classification wiring check.

## Route here when the user asks to

- use `EdgeSplitter.train_test_split`;
- build link prediction with `GraphSAGELinkGenerator`, `HinSAGELinkGenerator`,
  `FullBatchLinkGenerator`, `Attri2VecLinkGenerator`, or `Node2VecLinkGenerator`;
- add `link_classification`, `link_regression`, or `link_inference` to source
  and destination node embeddings;
- perform knowledge graph completion with `KGTripleGenerator`, `ComplEx`,
  `DistMult`, `RotatE`, `RotE`, or `RotH`;
- use `SelfAdversarialNegativeSampling` or rank triples against all nodes;
- adapt CTDNE or temporal link-prediction workflows.

## Route elsewhere

- Raw graph and dataset construction: [`../graph-data-loading/SKILL.md`](../graph-data-loading/SKILL.md).
- Generator shape debugging: [`../sampling-generators/SKILL.md`](../sampling-generators/SKILL.md).
- Node classification: [`../node-classification-gnns/SKILL.md`](../node-classification-gnns/SKILL.md).
- Node embeddings before downstream edge tasks: [`../embedding-workflows/SKILL.md`](../embedding-workflows/SKILL.md).

## Operating workflow

1. Construct a graph with valid node IDs, edge IDs/types, and features required
   by the chosen embedding model.
2. Split edges for evaluation with `EdgeSplitter` or an equivalent leakage-safe
   method. Keep train and test positives/negatives separate.
3. Choose a link generator:
   - GCN/GAT/PPNP-style full-batch embeddings: `FullBatchLinkGenerator`;
   - GraphSAGE: `GraphSAGELinkGenerator`;
   - HinSAGE: `HinSAGELinkGenerator` with head node types;
   - Attri2Vec/Node2Vec link heads: matching link generators;
   - knowledge graph completion: `KGTripleGenerator`.
4. Build the base embedding model and call `in_out_tensors()`.
5. Attach a link head such as `link_classification`, `link_regression`, or
   `link_inference` to combine source/destination embeddings.
6. Compile and train/evaluate with generator `flow(link_ids, targets, ...)`.
7. For knowledge graph models, use negative sampling and ranking routines
   designed for triples rather than ordinary binary edge pairs.

## Safe check

```bash
python sub-skills/link-prediction-kg/scripts/link_prediction_smoke.py --help
python sub-skills/link-prediction-kg/scripts/link_prediction_smoke.py
```

The smoke uses a tiny graph and does not download datasets or train a notebook.

Files in this skill

  • SKILL.md3.6 KB
  • references/api-reference.md3.7 KB
  • references/knowledge-graphs.md3 KB
  • references/link-workflows.md3.6 KB
  • references/troubleshooting.md2.5 KB
  • scripts/link_prediction_smoke.py2.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.