Helper functions to load knowledge graphs.
It is recommended to set the
AMPLIGRAPH_DATA_HOME environment variable:
When attempting to load a dataset, the module will first check if
AMPLIGRAPH_DATA_HOME is set.
If it is, it will search this location for the required dataset.
If the dataset is not found it will be downloaded and placed in this directory.
AMPLIGRAPH_DATA_HOME has not been set the databases will be saved in the following directory:
Benchmark Datasets Loaders¶
Use these helpers functions to load datasets used in graph representation learning literature.
The functions will automatically download the datasets if they are not present in
at the location set in
||Load the FB15k-237 dataset|
||Load the WN18RR dataset|
||Load the YAGO3-10 dataset|
||Load the FB15k dataset|
||Load the WN18 dataset|
WN18 and FB15k include a large number of inverse relations, and its use in experiments has been deprecated. Use WN18RR and FB15K-237 instead.
FB15K-237’s validation set contains 8 unseen entities over 9 triples. The test set has 29 unseen entities, distributed over 28 triples. WN18RR’s validation set contains 198 unseen entities over 210 triples. The test set has 209 unseen entities, distributed over 210 triples.
Loaders for Custom Knowledge Graphs¶
Functions to load custom knowledge graphs from disk.
||Load a knowledge graph from a csv file|
||Load RDF ntriples|
||Load an RDF file|
AmpliGraph includes a helper function to split a generic knowledge graphs into training,
validation, and test sets. See