Modifica di
Tematiche di genere:How to use data on Wikimedia projects
(sezione)
Vai alla navigazione
Vai alla ricerca
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!
== 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></>
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)
Menu di navigazione
Strumenti personali
Accesso non effettuato
discussioni
contributi
entra
Namespace
Pagina di servizio
Discussione
italiano
Visite
Leggi
Modifica sorgente
Cronologia
Altro
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