SPaRKLE is a hybrid method that combines symbolic and mathematical methodologies while leveraging Partial Completness Assumption (PCA) heuristics to capture implicit information and enrich Knowledge Graphs (KGs). The combination of symbolic and numerical strategies offers a comprehensive approach to KG enrichment that capitalizes on the strengths of both paradigms. This technique has the potential to provide more extensive, accurate, interpretable, and flexible knowledge representations, thereby improving the usefulness and efficacy of KGs across several domains.
Clone the repository
git clone git@github.com:SDM-TIB/SPARKLE.git
Installing the dependencies for SPaRKLE
create a virtual environment and
install the dependencies in the virtual environment created for SPaRKLE. To install the
required dependencies run the following command:
pip install -r requirements.txt
Executing scripts to reproduce AMIE results by choosing Baseline
or SPaRKLE
folders and navigating to appropriate path.
Provide configuration for executing
{
"Type": "Baseline",
"KG": "FrenchRoyalty",
"prefix": "http://FrenchRoyalty.org/",
"rules_file": "french_training.csv",
"rdf_file": "french_training.nt"
}
The user must supply a few options in the above JSON file to select the type of approach that has to be executed with added configuration details.
The parameter Type
corresponds to the type of execution, i.e., Baseline
or SPaRKLE
.
Secondly, parameter KG
is the type of knowledge graph, i.e., FrenchRoyalty
or Family
or YAGO3-10
.
Nextly,prefix
parameter is used for preprocessing the predictions results for readability.
Lastly, rules_file
and rdf_file
are the file names for premined rules and KG in the form of NT
file.
python sparkle_amie.py
Executing scripts to reproduce KGE results by choosing Baseline
or SPaRKLE
folders and navigating to appropriate path.
Provide configuration for executing
{
"Type": "Baseline",
"KG": "frenchRoyalty.tsv",
"model": ["TransE", "TransH","TransD","ComplEx","ConvE","RotatE","RESCAL"],
"path_to_results": "./Results/FrenchRoyalty/"
}
The user must provide a few options in the above JSON file to select the type of approach that has to be executed with added configuration details.
The parameter Type
corresponds to the type of execution, i.e., Baseline
or SPaRKLE
.
Secondly, parameter KG
is the type of knowledge graph, i.e., FrenchRoyalty
or Family
or YAGO3-10
.
Nextly,model
parameter is used for training the KGE model to generate results for readability.
Lastly, path_to_results
is parameter given by user to store the trained model results.
python kge_sparkle.py
Note: KGE models are trained in Python 3.9 and executed in a virtual machine on Google Colab with 16 GiB VRAM and 1 GPU NVIDIA Tesla 𝑇 4, with CUDA Version 12.0 (Driver 525.105.17) and PyTorch (v2.0.1).