Coder Social home page Coder Social logo

panzuanxin / autordf2gml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidlamprecht/autordf2gml

0.0 0.0 0.0 5.26 MB

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).

License: MIT License

Python 100.00%

autordf2gml's Introduction

AutoRDF2GML

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 AutoRDF2GML

Overview of AutoRDF2GML

To 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.

Setting Content-based Node Features

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.

Setting Topology-based Node Features

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.

Example

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.

Use-Case: Transform SemOpenAlex-SemanticWeb

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.

Use-Case: Transform Linked Papers With Code

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 .

Requirements

AutoRDF2GML is implementet in Python. The needed requirements are defined in requirements.txt.

autordf2gml's People

Contributors

davidlamprecht avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.