# Module:Wd/doc


}  
This is intended to fetch data from **விக்கித்தரவுகள்** with or without a link to the connected Wikipedia article. }  

The is under development and is not yet complete. Of the available datatypes, it currently supports **strings**, **quantities**, **monolingual text**, **time** and **globe coordinates**.  

## Usage
<code></code>  

## Commands
### Value class
The value class commands can be combined, meaning that multiple commands of different types from this class can be given at one time.  

Combine multiple commands into one call to this instead of making multiple calls to this with one command each to be sure that all the returned pieces of information belong to each other.  
| Type | Command | Returns | Basic usage | Description |
| --- | --- | --- | --- | --- |
| <code>property</code> | <small>first match*</small> | <code>}</code> | Returns the requested property – or list of properties – from the current item, or a given item. |  |
| <code>qualifier</code> | <small>first match*</small> | <code>}</code> | Returns the requested qualifier – or list of qualifiers – from the given property of the current item, or a given item. |  |
| <code>reference</code> | <small>first match*</small> | <code>}</code> | Returns a reference – or list of references – from the given property of the current item, or a given item. |  |
| <small>* Returns only a single value instead of multiple (if multiple claims or statements match). The returned value is the first match found from the best-ranked claims.</small> | } |  |  |  |

### Name class
The name class commands cannot be combined.  
| Command | Basic usage | Description |
| --- | --- | --- |
}  
## Flags
The following (optional) flags are available which can be used to alter this 's behaviour. They must be given after the (first) and before the other . For convenience, empty flags (i.e. <code>||</code>) are allowed and will simply be ignored.  

### Command flags
These flags (<code></code>, <code></code>, ...) apply to the command that precedes them directly.  
| Flag | Description |
| --- | --- |

### Configuration flags
These flags (<code></code>) are general configuration flags and can be given anywhere after the first command (but before the other arguments).  
| Flag | Description |  |
| --- | --- | --- |
| <code>preferred</code> | best</code> (so by default claims with a 'deprecated' rank are never returned).

Output is always sorted from highest rank to lowest (regardless of any of these flags being set). |  |
| <code>future</code> | former</code> (so by default claims that are valid for any time period are returned). |  |
| <code>mdy</code> | Returns date values in month_day_year order instead of day_month_year order. | } |

## Arguments
The following table shows the available arguments (<code></code>) in their fixed order. For each command, the minimal set of arguments is marked (i.e. if the commands <code>properties</code> and <code>qualifiers</code> have been given, then at least both the arguments <code>property_id</code> and <code>qualifier_id</code> should be given as well).  
| <small>*(required)*</small> | <small>*(optional)*</small> | <small>(optional)</small> | <small>(required)</small> | <small>(optional)</small> | <small>(required)</small> |
| --- | --- | --- | --- | --- | --- |
| *<code></code>* | *<code>commands</code>* | <code>claim_id_or_lit_value</code>
! <code>qualifier_id</code> | *<code></code>* |  |  |
| <code>label</code>, <code>title</code> |  |  |  |  |  |
| <code>property</code>/<code>properties</code> |  |  |  |  |  |
| <code>reference</code>/<code>references</code> |  |  |  |  |  |
| <code>qualifier</code>/<code>qualifiers</code> | } |  |  |  |  |

Below follows a description of all arguments.  

| Argument | Description |
| --- | --- |

### Named properties
Named properties are aliases for P-identifiers. The following named properties (which are case-sensitive) are currently available:  

| Alias | <sub>translates
</sub><sup>to</sup> | P-identifier |  |
| --- | --- | --- | --- |
| coord | → | P625 |  |
| author | → | P50 |  |
| publisher | → | P123 |  |
| importedFrom | → | P143 |  |
| statedIn | → | P248 |  |
| publicationDate | → | P577 |  |
| startTime | → | P580 |  |
| endTime | → | P582 |  |
| retrieved | → | P813 |  |
| referenceURL | → | P854 |  |
| archiveURL | → | P1065 |  |
| title | → | P1476 |  |
| quote | → | P1683 |  |
| shortName | → | P1813 |  |
| language | → | P2439 |  |
| archiveDate | → | P2960 | } |

