Datasets

pykeen.datasets Package

Built-in datasets for PyKEEN.

New datasets (inheriting from Dataset) can be registered with PyKEEN using the pykeen.datasets group in Python entrypoints in your own setup.py, setup.cfg, pyproject.toml, or other package configuration. They are loaded automatically with importlib.metadata.entry_points() via class_resolver.

Functions

get_dataset(*[, dataset, dataset_kwargs, ...])

Get a dataset, cached based on the given kwargs.

has_dataset(key)

Return if the dataset is registered in PyKEEN.

Classes

CKG(*[, force, cache_root])

The Clinical Knowledge Graph (CKG) dataset from [santos2020].

CSKG(**kwargs)

The CSKG dataset.

DB100K(**kwargs)

The DB100K dataset from [ding2018].

DRKG(**kwargs)

The DRKG dataset.

UMLS(**kwargs)

The UMLS dataset.

WD50KT(**kwargs)

The triples-only version of WD50K.

WN18(**kwargs)

The WN18 dataset.

WN18RR(**kwargs)

The WN18-RR dataset.

YAGO310(**kwargs)

The YAGO3-10 dataset is a subset of YAGO3 that only contains entities with at least 10 relations.

AristoV4(**kwargs)

The Aristo-v4 dataset from [chen2021].

BioKG(**kwargs)

The BioKG dataset from [walsh2020].

CN3l([graph_pair])

The CN3l dataset family.

CoDExLarge(**kwargs)

The CoDEx large dataset.

CoDExMedium(**kwargs)

The CoDEx medium dataset.

CoDExSmall(**kwargs)

The CoDEx small dataset.

ConceptNet(**kwargs)

The ConceptNet dataset from [speer2017].

Countries(**kwargs)

The Countries dataset.

DBpedia50(**kwargs)

The DBpedia50 dataset.

Dataset()

The base dataset class.

FB15k(**kwargs)

The FB15k dataset.

FB15k237(**kwargs)

The FB15k-237 dataset.

Globi(**kwargs)

The Global Biotic Interactions (GloBI) dataset.

Hetionet(**kwargs)

The Hetionet dataset from [himmelstein2017].

Kinships(**kwargs)

The Kinships dataset.

Nations(**kwargs)

The Nations dataset.

OGBBioKG(*[, cache_root])

The OGB BioKG dataset.

OGBWikiKG2(*[, cache_root])

The OGB WikiKG2 dataset.

OpenBioLink(**kwargs)

The OpenBioLink dataset.

OpenBioLinkLQ(**kwargs)

The low-quality variant of the OpenBioLink dataset.

OpenEA(*[, graph_pair, size, version])

The OpenEA dataset family.

PharMeBINet(**kwargs)

The PharMeBINet dataset from [koenigs2022].

PharmKG(**kwargs)

The PharmKGFull dataset from [zheng2020].

PharmKG8k(**kwargs)

The PharmKG8k dataset from [zheng2020].

PrimeKG(**kwargs)

The Precision Medicine Knowledge Graph (PrimeKG) dataset from [chandak2022].

WK3l15k([graph_pair])

The WK3l-15k dataset family.

WK3l120k([graph_pair])

The WK3l-120k dataset family.

Wikidata5M(**kwargs)

The Wikidata5M dataset from [wang2019].

Variables

dataset_resolver

A resolver for datasets

Class Inheritance Diagram

Inheritance diagram of pykeen.datasets.ckg.CKG, pykeen.datasets.cskg.CSKG, pykeen.datasets.db100k.DB100K, pykeen.datasets.drkg.DRKG, pykeen.datasets.umls.UMLS, pykeen.datasets.wd50k.WD50KT, pykeen.datasets.wordnet.WN18, pykeen.datasets.wordnet.WN18RR, pykeen.datasets.yago.YAGO310, pykeen.datasets.aristo.AristoV4, pykeen.datasets.biokg.BioKG, pykeen.datasets.ea.wk3l.CN3l, pykeen.datasets.codex.CoDExLarge, pykeen.datasets.codex.CoDExMedium, pykeen.datasets.codex.CoDExSmall, pykeen.datasets.conceptnet.ConceptNet, pykeen.datasets.countries.Countries, pykeen.datasets.dbpedia.DBpedia50, pykeen.datasets.base.Dataset, pykeen.datasets.freebase.FB15k, pykeen.datasets.freebase.FB15k237, pykeen.datasets.globi.Globi, pykeen.datasets.hetionet.Hetionet, pykeen.datasets.kinships.Kinships, pykeen.datasets.nations.Nations, pykeen.datasets.ogb.OGBBioKG, pykeen.datasets.ogb.OGBWikiKG2, pykeen.datasets.openbiolink.OpenBioLink, pykeen.datasets.openbiolink.OpenBioLinkLQ, pykeen.datasets.ea.openea.OpenEA, pykeen.datasets.pharmebinet.PharMeBINet, pykeen.datasets.pharmkg.PharmKG, pykeen.datasets.pharmkg.PharmKG8k, pykeen.datasets.primekg.PrimeKG, pykeen.datasets.ea.wk3l.WK3l15k, pykeen.datasets.ea.wk3l.WK3l120k, pykeen.datasets.wikidata5m.Wikidata5M

