RdfPandas is a module providing RDF support for Pandas. It consists of two simple functions for graph conversion, one is to create DataFrame from RDFLib Graph data, and another one to create Graph data from DataFrame.
The graph data can then be serialized using RDFLib serialize method on the graph.
For more information about Resource Description Framework (RDF) and Pandas see:
- RDF: https://www.w3.org/RDF/
- Pandas: https://pandas.pydata.org/
You will need Python 3 to use Pandas and RdfPandas.
pip install rdfpandas
import rdfpandas as pd import rdflib df = pd.DataFrame() g = to_graph(df) s = g.serialize(format='turtle')