## Advanced usage
The layout of the output from **value class** commands can be customized by using a number of named flags, which are name-value pairs (i.e. <code>|flag=value</code>). The table below shows the available named flags.  

Named flags can be given anywhere after the first command. To insert a space at the beginning or end of a <code>value</code>, use the HTML entity <code>&amp;#32;</code>.  

| Named flag | Default | Default condition | Description |
| --- | --- | --- | --- |
| <code>%p</code> | The claim's property value applied by the <code>property</code>/<code>properties</code> command. |  |  |
| <code>%q</code> | The claim's qualifier value or list of qualifier values applied by the <code>qualifier</code>/<code>qualifiers</code> command. |  |  |
| <code>%r</code> | The claim's reference value or list of reference values applied by the <code>reference</code>/<code>references</code> command. |  |  |
| <code>%s</code> | The movable separator placeholder. This is a special parameter that is not applied by a command, but instead is filled automatically between each pair of claims (if a list of claims is returned). This is handy in case a reference is returned as well, since it allows the reference to be placed after the punctuation mark as prescribed by Wikipedia's manual of style. The default value is a comma (<code>,</code>) and can be overridden with the <code>sep%s</code> flag (see below). | } |  |

Optional parameters can be given by encapsulating them between square brackets: <code>[...]</code>. All content between the square brackets is only displayed if a value for each optional parameter that has been defined between the same brackets has been found. Optional content can also be nested.  

At least one parameter must be given that is not optional, while the <code>%s</code> parameter must always be defined as optional.  

To get a literal <code>[</code>, <code>]</code>, <code>%</code> or <code>\</code>, escape the character by placing a backslash (<code>\</code>) directly in front of it (e.g. <code>\%</code>).  
|-  
| <code>%q[%s][%r]</code>  
| if the <code>property</code>/<code>properties</code> command **was not** given and the <code>qualifier</code>/<code>qualifiers</code> command **was** given  
|-  
| <code>%r</code>  
| if **only** the <code>reference</code>/<code>references</code> command was given  
|-  
| <code></code>  
| if the <code>property</code>/<code>properties</code> command **was** given and the <code>qualifier</code>/<code>qualifiers</code> command **was** given  
|-  
| |  
|-  
! | <code>sep=</code>  
| <code></code>  
| <span>*default*</span>  
| | The fixed separator between each pair of claims.  
|-  
| if **only** the <code>reference</code>/<code>references</code> command was given **without** the <code>raw</code> flag  
|-  
| |  
|-  
! | <code>sep%s=</code>  
| <code>,</code>  
| <span>*default*</span>  
| The movable separator between each pair of claims. This will be the value of the <code>%s</code> parameter applied to all claims except for the last in the list.  
|-  
| |  
|-  
! | <code>sep%q=</code>  
| <code></code>  
| <span>*default*</span>  
| The separator between each pair of qualifiers of a single claim. This is the value separator for the <code>%q</code> parameter.  
|-  
| |  
|-  
! | <code>sep%r=</code>  
| <span>*default*</span>  
| | The separator between each pair of references of a single claim. This is the value separator for the <code>%r</code> parameter.  
|-  
| <code></code>  
| if the <code>raw</code> flag was given for the <code>reference</code>/<code>references</code> command  
|-  
| |  
|-  
! | <code>punc=</code>  
| <span>*default*</span>  
| A punctuation mark placed at the end of the output. This will be placed on the <code>%s</code> parameter applied to the last claim in the list.  

This allows any references to be placed after the punctuation mark when the output is used as part of a sentence.  
|}  

## Examples

| Parameters and output types | Example | Description |  |
| --- | --- | --- | --- |
| Q55 = "}", P1549 = "}"

