# --- # had to install rdflib using "pip rdflib" # see https://rdflib.readthedocs.org/en/latest/gettingstarted.html import rdflib # this is Python's built-in XML processor import xml.etree.ElementTree as etree # results.xml is the SPARQL results file that I saved after querying for GeoNames IRIs tree = etree.parse('results.xml') # I searched the XML to find the uri elements, then put them in an array resultsArray=tree.findall('.//{http://www.w3.org/2005/sparql-results#}uri') #builtGraph is where I'm going to accumulate triples that I've scraped builtGraph=rdflib.Graph() #addedGraph contains triples that I got from a particular GeoNames RDF file addedGraph=rdflib.Graph() fileIndex=0 while fileIndex