I have lists of literals that I would like to add as rdf:lists to a graph. I can read rdf:lists without issue using rdflib.collection.Collection, but I haven't been able to add those lists to other graphs, or iteratively generate an rdf:list from a python list.
Does rdflib have any functionality like this?
Update: I went back through the docs and found a solution using Collection.
from rdflib.graph import Graph, BNode, Collection, Literal, RDF, Namespace
listName = BNode()
EX = Namespace('http://www.example.org/')
g.bind('ex', EX)
g = Graph()
listo = [1,2,356,4]
c = Collection(g,EX.name,[Literal(x) for x in listo])