I'm using rdflib to load an RDF graph into a Python scrpit I would like to print a list of subjects using the defined prefixes I doesn't find any method to apply the prefixes. My code
import rdflib
filepath = "... my file path ..."
gs = rdflib.Graph()
gs.bind('qs', "http://qs.org/")
gs.bind('foaf',"http://xmlns.com/foaf/0.1/")
gs.parse(filepath,format="nt")
mdstr = ""
for subject in gs.subjects():
mdstr += str(subject) +"\n"
print(mdstr)
I get, for example http://qs.org/s12095 in place of qs:s12095