Apri il menu principale
Pagina principale
Una pagina a caso
entra
Impostazioni
Informazioni su Tematiche di genere
Avvertenze
Tematiche di genere
Ricerca
Modifica di
Modulo:Wikidata/doc
(sezione)
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!
== Usage == === Example: spouse (P26) === * <code><nowiki>{{#invoke:Wikidata|getValue|P26|}}</nowiki></code> = returns nothing, so suppresses the display of spouse in an infobox * <code><nowiki>{{#invoke:Wikidata|getValue|P26|FETCH_WIKIDATA}}</nowiki></code> = returns the linked value(s) of property P26 (spouse) stored in wikidata for the corresponding article (e.g. for article [[Bill Clinton]], it returns [[Hillary Clinton]]) * <code><nowiki>{{#invoke:Wikidata|getValue|P26|[[Hillary Rodham Clinton]]}}</nowiki></code> = returns [[Hillary Rodham Clinton]], allowing an infobox to use a local value rather than the value stored in Wikidata. === Example in Infobox template === Inside an infobox definition, it may be called like this: * <code><nowiki>| data55 = {{#invoke:Wikidata|getValue|P26|{{{spouse|FETCH_WIKIDATA}}} }}</nowiki></code> which causes the infobox to: # not display spouse if the infobox parameter <code>|spouse</code> is set to be blank (as <code>"| spouse ="</code>} # display the linked value(s) from Wikidata if the infobox parameter <code>|spouse</code> is not supplied # display the local infobox parameter <code>|spouse</code> if it is supplied (e.g. <code>"|spouse = Hillary Rodham Clinton"</code>) Optionally, it could be called as: * <code><nowiki>| data55 = {{#invoke:Wikidata|getValue|P26|{{{spouse|}}} }}</nowiki></code> which causes the infobox to: # not display spouse if the infobox parameter <code>|spouse</code> is set to be blank (as <code>"| spouse ="</code>} # not display spouse if the infobox parameter <code>|spouse</code> is not supplied # display the local infobox parameter <code>|spouse</code> if it is supplied (e.g. <code>"|spouse = Hillary Rodham Clinton"</code>) # display the linked value(s) from Wikidata if the infobox parameter is locally set to FETCH_WIKIDATA See [[Module:WikidataIB]] for a modification that allows fields, on a per article basis, to be blacklisted so that they never display. It also allows the editor to specify, on a per article basis, which fields may be automatically fetched from Wikidata when local parameter is supplied; the default is none, allowing an infobox to be modified to accept Wikidata without any change in the articles using the infobox until the functionality is enabled in the article. === Example:birth place === This works in just the same way as the calls above: * <code><nowiki>{{#invoke:Wikidata|getValue|P19|}}</nowiki></code> = returns nothing, so suppresses the display of birth place in an infobox * <code><nowiki>{{#invoke:Wikidata|getValue|P19|FETCH_WIKIDATA}}</nowiki></code> = returns the linked value(s) of property P19 (place of birth) stored in wikidata for the corresponding article (e.g. for article [[Bill Clinton]], it returns [[Hope, Arkansas]]) * <code><nowiki>{{#invoke:Wikidata|getValue|P19|[[Hope, Arkansas|Hope]]}}</nowiki></code> = returns [[Hope, Arkansas|Hope]], allowing an infobox to use a local value rather than the value stored in Wikidata. === Example:gender === We don't want the returned value linked, so use: * - <code><nowiki>{{#invoke:Wikidata|getRawValue|P21|FETCH_WIKIDATA}}</nowiki></code> === Example:date of birth === If we want the date of birth in dmy format, we use: * - <code><nowiki>{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|dmy}}</nowiki></code> If we want the date of birth in mdy format, we use: * - <code><nowiki>{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|mdy}}</nowiki></code> If we want a year of birth, we use: * - <code><nowiki>{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y}}</nowiki></code> If we want a year of birth that may be BC, but should read "BCE", we use: * - <code><nowiki>{{#invoke:Wikidata|getDateValue|P569|FETCH_WIKIDATA|y|BCE}}</nowiki></code> === Example: Linking to Wikidata item === Use the following code to just retrieve the Q-ID: * - <code><nowiki>{{#invoke:Wikidata|pageId}}</nowiki></code> Linking to Wikidata used the usual Wiki markup: * - <code><nowiki>[[d:{{#invoke:Wikidata|pageId}}|Name of Link]]</nowiki></code> === Example: Linking to another wiki page === Use code like this to link to another wiki. English Wikivoyage in the example: * - <code><nowiki>[[voy:{{#invoke:Wikidata|getSiteLink|enwikivoyage}}|Name of Link]]</nowiki></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)