:↓

[] | <code>}</code>

:↓

:} | Gets a monolingual text value in the current wiki's language. |  |
| P1549 = "}"

:↓

[] | <code>}</code>

:↓

:} | If the is transcluded on the page (which is linked to Q55), then the <code>Q55</code> can be omitted. |  |
| Q55 = "}", P395 = "}"

:↓

[] | <code>}</code>

:↓

:} | Gets a literal string value. |  |
| Q55 = "}", P1082 = "}"

:↓

[] | <code>**property****normal+**}</code>

:↓

:} | Gets a single property value from claims with a 'normal' rank or higher. |  |
| Q55 = "}", P1082 = "}"

:↓

[] | <code>**properties**}</code>

:↓

:} | Gets multiple property values from claims with a 'normal' rank or higher. |  |
| Q55 = "}", P1082 = "}", P585 = "}"

:↓

[], [] | <code>**qualifier****P585**}</code>

:↓

:} | Gets a single qualifier value for each claim, additional to the property value. |  |
| Q55 = "}", P1082 = "}", P585 = "}"

:↓

[], [], [] | <code>**references**}</code>

:↓

:} | Gets references for each claim. |  |
| Q55 = "}", P1082 = "}"

:↓

[], [] | <code>A total of } people live in the Netherlands.</code>

:↓

:A total of } people live in the Netherlands. | Gets a property with its references. |  |
| Q55 = "}", P1082 = "}"

:↓

[], [] | <code>The Netherlands has a population of **punc=.**}</code>

:↓

:The Netherlands has a population of } | Adds a punctuation mark at the end of the output, in front of the references. |  |
| Q55 = "}", P1082 = "}", P585 = "}"

:↓

[], [], [] | <code>******''}****</code>

:↓

<ul>}</ul> | Returns the output in a custom format. |  |
| Q55 = "}", P1082 = "}", P585 = "}"

:↓

[] | <code>**qualifier**}</code>

:↓

:} | Gets a single qualifier per claim, by default for multiple matching claims. |  |
| Q55 = "}", P1082 = "}", P585 = "}"

:↓

[] | <code>**property******}</code>

:↓

:} | To get a single qualifier for only a single claim, give the <code>property</code> command too along with the regular <code>qualifier</code> format. |  |
| Q55 = "}", P1082 = "}", P585 = "}"

:↓

[] | <code>**}**}</code>

:↓

:} | Gets a qualifier from claims for which the (raw) property value matches a given literal value. |  |
| Q55 = "}", P1082 = "}", P585 = "}"

:↓

[] | <code>**mdy**}}</code>

:↓

:} | Gets dates in month_day_year order. |  |
| Q55 = "}", P1082 = "}", P585 = "}"

:↓

[] | <code>**raw**}}</code>

:↓

:} | Gets a raw date value. |  |
| Q55 = "}", P1082 = "}"

:↓

[] | <code>**references****}**}</code>

:↓

:} | Gets the references from a particular claim. |  |
| Q55 = "}", P1082 = "}"

:↓

[] | <code>**references***'raw***'}**}</code>

:↓

:} | Gets references from a particular claim in their raw form. |  |
| Q55 = "}", P2855 = "}", P518 = "}"

:↓

[] | <code>**qualifier**}</code>

:↓

:} | Gets a single qualifier value (for each matching claim). |  |
| Q55 = "}", P2855 = "}", P518 = "}"

:↓

[] | <code>**qualifiers**}</code>

:↓

:} | Gets multiple qualifier values (for each matching claim). |  |
| Q55 = "}", P2855 = "}", P518 = "}"

:↓

[], [] | <code>**properties**}</code>

:↓

:} | Gets multiple property values along with multiple qualifier values. |  |
| Q55 = "}", P2855 = "}", P518 = "}"

:↓

[], [] | <code>**********''}</code>

:↓

:} | Returns the output with custom separators. |  |
| Q55 = "}", P38 = "}", P518 = "}"

