SPARQL

SPARQL (pronounced "sparkle") is an RDF query language, that is, a semantic query language for databases.

See here for the SPARQL query services that have been set up:
 * Wikidata Query Service - Wikidata
 * Commons Query Service - Wikimedia Commons