Redigerer
Modul:WikidataIB/dok
(avsnitt)
Hopp til navigering
Hopp til søk
Advarsel:
Du er ikke innlogget. IP-adressen din vil bli vist offentlig om du redigerer. Hvis du
logger inn
eller
oppretter en konto
vil redigeringene dine tilskrives brukernavnet ditt, og du vil få flere andre fordeler.
Antispamsjekk.
Ikke
fyll inn dette feltet!
=== Ranks === The {{para|rank}} parameter, when set to preferred, returns only preferred values; when set to normal, returns only normal values; when set to deprecated, returns only deprecated values. If the parameter is set to best, it returns preferred values if present, otherwise normal values. Any parameter value beginning with "p" is "preferred"; any parameter value beginning with "n" is "normal"; any parameter value beginning with "d" is "deprecated"; any parameter value beginning with "b" is "best". Combinations of values are allowed, e.g. {{para|rank|p n}} returns all the preferred and normal values (which is the default), although "best" overrides any other parameters. ==== Specific value-type handlers ==== The module has specific handlers for the following data types: # Items that correspond to an article in some Wikipedia, called "wikibase-items". These will be linked to the corresponding (and disambiguated) article on English Wikipedia where possible. # Items that represent dates. These may be centuries, years, years and months, or years, months and days. # Items that represent Commons media, urls, external ids, or other sorts of plain text. # Items that represent quantities. All of these may have an associated unit, or be dimensionless, and may have a range. # Items that represent global coordinates. These will be in degrees of latitude and longitude and will have an associated precision. Items that represent other types of data are not handled at present. ==== Modifying the returned items ==== Wikibase-items and plain text data types may be used with the parameters: * {{para|prefix}}, {{para|postfix}}, {{para|linkprefix}}, {{para|linkpostfix}} If you don't supply at least one of {{para|linkprefix}} or {{para|linkpostfix}}, then just {{para|prefix}} and {{para|postfix}} are used. For example, when getting the {{P|P717}} in {{Q|Q532127|}}: * <code><nowiki>{{#invoke:WikidataIB|getValue|P717|fetchwikidata=ALL|onlysourced=no |prefix="textbefore " |postfix=" textafter" |qid=Q532127}}</nowiki></code> → {{#invoke:WikidataIB |getValue |P717 |fetchwikidata=ALL|onlysourced=no |prefix="textbefore " |postfix=" textafter" |qid=Q532127}} Use double-quotes to enclose the parameter value if it has leading or trailing spaces (otherwise they are stripped out). If you supply {{para|linkprefix}} or {{para|linkpostfix}}, then all four parameters are used and a link is made for each value like this: * <code><nowiki>[[ linkprefix LinkValue1 linkpostfix | prefix PropertyValue1 postfix]], [[ linkprefix LinkValue2 linkpostfix | prefix PropertyValue2 postfix]], etc.</nowiki></code> That allows multiple links to be made to different sections of a list article, such as [[:en:List of observatory codes]]. For example, when getting the {{P|P717}} in {{Q|Q532127|}} we can make the links: *<code><nowiki>{{#invoke:WikidataIB|getValue|P717|fetchwikidata=ALL|onlysourced=no |prefix= |postfix= |linkprefix=":en:List of observatory codes#" |linkpostfix= |qid=Q532127}}</nowiki></code> → {{#invoke:WikidataIB|getValue|P717|fetchwikidata=ALL|onlysourced=no |prefix= |postfix= |linkprefix=":en:List of observatory codes#" |linkpostfix= |qid=Q532127}} This also finds use where we want to suppress categorisation and simply display a link to a category by using ":" as the linkprefix: * <code><nowiki>{{#invoke:WikidataIB |getValue |P26 |qid=Q151973 |fwd=ALL |osd=no |maxvals=1 |linkprefix=":"}}</nowiki></code> → {{#invoke:WikidataIB |getValue |P26 |qid=Q151973 |fwd=ALL |osd=no |maxvals=1 |linkprefix=":"}} Whereas <code><nowiki>{{#invoke:WikidataIB |getValue |P26 |qid=Q151973 |fwd=ALL |osd=no |maxvals=1}}</nowiki></code> would place the page in the [[:Category:Elizabeth Taylor]] ==== Formatting multiple returned values ==== * {{para|sorted|<yes{{!}}no>}} is a boolean passed to enable sorting of the values returned. No parameter, or an empty string, or "false", or "no", or "0" disables sorting. It's only a very dumb alphabetical sort and sorts linked values as "[[ ..." * {{para|sep|<separator characters>}} allows the separator between multiple returned values to be defined. The default is <code>", "</code> (comma plus normal space). If the separator has leading or trailing spaces, enclose it in double quotes (e.g. {{para|sep|" - "}}). Any double quotes are stripped from the separator. The pipe character (<code>|</code>) must be escaped as <code><nowiki>{{!}}</nowiki></code>. For reasons of accessibility (see [[MOS:PLIST]]), do not use {{para|sep|<br>}} for vertical unbulleted lists; use {{para|list|ubl}} instead. * {{para|list|<hlist{{!}}ubl>}} allows multiple returned values to be displayed as a horizontal list ({{para|list|hlist}}), or a vertical unbulleted list ({{para|list|ubl}}). These override the separator and do not display the 'pen icon' linked to "Edit at Wikidata"
Redigeringsforklaring:
Merk at alle bidrag til Wikisida.no anses som frigitt under Creative Commons Navngivelse-IkkeKommersiell-DelPåSammeVilkår (se
Wikisida.no:Opphavsrett
for detaljer). Om du ikke vil at ditt materiale skal kunne redigeres og distribueres fritt må du ikke lagre det her.
Du lover oss også at du har skrevet teksten selv, eller kopiert den fra en kilde i offentlig eie eller en annen fri ressurs.
Ikke lagre opphavsrettsbeskyttet materiale uten tillatelse!
Avbryt
Redigeringshjelp
(åpnes i et nytt vindu)
Navigasjonsmeny
Personlige verktøy
Ikke logget inn
Brukerdiskusjon
Bidrag
Opprett konto
Logg inn
Navnerom
Modul
Diskusjon
norsk bokmål
Visninger
Les
Rediger kilde
Vis historikk
Mer
Søk
Navigasjon
Forside
Siste endringer
Tilfeldig side
Hjelp til MediaWiki
Spesialsider
Verktøy
Lenker hit
Relaterte endringer
Sideinformasjon
På andre prosjekter