:↓

[] | <code>**current**}</code>

:↓

:} | Gets claims that are currently valid. |  |
| Q55 = "}", P38 = "}", P518 = "}"

:↓

[] | <code>**linked**}</code>

:↓

:} | Gets claims with linked property values. |  |
| Q55 = "}", P38 = "}", P518 = "}"

:↓

[] | <code>**linked**}</code>

:↓

:} | Gets claims with linked qualifier values. |  |
| Q55 = "}", P38 = "}", P518 = "}"

:↓

[] | <code>**linked***'short***'linked**}</code>

:↓

:} | Gets claims with linked property and qualifier values, with short property values wherever available. |  |
| Q55 = "}", P38 = "}", Q4917 = "}", P518 = "}"

:↓

[] | <code>**Q4917**}</code>

:↓

:} | Gets qualifiers from claims for which the (raw) property value matches a given item ID. |  |
| Q55 = "}", P38 = "}", P518 = "}"

:↓

[] | <code>**former**}</code>

:↓

:} | Gets claims that were valid in the past. |  |
| Q55 = "}", P38 = "}", P518 = "}"

:↓

[] | <code>**raw**}</code>

:↓

:} | Gets raw property values. |  |
| Q55 = "}", P38 = "}", P518 = "}"

:↓

[] | <code>**linked**}</code>

:↓

:} | Gets raw property values that are linked to Wikidata. |  |
| Q55 = "}", P2884 = "}"

:↓

[] | <code>}</code>

:↓

:} | Gets a quantity value with its associated unit of measurement. |  |
| Q55 = "}", P2884 = "}"

:↓

[] | <code>**linked**}</code>

:↓

:} | Gets a quantity value with a linked unit of measurement. |  |
| Q55 = "}", P2884 = "}"

:↓

[] | <code>**raw**}</code>

:↓

:} | Gets a raw quantity value. |  |
| Q55 = "}", P625 = "}"

:↓

[] | <code>}</code>

:↓

:} | Gets a globe coordinate value. |  |
| Q55 = "}", P625 = "}"

:↓

[] | <code>**linked**}</code>

:↓

:} | Gets a linked globe coordinate value. |  |
| Q55 = "}", P625 = "}"

:↓

[] | <code>**raw**}</code>

:↓

:} | Gets a raw globe coordinate value. |  |
| Q55 = "}", P625 = "}"

:↓

[] | <code>**coord**}</code>

:↓

:} | A named property (or alias) can be used instead of the P-identifier. |  |
| Q4917 = "}"

:↓

[] | <code>**label**}</code>

:↓

:} | Gets an item's label. |  |
| Q4917 = "}"

:↓

[] | <code>**short****linked**}</code>

:↓

:} | Gets an item's short and linked label. |  |
| P38 = "}"

:↓

[] | <code>}</code>

:↓

:} | Gets a property's label. |  |
| P38 = "}"

:↓

[] | <code>**linked**}</code>

:↓

:} | Gets a property's label that is linked to Wikidata. |  |
| Q776 = "}"

:↓

[] | <code>}</code>

:↓

:} | Gets an item's label. |  |
| Q776 = "}"

:↓

[] | <code>**linked**}</code>

:↓

:} | Gets an item's linked label. |  |
| :↓

[] | <code>}</code>

:↓

:} | If the is transcluded on the page (which is linked to Q776), then the <code>Q776</code> can be omitted. |  |
| Q776 = "}"

:↓

[] | <code>**title**}</code>

:↓

:} | Gets the title of the page on the current wiki that is linked to the given item. |  |
| Q776 = "}"

:↓

[] | <code>**linked**}</code>

:↓

:} | Gets the linked title of the page on the current wiki that is linked to the given item. |  |
| :↓

[] | <code>}</code>

:↓

:} | If the is transcluded on the page (which is linked to Q776), then the <code>Q776</code> can be omitted. | } |

### Example references