pykeen.datasets.base Module

Utility classes for constructing datasets.

Functions

dataset_similarity(a, b[, metric])

Calculate the similarity between two datasets.

Classes

CompressedSingleDataset(url, relative_path, *)

Loads a dataset that's a single file inside an archive.

CompressedSingleDatasetKwargs

Keyword arguments for a compressed single file dataset.

Dataset()

The base dataset class.

EagerDataset(training, testing[, ...])

A dataset whose training, testing, and optional validation factories are pre-loaded.

LazyDataset([metadata, eager])

A dataset whose training, testing, and optional validation factories are lazily loaded.

LazyDatasetKwargs

Keyword arguments for a lazy dataset.

PackedRemoteDataSet(url, ...[, force, ...])

An abstract base class for packed remote datasets.

PackedRemoteDataSetKwargs

Keyword arguments for a packed remote dataset.

PackedZipRemoteDataset(url, ...[, force, ...])

A remote dataset packed with a ZIP archive.

PathDataset(training_path, testing_path[, ...])

Contains a lazy reference to a training, testing, and validation dataset.

PathDatasetKwargs

Keyword arguments for a path dataset.

SingleTabbedDataset(url, *[, name, ...])

This class is for when you've got a single TSV of edges and want them to get auto-split.

SingleTabbedDatasetKwargs

Keyword arguments for a single file tabbed dataset.

SourceDataSet(training_source, testing_source)

A lazy dataset for arbitrary sources.

SplittingLazyDataset(*[, random_state, ratios])

A dataset that splits.

SplittingLazyDatasetKwargs

Keyword arguments for a splitting lazy dataset.

TabbedDataset(source, *[, read_csv_kwargs, ...])

This class is for when you've got a single TSV of edges and want them to get auto-split.

TabbedDatasetKwargs

Keyword arguments for a tabbed dataset.

TarFileRemoteDataset(url, ...[, force, ...])

A remote dataset packed with a TAR archive.

TarFileSingleDataset(url, relative_path, *)

Loads a dataset that's a single file inside a tar.gz archive.

UnpackedRemoteDataSetKwargs

Keyword arguments for an unpacked remote dataset.

UnpackedRemoteDataset(training_url, testing_url)

A dataset with all three of train, test, and validation sets as URLs.

ZipSingleDataset(url, relative_path, *[, ...])

Loads a dataset that's a single file inside a zip archive.

Class Inheritance Diagram

Inheritance diagram of pykeen.datasets.base.CompressedSingleDataset, pykeen.datasets.base.CompressedSingleDatasetKwargs, pykeen.datasets.base.Dataset, pykeen.datasets.base.EagerDataset, pykeen.datasets.base.LazyDataset, pykeen.datasets.base.LazyDatasetKwargs, pykeen.datasets.base.PackedRemoteDataSet, pykeen.datasets.base.PackedRemoteDataSetKwargs, pykeen.datasets.base.PackedZipRemoteDataset, pykeen.datasets.base.PathDataset, pykeen.datasets.base.PathDatasetKwargs, pykeen.datasets.base.SingleTabbedDataset, pykeen.datasets.base.SingleTabbedDatasetKwargs, pykeen.datasets.base.SourceDataSet, pykeen.datasets.base.SplittingLazyDataset, pykeen.datasets.base.SplittingLazyDatasetKwargs, pykeen.datasets.base.TabbedDataset, pykeen.datasets.base.TabbedDatasetKwargs, pykeen.datasets.base.TarFileRemoteDataset, pykeen.datasets.base.TarFileSingleDataset, pykeen.datasets.base.UnpackedRemoteDataSetKwargs, pykeen.datasets.base.UnpackedRemoteDataset, pykeen.datasets.base.ZipSingleDataset

