This repository provides a collection of code for generating synthetic knowledge graphs. These synthetic knowledge graphs enable practitioners to create controlled scenarios for assessing models and algorithms designed for knowledge graphs.
To use the datasets and code in this repository, follow these steps:
-
Install Poetry in your system.
-
Clone the repository to your local machine.
-
Install the dependencies with Poetry.
poetry install
-
Run tests to validate installation
pytest tests
Here we enumerate the available synyhetic datasets in this repository, including links to their respective papers, GitHub repositories (if available), associated tests, and script examples for data creation and storage.
Disclaimer: We are not the authors that introduced some of the datasets in this repository. We have only implemented the datasets in this repository to have a common interface to interact with them. Please use the links to the original papers for more details about the datasets.
FRUNI: Friends and Universities Dataset | Article
Associated Tests:
To run tests for the FRUNI dataset, use the following command:
pytest tests/test_fruni.py
Usage Example:
To create and work with the FRUNI dataset, execute the following command:
python scripts/create_fruni.py --name FRUNI_V0 --n_u 100 --lambda_f 1.5 --alpha_u 0.0 --n_f 50
FTREE: Family Trees Dataset | Article
Associated Tests:
To run tests for the FTREE dataset, use the following command:
pytest tests/test_ftree.py
Usage Example:
To create and work with the FTREE dataset, execute the following command:
python scripts/create_ftree.py --name FTREE_V0 --n_t 100 --lambda_b 5.0 --n_d 3
Associated Tests:
To run tests for the UserItemAttr dataset, use the following command:
pytest tests/test_user_item_attr.py
Usage Example:
To create and work with the FTREE dataset, execute the following command:
# Create a dataset where items only have one attribute
python scripts/create_user_item_attr.py --name UserItemAttr_V0 --num_attrs 20 --num_items 200 --num_users 200 --lambda_a 0.0 --lambda_i 20.0 --percentages 0.8 0.1 0.1 --seed 0
# Create a dataset where items only have more than one attribute
python scripts/create_user_item_attr.py --name UserItemAttr_V1 --num_attrs 20 --num_items 200 --num_users 200 --lambda_a 2.0 --lambda_i 20.0 --percentages 0.8 0.1 0.1 --seed 0
If you use the FRUNI or FTREE datasets in your work, please consider citing our accepted paper at XAI in Action Workshop @ NeurIPS 2023.
@inproceedings{
martin2023fruni,
title={{FRUNI} and {FTREE} synthetic knowledge graphs for evaluating explainability},
author={Pablo Sanchez Martin and Tarek Besold and Priyadarshini Kumari},
booktitle={XAI in Action: Past, Present, and Future Applications},
year={2023},
url={https://openreview.net/forum?id=uU1eXPwesa}
}
The datasets in this repository are released under the GNU GENERAL PUBLIC LICENSE (Version 3, 29 June 2007). Please refer to the LICENSE
file for detailed licensing information.
If you have any questions, feedback, or inquiries about the code, feel free to reach out to the authors: [email protected] and [email protected].
If you encounter any issues with the datasets or have suggestions for improvements, please open an issue on this repository.