Querying Wikidata with SPARQL
SPARQL is a query language for retrieving data from knowledge graphs like Wikidata. If you’ve used SQL to query databases, SPARQL follows a similar logic – but instead of rows and columns, you’re working with linked triples: subject, predicate, object.
For this project, we used SPARQL to pull structured data about Black artists in Philadelphia from Wikidata’s public endpoint at query.wikidata.org.
A Basic Query
Here’s a minimal query that retrieves artists tagged with the PMA’s African American artist entity (Q94124522):