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!
== Overview == The module provides these calls specifically for use in infoboxes at present: # <code>getValue</code> - main call, used to get the value(s) of a given property # <code>getQualifierValue</code> - given: (1) a property; (2) its value; (3) a qualifier's propertyID, returns values which match # <code>getValueByQual</code> gets the value of a property which has a qualifier with a given entity value # <code>getValueByLang</code> gets the value of a property which has a qualifier P407("language of work or name") whose value has the given language code # <code>getValueByRefSource</code> gets the value of a property which has a reference "stated in" (P248) whose value has the given entity-ID # <code>getPropOfProp</code> if the value(s) of prop1 are of type "wikibase-item" then it returns the value(s) of prop2 of each of those wikibase-items # <code>getAwardCat</code> if the item has values of P166 (award received), then it examines each of those awards for P2517 (category for recipients of this award) and it returns the corresponding category, with the item's P734 (family name) as sort key, or no sort key if there is no family name # <code>getIntersectCat</code> for each value of the prop1 it fetches the value's main category and then each value of prop2, then it returns all of the categories representing the intersection of those properties # <code>getSumOfParts</code> scans the property 'has part' (P527) for values matching a list, If the matched values have a qualifier 'quantity' (P1114), those quantities are summed and returned (but zero returns nil) # <code>getCoords</code> - gets coordinates and passes them through Template:Coord The obsolete call getSourcedValue has now been removed as it is redundant to getValue which can do the same job using the {{para|onlysourced|true}} parameter (which is set by default). The deprecated call getPreferredValue is still retained, but should be replaced by <code>getValue|rank=best</code>. There are also these utility calls: # <code>getLink</code> if there is a sitelink to an article on the local Wiki, it returns a link to the article with the Wikidata label as the displayed text. If there is no sitelink, it returns the label as plain text. If there is no label in the local language, it returns the entity-ID # <code>getAT</code> (Article Title) If there is a sitelink to an article on the local Wiki, it returns the sitelink as plain text, otherwise nothing # <code>getSiteLink</code> gets the plain text link to an article on a given wiki # <code>getLabel</code> returns the Wikidata label for the local language as plain text. If there is no label in the local language, it returns the entity-ID # <code>getAllLabels</code> fetches the set of labels and formats it for display as wikitext # <code>labelorid</code> returns the label with all wikitext removed, or the entity-ID if no label # <code>getDescription</code> returns the article description for the Wikidata entity if the local parameter is "Wikidata". # <code>getAllDescriptions</code> fetches the set of descriptions and formats it for display as wikitext # <code>getAliases</code> returns the aliases for the entity in the current or given language # <code>getAllAliases</code> fetches the set of aliases and formats it for display as wikitext # <code>pageId</code> returns the connected Wikidata page id (entity-ID, Q-number) of the current page # <code>formatDate</code> takes a datetime of the usual format from mw.wikibase.entity:formatPropertyValues and formats it according to the df (date format) and bc parameters # <code>formatNumber</code> formats a number according to the supplied language code # <code>checkBlacklist</code> returns true if the field is ''not'' blacklisted (i.e. allowed) # <code>emptyor</code> returns nil if the parameter is just punctuation, whitespace or html tags, otherwise returns the argument unchanged # <code>getLang</code> returns the MediaWiki language code or the full language name of the current content # <code>getItemLangCode</code> looks for country (P17), then for that country's official language (P37), and returns its language code (P424) # <code>findLanguage</code> returns (1) supplied language if valid; or (2) the user's set language; or (3) the language of the current wiki # <code>getQid</code> returns (1) the entity-ID, if supplied; or (2) the entity ID of the "category's main topic (P301)"; or (3) the entity ID associated with the current page; or (4) nothing # <code>followQid</code> given a list of properties, looks for each property in turn and returns the entity-ID of the first value that matches (optionally, returns all entity-IDs that match) # <code>getGlobe</code> returns the entity-ID of the globe used in P625 (coordinate location), or nil if there isn't one # <code>getCommonsLink</code> returns one of the following in order of preference: the Commons sitelink of the linked Wikidata item; the Commons sitelink of the topic's main category of the linked Wikidata item; # <code>siteID</code> returns the root of the globalSiteID, e.g. "en" for "enwiki", "enwikisource", "en-gb", etc. # <code>projID</code> same as siteID # <code>location</code> scans from the current location upwards along the chain of higher-level locations, returning each one until it reaches a country # <code>examine</code> returns a formatted dump of the given property # <code>url2</code> takes a parameter that is a proper url and formats it for use in an infobox; it accepts its own output as input # <code>getWebsite</code> fetches the Official website (P856) and formats it for use in an infobox # <code>checkvalue</code> looks through a property for a given entity-ID as its value and returns that entity-ID if found; otherwise nil # <code>checkValidity</code> returns whether the first unnamed parameter represents a valid entity-id # <code>showNoLinks</code> displays the article titles that should not be linked Examples of calls: <nowiki>{{#invoke:WikidataIB |getValue |<PropertyID> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no> |noicon=<yes/no> |df=<dmy/mdy/y> |bc=<BC/BCE> |qual=<ALL/DATES/P999> |list=<ubl/hlist/prose> |linked=<yes/no> |<local parameter>}}</nowiki> <nowiki>{{#invoke:WikidataIB |getCoords |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |<local parameter>}}</nowiki> <nowiki>{{#invoke:WikidataIB |getQualifierValue |<PropertyID> |pval=<ID of target value for the property> |qual=<qualifier ID for that target value> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no>}}</nowiki> <nowiki>{{#invoke:WikidataIB |getValueByQual |<PropertyID> |qualID=<qualifier property ID to match> |qvalue=<QID of target value for the qualifier property> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no>}}</nowiki> <nowiki>{{#invoke:WikidataIB |getValueByLang |<PropertyID> |lang=<language code to match> |name=<fieldname> |suppressfields=<list of fields which will never display> |fetchwikidata=<list of fields to fetch values from Wikidata> |onlysourced=<yes/no>}}</nowiki>
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