IT'S TRICKY to find out how to set up RDFLib Graph to use a RDBS backend, but it can be done using SQLAlchemy and RDFLib-SQLAlchemy. This means it'll support all the engines SQLAlchemy does, including MySQL and Postgres. I'll highlight two gotchas to look out for when using RDFLib-SQLAlchemy and walk you through getting setup using a wrapper class to RDFLIB Graph.
USE THE internet as a database. Across the internet, some generous providers make their data available not only as RDF/OWL, but via a SPARQL endpoint that you can send queries to. It's like an API, but instead of getting a response with all the data the developer thought you might like, you get the results of the query you want. It's even possible to query across multiple endpoints in a single query. SPARQL is similar enough to SQL to be easy to learn. In this post, we start out looking at SELECT queries against DBpedia.