Shortcuts: WD:WDQ, WD:WDQS, WD:SPARQL
Wikidata:Servicio de consultas SPARQL
Jump to navigation
Jump to search
Outdated translations are marked like this.
Qué es SPARQL
SPARQL (pronunciado como sparkle en inglés, palabra que significa "destello") es un lenguaje de consulta RDF, es decir, un lenguaje de consulta semántica para bases de datos. Wikidata proporciona desde septiembre de 2015 un extremo SPARQL que incluye una interfaz web gráfica. Con SPARQL puedes extraer cualquier tipo de datos mediante una consulta compuesta de combinaciones lógicas de ternas.
- Interfaz gráfica del servicio de consulta SPARQL: https://query.wikidata.org
- Extremo SPARQL: https://query.wikidata.org/bigdata/namespace/wdq/sparql?query={SPARQL}
Aprender SPARQL
![](http://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/SparQL_-_Wikidata_-_%C3%89cole_de_Biblioth%C3%A9caires_Documentalistes_-_2016-04-04.pdf/page1-220px-SparQL_-_Wikidata_-_%C3%89cole_de_Biblioth%C3%A9caires_Documentalistes_-_2016-04-04.pdf.jpg)
Portal de ayuda
- Portal de ayuda del Servicio de Consultas de Wikidata
- Wikidata:SPARQL query service/queries
- Queries from Wikidata status update weekly summaries
Otros recursos
- SPARQL in 11 minutes (video, English)
- SPARQL Tutorial at the Apache Jena website (English)
- 2016 SPARQL Workshop presented by the Wikimedia Foundation (English)
- Querying Wikidata with SPARQL for Absolute Beginners, 2-hour video tutorial (English)
- Wikidata:SPARQL tutorial (multiple languages)
- Query optimization
- Query limits
{{Item documentation}}
and other generic queries templates
Interconexión
Las consultas SPARQL puede enviarse directamente al extremo SPARQL endpoint con una petición GET a https://query.wikidata.org/bigdata/namespace/wdq/sparql?query={SPARQL}. Devuelve el resultado como XML por defecto, o como JSON si se indica en el parámetro de consulta format=json
o en la cabecera Accept: application/sparql-results+json
.
- Script R ([1]) que traza el contenido de Wikidata en un mapa del mundo en R (Andra Waagmeester, [2]).
- Ejemplo en Python, cómo realizar un trazado de las causas de muerte de los presidentes de los Estados Unidos.
- R package WikidataQueryServiceR which queries the WDQS SPARQL endpoint and returns data.frames
- R script (https://gist.github.com/andrawaag/2b8c831ab4dd70b16cf2) that plots Wikidata content on a world map in R. (Andra Waagmeester, https://lists.wikimedia.org/pipermail/wikidata/2015-September/007080.html)
- Python example, how to make a plot of causes of death for U.S. Presidents
- An example of using SPARQLWrapper library to query WDQS in Python: https://people.wikimedia.org/~bearloga/notes/wdqs-python.html
- An example using the Apache Jena command line tools. (This is useful e.g. for very large SPARQL statements with +2000 lines which WDQS UI currently cannot handle properly because of the parsing, or e.g., for scripting a batch of queries to run every week (via cron) and report the results by email)
- http://tools.wmflabs.org/wdq2sparql/w2s.php Convierte la sintaxis de consultas WDQ a SPARQL (por Stas Malyshev).
- Genera trazados para los resultados copiando y pegando las consultas a http://demo.seco.tkk.fi/visu ― algunos ejemplo por User:Pyb: estados de Estados Unidos por fecha de creación, recuento de los enterramientos en el cementerio Père Lachaise por año, fechas de nacimiento de 2000 centenarios.
Wikimedia SPARQL query services
Human interface | Machine's endpoint | Description |
---|---|---|
https://query.wikidata.org/sparql
|
Run SPARQL Queries upon the Wikidata Wikibase instance. Run, test, download the data as XML, JSON, CSV, or TSV. Has advanced user-friendly features such as: word hovering to see a term's meaning, code optimization, etc. | |
https://commons-query.wikimedia.org/sparql
|
Run SPARQL Queries upon the Wikimedia Commons Wikibase instance. | |
https://lingualibre.org/sparql
|
Run SPARQL Queries upon the LinguaLibre Wikibase instance. Run, test, download the data as XML, JSON, CSV, or TSV. |
Estadísticas