Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente |
informatique:wikidata [24/09/2016 17:24] – [Technique] cyrille | informatique:wikidata [18/03/2018 09:12] (Version actuelle) – [Exemple de requêtes] cyrille |
---|
* [[https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries|Wikidata:SPARQL query service/queries]] | * [[https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries|Wikidata:SPARQL query service/queries]] |
* [[https://meta.wikimedia.org/wiki/Wikidata/Development/RDF|Wikidata/Development/RDF]] | * [[https://meta.wikimedia.org/wiki/Wikidata/Development/RDF|Wikidata/Development/RDF]] |
| * [[http://tools.wmflabs.org/wikidata-todo/around.html|wikidata-todo around]] |
| |
| Sur IRC: [[https://webchat.freenode.net/?channels=#wikidata|#wikidata]] |
| |
| Outils: |
| * [[https://query.wikidata.org/|Wikidata Query Service]] on peut directement requéter. Il propose même un rendu des résultats sur une carte ([[http://tinyurl.com/hpldolz|exemple]]). |
| * [[http://tools.wmflabs.org/reasonator|Reasonator]] |
| |
| ==== Technique ==== |
| |
| * [[https://github.com/Wikidata/Wikidata-Toolkit|Wikidata Toolkit]] is a Java library for accessing Wikidata and other Wikibase installations. It can be used to create bots, to perform data extraction tasks (e.g., convert all data in Wikidata to a new format), and to do large-scale analyses that are too complex for using a simple SPARQL query service. |
| |
===== Projets ===== | ===== Projets ===== |
| |
| |
==== Exemple de requêtes ==== | ===== Exemple de requêtes ===== |
| |
* [[http://blog.ash.bzh/wikidata-sparql-et-dynasties-electives/|Wikidata, SPARQL et dynasties électives]] | * [[http://blog.ash.bzh/wikidata-sparql-et-dynasties-electives/|Wikidata, SPARQL et dynasties électives]] |
* [[http://histropedia.com/blog/descendants-timeline-tutorial-part-2-2/|Descendants timeline tutorial Part 2: Combining Wikidata query statements]] | * [[http://histropedia.com/blog/descendants-timeline-tutorial-part-2-2/|Descendants timeline tutorial Part 2: Combining Wikidata query statements]] |
| |
Avec l'outil Wikidata Query on peut directement requéter. Il propose même un rendu des résultats sur une carte. | Les châteaux d'eau affichés sur une carte [[http://tinyurl.com/hpldolz|short link]] : |
<code sparql> | <code sparql> |
# Châteaux d'eau sur une carte: | # Châteaux d'eau sur une carte. |
#defaultView:Map | #defaultView:Map |
SELECT ?image ?itemLabel ?item ?coord WHERE { | SELECT ?image ?itemLabel ?item ?coord WHERE { |
ORDER BY ?item | ORDER BY ?item |
LIMIT 20 | LIMIT 20 |
| </code> |
| |
| Liste des communes d'Indre-et-Loire avec leur coordonnées géographiques ([[http://tinyurl.com/ya7xx3y2|essayer la requête]]): |
| <code sparql> |
| PREFIX psv: <http://www.wikidata.org/prop/statement/value/> |
| |
| SELECT DISTINCT ?a ?aLabel ?lat ?long WHERE { |
| ?a wdt:P131+ wd:Q12556. |
| ?a wdt:P31 wd:Q484170. |
| ?a p:P625 ?statement. |
| ?statement psv:P625 ?coordinate_node. |
| ?coordinate_node wikibase:geoLatitude ?lat. |
| ?coordinate_node wikibase:geoLongitude ?long. |
| SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". } |
| } |
</code> | </code> |
| |