import RDF # Load Redland m = RDF.Model() # Create a model to store our data p = RDF.Parser() # create a parser p.parse_into_model(m, "http://crschmidt.net/foaf.rdf") # Parse the data into the model so we can use it q = RDF.SPARQLQuery("SELECT ?b ?c WHERE { ?b ?c. } ") # Create a query res = q.execute(m) # execute the query on our model, m print res # Print the XML formatted results