different output from rdflib SPARQL query when using initBindings
问题 I've been trying to run a query on rdflib graph (loaded with schema.rdfa from schema.org ) to find the ancestors. E.g. As per Schema for Corporation the ancestors are Thing > Organization > Corporation This code works perfectly, giving me the output I desire, except that it does not use initBindings and I have to format the query string. import rdflib subject = rdflib.term.URIRef('http://schema.org/Corporation') inplace_query = ''' SELECT ?class where { <%(subject_uri)s> rdfs:subClassOf* ?mid