The intent of this post is to show those inexpert in SPARQL but curious about capabilities how much can be done with it within the Wolfram Language. My specific quest is to generate a timeline of chief justices of the United States Supreme Court but, in the course of doing so, to share some learning about SPARQL and Wikidata.
The main insight is to exploit the many examples of SPARQL code at the Wikidata query site, find one that is relevant, and then use ImportString[#,"SPARQLQuery"]& to generate symbolic SPARQL within the Wolfram Language. Once that's done, we can use core Wolfram Language tools to modify the code for the specific task at hand and then run it against the Wikidata "endpoint." Once the results come back from Wikidata, some basic Wolfram Language code generates a nice timeline with relative ease.