RDFLib graphs support an additional extension of RDF semantics for formulae. For the academically inclined, Graham Kyles formal extension is probably a good read.
Formulae are represented formally by the rdflib.Graph.QuotedGraph class and are disjoint from regular RDF graphs in that their statements are quoted.