AutoRDF2GML is a novel framework that semi-automatically transforms RDF data into heterogeneous graph datasets suitable for graph-based machine learning such as graph neural network (GNNs). It bridges the gap between the Graph Machine Learning and Semantic Web communities. Its modular architecture and automatic feature selection make it easy to use, even for users who are not familiar with semantic technologies like SPARQL. AutoRDF2GML facilitates the use of large amounts of RDF data for graph-based machine learning.
Overview of AutoRDF2GMLTo use AutoRDF2GML the graph structure has to be defined in the configuration file and the path to the configuration file has to be specified in the AutoRDF2GML Python file. AutoRDF2GML then automatically generates a heterogeneous graph dataset. The output files can be easily loaded into common graph machine learning frameworks. In this example, we show how the output of AutoRDF2GML (based on the RDF Knowledge Graph SemOpenAlex-SemanticWeb) can be loaded into a PyTorch Geometric HeteroData object. The structure of the loaded PyG HeteroData object as a directed graph is shown here and as an undirected graph is shown here.
To better understand the functionality of AutoRDF2GML, this illustration shows how an RDF entity is transformed into an entity in the heterogeneous graph datasets suitable for graph-based machine learning.
AutoRDF2GML with content-based node features is implemented in the Python script autordf2gml-cb.py. The related template and documentation of the configuration file is defined in the config-template.ini file. The default model for calculating the embeddings based on the natural language descriptions is SciBERT.
AutoRDF2GML with topology-based node features is implemented in the Python script autordf2gml-tb.py. The related template and documentation of the configuration file is defined in the config-template.ini file. The default model for calculating the topology-based feature is TransE. The default parameters are defined and commented in the implementation. The following models are possible with adaptation of the script: TransE, DistMult, ComplEx, RotatE.
The example folder contains a small RDF Knowledge Graph (38.3mb / 259,321 RDF triples) and the corresponding config file for the transformation. Based on the provided files you can easily try AutoRDF2GML on your local computer. To run AutoRFD2GML and transform the RDF data only the file paths have to be changed accordingly. A more detailed description is available in the example folder.
In the folder use-case_semopenalex-semanticweb are the configuration files (content-based and topology-based setting) for the transformation of the RDF Knowledge Graph SemOpenAlex-SemanticWeb. For the transformation we have additionally defined the custom edge author-author. The folder structure of the generated heterogeneous graph dataset is shown here.
The transformed Graph Machine Learning Dataset SOA-SW is available at zenodo https://zenodo.org/records/10299429.
In the folder use-case_lpwc are the configuration files (content-based and topology-based setting) for the transformation of the RDF Knowledge Graph Linked Papers With Code.
The transformed Graph Machine Learning Dataset LPWC is available at zenodo https://zenodo.org/records/10299366 .
AutoRDF2GML is implementet in Python. The needed requirements are defined in requirements.txt.