pykeen.datasets.source Module

A generic source wrapper.

Classes

ArchivedSource(path, archive_type, inner_path)

A source for a file inside an archive.

EnsuredSource(path)

A source that needs to be ensured before opening.

GoogleArchivedSource(path, archive_type, ...)

An archived source that is remote on Google.

GoogleSource(path, google_file_id[, force])

A mixin source for remote sources that must be downloaded before opening.

RemoteArchivedSource(path, archive_type, ...)

An archived source that is remote.

RemoteSimpleSource(path, url[, force, ...])

A simple source that is remote.

RemoteSource(path, url[, force, download_kwargs])

A mixin source for remote sources that must be downloaded before opening.

SimpleSource(path)

A source that is directly opened.

Source(path)

A configuration for a data resource.

Class Inheritance Diagram

Inheritance diagram of pykeen.datasets.source.ArchivedSource, pykeen.datasets.source.EnsuredSource, pykeen.datasets.source.GoogleArchivedSource, pykeen.datasets.source.GoogleSource, pykeen.datasets.source.RemoteArchivedSource, pykeen.datasets.source.RemoteSimpleSource, pykeen.datasets.source.RemoteSource, pykeen.datasets.source.SimpleSource, pykeen.datasets.source.Source

pykeen.datasets.analysis Module

Dataset analysis utilities.

Functions

get_entity_count_df(dataset[, merge_sides, ...])

Create a dataframe with entity counts.

get_entity_relation_co_occurrence_df(dataset)

Create a dataframe of entity/relation co-occurrence.

get_relation_cardinality_types_df(*, dataset)

Determine the relation cardinality types.

get_relation_count_df(dataset[, ...])

Create a dataframe with relation counts.

get_relation_functionality_df(*, dataset[, ...])

Calculate the functionality and inverse functionality score per relation.

get_relation_pattern_types_df(dataset, *[, ...])

Categorize relations based on patterns from RotatE [sun2019].

Inductive Datasets

pykeen.datasets.inductive Package

Inductive models in PyKEEN.

Classes

DisjointInductivePathDataset(...)

A disjoint inductive dataset specified by paths.

DisjointInductiveSourceDataset(...)

A disjoint inductive dataset specified by paths.

EagerInductiveDataset(transductive_training, ...)

An eager inductive datasets.

ILPC2022Large(**kwargs)

An inductive link prediction dataset for the ILPC 2022 Challenge.

ILPC2022Small(**kwargs)

An inductive link prediction dataset for the ILPC 2022 Challenge.

InductiveDataset()

Contains transductive train and inductive inference/validation/test datasets.

InductiveFB15k237([version])

The inductive FB15k-237 dataset in 4 versions.

InductiveNELL([version])

The inductive NELL dataset in 4 versions.

InductiveWN18RR([version])

The inductive WN18RR dataset in 4 versions.

LazyInductiveDataset()

An inductive dataset that has lazy loading.

UnpackedRemoteDisjointInductiveDataset(...)

A dataset with all four of train, inductive_inference, inductive test, and inductive validation sets as URLs.

Variables

Version

Entity Alignment

pykeen.datasets.ea.base Module

Base classes for entity alignment datasets.

Classes

EADataset(*[, side, combination, ...])

Base class for entity alignment datasets.

EADatasetKwargs

Keyword arguments for an entity alignment dataset.

pykeen.datasets.ea.combination Module

Combination strategies for entity alignment datasets.

Classes

CollapseGraphPairCombinator()

This combinator merges all matching entity pairs into a single ID.

DisjointGraphPairCombinator()

This combinator keeps both graphs as disconnected components.

ExtraRelationGraphPairCombinator()

This combinator keeps all entities, but introduces a novel alignment relation.

GraphPairCombinator()

A base class for combination of a graph pair into a single graph.

ProcessedTuple(mapped_triples, alignment, ...)

The result of processing a pair of triples factories.

SwapGraphPairCombinator()

Add extra triples by swapping aligned entities.