Modifica di
Tematiche di genere:How to use data on Wikimedia projects
Jump to navigation
Jump to search
Attenzione:
non hai effettuato l'accesso. Se effettuerai delle modifiche il tuo indirizzo IP sarà visibile pubblicamente. Se
accedi
o
crei un'utenza
, le tue modifiche saranno attribuite al tuo nome utente, insieme ad altri benefici.
Controllo anti-spam.
NON
riempirlo!
<languages/> <translate> <!--T:1--> Data from Wikidata can be directly displayed on Wikimedia projects, with different methods. With the parser function or Lua code, it is possible to display labels, descriptions, values, references, and a lot of other information stored on Wikidata.</translate> <translate><!--T:60--> For an overview of uses on Wikidata on Wikimedia projects see <tvar|link>{{ll|Wikidata:Wikidata in Wikimedia projects}}</>. <!--T:2--> On this page, you will learn how to use Wikidata data on your wiki. You can also learn more about [[<tvar|what>Special:MyLanguage/Wikidata:Introduction</>|what is Wikidata]], [[<tvar|about>Special:MyLanguage/Help:About_data</>|how the information is organized]], or [[<tvar|glossary>Special:MyLanguage/Wikidata:Glossary</>|browse the glossary]]. ==Can I access Wikidata data from my wiki?== <!--T:3--> <!--T:4--> The two main client functionalities, parser function and access via Lua, can be enabled together on the wikis of the Wikimedia projects. This is the case for almost all Wikimedia projects now. <!--T:5--> To check if these functionalities are activated on a wiki, you can access the page <code>Special:Version</code>. In the section "Parser function hooks", if "statements" appears in the list, that means that you can use it on this wiki. <!--T:6--> The access to Wikidata data is currently restricted to the Wikimedia projects, because of technical limitations. If you have your own instance of MediaWiki, you can't use Wikidata's data using these features. However, you can set up your own Wikibase instance and use data from there in the same way. == Parser function == <!--T:7--> <!--T:8--> The first way to access data is to use the <code>#statements</code> parser function. This function will allow you to display the value of any statement included in an item. </translate> [[{{lm|Datamodel in Wikidata|svg}}|500px|<translate><!--T:9--> Diagram of a Wikidata datamodel.</translate>|thumb]] <translate> ===Direct access=== <!--T:10--> <!--T:11--> On a page that is connected to a Wikidata item via the interwiki links, you can use the function by adding the label of the property you want in your language or the P-number of the property. The code has to be added in the wikicode. <!--T:12--> Examples: * <code><nowiki>{{#statements:member of political party}}</nowiki></code> or <code><nowiki>{{#statements:P102}}</nowiki></code> will return the "member of political party" value. * <code><nowiki>{{#statements:discoverer or inventor}}</nowiki></code> or <code><nowiki>{{#statements:P61}}</nowiki></code> will return the "discoverer or inventor" value. * On [[w:en:Douglas Adams|w:en:Douglas Adams]], the code <code><nowiki>{{#statements:country of citizenship}}</nowiki></code> will display "United Kingdom". ===Arbitrary access=== <!--T:13--> <!--T:14--> You can also display data from an item that is not connected via an interwiki link. For this, you use the same function, adding a parameter <code>from=</code> followed by the Q-id of the item. <!--T:15--> Examples: * <code><nowiki>{{#statements:birth name|from=Q42}}</nowiki></code> will display "{{#statements:birth name|from=Q42}}" * <code><nowiki>{{#statements:country of citizenship|from=Q42}}</nowiki></code> will display "{{#statements:country of citizenship|from=Q42}}". * <code><nowiki>{{#statements:P1476|from=Q191380}}</nowiki></code> will display "{{#statements:P1476|from=Q191380}}" * <code><nowiki>{{#statements:author|from=Q191380}}</nowiki></code> will display "{{#statements:author|from=Q191380}}" * <code><nowiki>{{#statements:publication date|from=Q191380}}</nowiki></code> will display "{{#statements:publication date|from=Q191380}}" ===Multiple values=== <!--T:16--> <!--T:17--> When a statements has multiple values, the parser function will show the "best" value, which means: * only show the [[<tvar|ranking1>Special:MyLanguage/Help:Ranking</>|preferred value(s)]] if there are any * if not, shows all the values * but never the [[<tvar|ranking2>Special:MyLanguage/Help:Ranking</>|deprecated]] ones <!--T:18--> Example: <code><nowiki>{{#statements:occupation|from=Q42}}</nowiki></code> displays "{{#statements:occupation|from=Q42}}" (there are other occupations in {{Q|42}} but only some are preferred) ===Formatted values=== <!--T:19--> <!--T:20--> For some properties, the #statements parser function will display the value in a specific format. <!--T:21--> ;Commons images The parser function displays a thumbnail preview of the image, resizing it to 200 pixels. It links to the Wikimedia Commons file description page. <!--T:22--> <tvar|code><code><nowiki>{{#statements:image|from=Q42}}</nowiki></code></> displays </translate> {{#statements:image|from=Q42}} <translate> <!--T:23--> ;Geo coordinates The parser function displays the coordinates in degree-minute-second format. <!--T:24--> <tvar|code><code><nowiki>{{#statements:coordinate location|from=Q243}}</nowiki></code></> displays <tvar|result><code>{{#statements:coordinate location|from=Q243}}</code></> <!--T:25--> ;Monolingual text The parser function displays the highest ranked string, or the concatenation of all the values. <!--T:26--> <tvar|code><code><nowiki>{{#statements:native label|from=Q31}}</nowiki></code></> displays "<tvar|result><code>{{#statements:native label|from=Q31}}</code></>". <!--T:27--> ;Date The date value will be formatted in day-month-year format. <!--T:28--> <tvar|code><code><nowiki>{{#statements:date of birth|from=Q42}}</nowiki></code></> displays <tvar|result><code>{{#statements:date of birth|from=Q42}}</code></> <!--T:29--> ;Links The links are clickable. <!--T:30--> <tvar|code><code><nowiki>{{#statements:official website|from=Q243}}</nowiki></code></> displays <tvar|result><code>{{#statements:official website|from=Q243}}</code></> <!--T:31--> ;External IDs An external ID will provide a direct link to the external website. <!--T:32--> <tvar|code><code><nowiki>{{#statements:IMDb ID|from=Q42}}</nowiki></code></> displays <tvar|result><code>{{#statements:IMDb ID|from=Q42}}</code></> <!--T:33--> ;Items === Raw value === <!--T:61--> <!--T:62--> To display the unlinked value, use <tvar|code><code>#property</code></>. <!--T:63--> Sample: <!--T:64--> <tvar|code><code><nowiki>{{#property:IMDb ID|from=Q42}}</nowiki></code></> displays <tvar|result><code>{{#property:IMDb ID|from=Q42}}</code></> ==Modules== <!--T:34--> <!--T:35--> Data can also be accessed with Lua modules, which are much more flexible. Modules that access data from Wikidata should be organized as instance of {{Q|Q59259626}}. For instance, {{Q|12069631}} is available on many wikis, see [[<tvar|module>w:{{int:Lang}}:Module:Wikidata#Usage</>|w:Module:Wikidata#Usage]] for usage instruction. If your wiki does not contain a module you can copy it from another wiki and add documentation. <!--T:65--> For a full technical reference of Lua functions for accessing Wikidata, see <tvar|1>[[:mw:Extension:Wikibase Client/Lua]]</>. == Templates == <!--T:37--> <!--T:38--> Some templates use modules to access Wikidata data. They are as simple to use as regular templates. Moreover, using Wikidata, some parameters become unnecessary. For instance, some infoboxes are able to retrieve data from Wikidata, so you just have to insert the template and all the data will magically appear (if the needed information is present on the Wikidata item, of course). For templates using Wikidata see {{Q|Q11985372}}. <!--T:39--> If you want to create a template on your wiki, check your documentation page about Module:Wikidata and already existing templates. == Lists == <!--T:40--> === Regularly updated lists === <!--T:41--> <!--T:42--> Daily updated lists based on SPARQL queries can be configured using {{Q|19860885}}. Content is replaced daily. <!--T:43--> There are essentially two uses: *Work lists: lists with topics to be covered in project namespace. Results can be limited to topics that don't exist. *Reference list: lists for a specific topic in article namespace. <!--T:44--> This is currently the most efficient way of doing lists. === Dynamic lists === <!--T:45--> <!--T:46--> Content is displayed from various items based on a selection done in a Lua module. === Manual lists === <!--T:47--> <!--T:48--> A series of items are selected and their properties displayed in an article. Content from Wikidata can be completed with locally edited text. ==Examples of use cases== <!--T:49--> === Magic infobox === <!--T:50--> <!--T:51--> A call of the general cheese infobox template [[<tvar name="cheese">:fr:Modèle:Infobox Fromage</tvar>]] without any parameters, on an article about a type of cheese, for example [[:fr:Reblochon]], produces an infobox with details about that type of cheese, using data from the Wikidata item linked to the article. === Commons === <!--T:53--> <!--T:54--> [[<tvar|creator>c:Template:Creator</>|Commons creator template]] uses Wikidata with arbitrary access to provide information about the creators of the works. === Graph === <!--T:55--> === Authority model === <!--T:56--> === Wikisource === <!--T:57--> == How to find help ? == <!--T:58--> <!--T:59--> You will find contributors on the [[<tvar|chat>Special:MyLanguage/Wikidata:Project chat</>|Wikidata project chat]] which exists in different languages. Moreover, some wikis have projects dedicated to Wikidata : see {{Q|Q20855878}}. </translate> {{Translation categories}} {{#if:{{#translation:}}|| [[category:How to guides]] }}
Oggetto:
Per favore tieni presente che tutti i contributi a Tematiche di genere si considerano pubblicati nei termini d'uso della licenza Creative Commons Attribuzione-Condividi allo stesso modo (vedi
Tematiche di genere:Copyright
per maggiori dettagli). Se non desideri che i tuoi testi possano essere modificati e ridistribuiti da chiunque senza alcuna limitazione, non inviarli qui.
Inviando il testo dichiari inoltre, sotto tua responsabilità, che è stato scritto da te personalmente oppure è stato copiato da una fonte di pubblico dominio o similarmente libera.
Non inviare materiale protetto da copyright senza autorizzazione!
Annulla
Guida
(si apre in una nuova finestra)
Template utilizzati in questa pagina:
Template:CURRENTCONTENTLANGUAGE
(
modifica
)
Template:Ll
(
modifica
)
Template:Lm
(
modifica
)
Template:Localized media
(
modifica
)
Template:PDT
(
modifica
)
Template:Q
(
modifica
)
Template:Translation categories
(
modifica
)
Template:Wikidata entity link
(
modifica
)
Modulo:Template translation
(
modifica
)
Modulo:Wd
(
modifica
)
Modulo:Wd/i18n
(
modifica
)
Menu di navigazione
Strumenti personali
Accesso non effettuato
discussioni
contributi
entra
Namespace
Pagina di servizio
Discussione
italiano
Visite
Leggi
Modifica sorgente
Cronologia
Altro
Ricerca
Navigazione
Pagina principale
Ultime modifiche
Categorie
Principali Categorie
Pagine orfane
Pagine prive di categorie
Semantic Ask
Una pagina a caso
Aiuto su MediaWiki
Modifica Sidebar
Strumenti
Puntano qui
Modifiche correlate
Carica un file
Pagine speciali
Informazioni pagina