Module talk:WikidataIB/sandbox1/testing
Local parameter, fetchwikidata, suppressfields
- {{q|P50}}
class="wikitable" | ||
scope="col" | Article
! scope="col" | Code ! scope="col" | Result | ||
---|---|---|
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |Fred Bloggs}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=author; number_of_pages |name=author}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=title; number_of_pages |name=author}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=ALL}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=ALL |Freda Bloggs}} |
{{q|Q1396889}} | {{dagger|alt=note}} | {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=ALL |spf=author}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=ALL |spf=author |name=author}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=ALL |spf=title |name=author}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=ALL |spf=author |name=author |Freda Bloggs}} |
{{dagger}} Note that when a blacklist is supplied, a field name is also needed, otherwise the call returns nothing.
Only sourced
- {{q|P50}}
- {{q|P166}}
class="wikitable" | ||
scope="col" | Article
! scope="col" | Code ! scope="col" | Result | ||
---|---|---|
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=ALL |osd=no}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=ALL |osd=yes}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P166 |fwd=ALL |osd=no}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P166 |fwd=ALL |osd=yes}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P166 |fwd=ALL |osd=}} |
No icon
- {{q|P50}}
class="wikitable" | ||
scope="col" | Article
! scope="col" | Code ! scope="col" | Result | ||
---|---|---|
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=ALL |noicon=no}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=ALL |noicon=yes}} |
{{q|Q1396889}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1396889 |P50 |fwd=ALL |noicon=}} |
getValue for dates
- {{q|P569}}
- {{q|P570}}
class="wikitable" | ||
scope="col" | Article
! scope="col" | Code ! scope="col" | Result | ||
---|---|---|
{{q|Q357585}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q357585 |P569 |fwd=ALL |osd=no}} |
{{q|Q51673}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q51673 |P569 |fwd=ALL |osd=no}} |
{{q|Q51673}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q51673 |P569 |fwd=ALL |osd=no |bc=BC}} |
{{q|Q51673}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q51673 |P569 |fwd=ALL |osd=no |bc=BCE}} |
{{q|Q51673}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q51673 |P569 |fwd=ALL |osd=no |df=mdy}} |
{{q|Q51673}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q51673 |P569 |fwd=ALL |osd=no |df=y}} |
{{q|Q51673}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q51673 |P569 |fwd=ALL |osd=no |lang=fr}} |
{{q|Q151973}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q151973 |P569 |fwd=ALL |osd=no}} |
{{q|Q151973}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q151973 |P569 |fwd=ALL |osd=no |bc=BC}} |
{{q|Q151973}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q151973 |P569 |fwd=ALL |osd=no |df=mdy}} |
{{q|Q151973}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q151973 |P569 |fwd=ALL |osd=no |df=y}} |
{{q|Q1817}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1817 |P569 |fwd=ALL |osd=no}} |
{{q|Q1817}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q1817 |P570 |fwd=ALL |osd=no}} |
: For {{q|Q61714940}}, {{q|P570}}:
:*
→ {{#invoke:WikidataIB/sandbox1 |getValue |ps=1 |P570 |qid=Q61714940}}
:*
→ {{#invoke:WikidataIB/sandbox1 |getValue |ps=1 |P570 |qid=Q61714940 |qual=ALL}}
: For {{q|Q142}}, {{q|P610}}:
:*
→ {{#invoke:WikidataIB/sandbox1 |getValue |ps=1 |P610 |qid=Q142}}
:*
→ {{#invoke:WikidataIB/sandbox1 |getValue |ps=1 |P610 |qid=Q142 |qual=ALL}}
: For {{q|Q1048}}, {{q|P569}}:
:*
→ {{#invoke:WikidataIB/sandbox1 |getValue |ps=1 |P569 |qid=Q1048}}
:*
→ {{#invoke:WikidataIB/sandbox1 |getValue |ps=1 |P569 |qid=Q1048 |qual=ALL}}
maxvals
{{Q|P106}}
class= "wikitable"
! scope="col" | Article ! scope="col" | Code ! scope="col" | Result | ||
{{Q|42}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fetchwikidata=ALL |onlysourced=no}} |
{{Q|42}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fetchwikidata=ALL |onlysourced=no |qid=}} |
{{Q|42}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fetchwikidata=ALL |onlysourced=no |qid=Q42 |locally supplied value}} |
{{Q|42}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fetchwikidata=ALL |onlysourced=no |qid=Q42 |2=locally supplied value}} |
{{Q|42}} |
|
|-
| {{Q|42}} ||
|| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fetchwikidata=ALL |onlysourced=no |qid=Q42 |2=}}
|-
| {{Q|42}} ||
|| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fetchwikidata=ALL |onlysourced=no |qid=Q42}}
|-
| {{Q|42}} ||
|| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fetchwikidata=ALL |onlysourced=no |qid=Q42 |maxvals=1}}
|-
| {{Q|42}} ||
|| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fetchwikidata=ALL |onlysourced=no |qid=Q42 |maxvals=4}}
|-
| {{Q|42}} ||
|| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fetchwikidata=ALL |onlysourced=no |qid=Q42 |maxvals=99}}
|-
| {{Q|42}} ||
|| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fetchwikidata=ALL |onlysourced=no |qid=Q42 |maxvals=0}}
|-
| {{Q|42}} ||
|| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fetchwikidata=ALL |onlysourced=yes |qid=Q42 |maxvals=0}}
|}
Quantity handling
{{q|P2046}}, {{q|P2044}}
class="wikitable" | ||
scope="col" | Article
! scope="col" | Code ! scope="col" | Result | ||
---|---|---|
{{q|Q2256}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P2046 |qid=Q2256 |fwd=ALL |osd=no}} |
{{q|Q2256}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P2046 |qid=Q2256 |fwd=ALL |osd=no |unitabbr=yes}} |
{{q|Q2256}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P2046 |qid=Q2256 |fwd=ALL |osd=no |unitabbr=yes |conv=y}} |
{{q|Q18208369}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q18208369 |P2044 |ps=1 |uabbr=y |conv=y}} |
{{q|Q4574072}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q4574072 |P2044 |ps=1 |uabbr=y |conv=y}} |
{{q|Q25271}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q25271 |P2044 |ps=1 |uabbr=y |conv=y}} |
List handling
- {{q|P106}}
class="wikitable" | ||
scope="col" | Article
! scope="col" | Code ! scope="col" | Result | ||
---|---|---|
{{q|Q42}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fwd=ALL |osd=no |qid=Q42}} |
{{q|Q42}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fwd=ALL |osd=no |qid=Q42 |sep=" – "}} |
{{q|Q42}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fwd=ALL |osd=no |qid=Q42 |list=hlist}} |
{{q|Q42}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fwd=ALL |osd=no |qid=Q42 |list=ubl}} |
{{q|Q42}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P106 |fwd=ALL |osd=no |qid=Q42 |list=prose}} |
Getting value and qualifiers
: {{Q|P1376}} for {{Q|Q71}}
: Qualifiers: {{Q|P580}} and {{Q|P582}}
class="wikitable" | |
scope="col" | Code
! scope="col" | Result | |
---|---|
| {{#invoke:WikidataIB/sandbox1 |getValue |P1376 |fwd=ALL |osd=no |qid=Q71}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1376 |fwd=ALL |osd=no |qid=Q71 |qual=P580}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1376 |fwd=ALL |osd=no |qid=Q71 |qual=P582}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1376 |fwd=ALL |osd=no |qid=Q71 |qual=P1326}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1376 |fwd=ALL |osd=no |qid=Q71 |qual=DATES}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1376 |fwd=ALL |osd=no |qid=Q71 |qual=ALL}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1376 |fwd=ALL |osd=no |qid=Q71 |qual=ALL |sep=" or " |qsep=" to "}} |
----
: {{Q|P36}} for {{Q|Q142}}
class="wikitable" | |
scope="col" | Code
! scope="col" | Result | |
---|---|
| {{#invoke:WikidataIB/sandbox1 |getValue |P36 |fwd=ALL |osd=no |qid=Q142 |qual=DATES |list=ubl}} |
----
: {{Q|P610}} for {{Q|Q142}}
: Qualifiers: {{Q|P1326}} is handled to include "before "
class="wikitable" | |
scope="col" | Code
! scope="col" | Result | |
---|---|
| {{#invoke:WikidataIB/sandbox1 |getValue |P610 |fwd=ALL |osd=no |qid=Q142}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P610 |fwd=ALL |osd=no |qid=Q142 |qual=DATES}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P610 |fwd=ALL |osd=no |qid=Q142 |qual=P1326}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P610 |fwd=ALL |osd=no |qid=Q142 |qual=P1326 |list=hlist}} |
Scaling quantities
: {{q|P2131|}} for {{q|Q30}} and {{q|Q183}}
class="wikitable" | |
scope="col" | Code
! scope="col" | Result | |
---|---|
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |uabbr=y}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=3}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=3 |uabbr=y}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=6}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=6 |uabbr=y}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=9}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=9 |uabbr=y}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=12}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=12 |uabbr=y}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale= |uabbr=y}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=10}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=10 |uabbr=y}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=-10}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=-10 |uabbr=y}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=auto}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=A |uabbr=y}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=auto}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q30 |P2131 |rank=b |fwd=ALL |osd=n |scale=A |uabbr=y}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q183 |P2131 |rank=b |fwd=ALL |osd=n |scale=auto}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |qid=Q183 |P2131 |rank=b |fwd=ALL |osd=n |scale=A |uabbr=y}} |
Ranks
Fetching the names of the {{Q|P170}} from {{Q|Q29016906}} (one value preferred):
class="wikitable" | |
scope="col" | Code
! scope="col" | Result | |
---|---|
| {{#invoke:WikidataIB/sandbox1 |getValue |P170 |fwd=ALL |qid=Q29016906 |osd=no}} |
| {{#invoke:WikidataIB/sandbox1 |getPreferredValue |P170 |fwd=ALL |qid=Q29016906 |osd=no}} |
colspan="2" | Using getValue only: | |
| {{#invoke:WikidataIB/sandbox1 |getValue |P170 |fwd=ALL |qid=Q29016906 |osd=no |rank=}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P170 |fwd=ALL |qid=Q29016906 |osd=no |rank=p}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P170 |fwd=ALL |qid=Q29016906 |osd=no |rank=n}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P170 |fwd=ALL |qid=Q29016906 |osd=no |rank=b}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P170 |fwd=ALL |qid=Q29016906 |osd=no |rank=x}} |
----
Fetching the values of {{Q|P180}} from {{Q|Q29016906}} (no values preferred):
class="wikitable" | |
scope="col" | Code
! scope="col" | Result | |
---|---|
| {{#invoke:WikidataIB/sandbox1 |getValue |P180 |fwd=ALL |qid=Q29016906 |osd=no}} |
| {{#invoke:WikidataIB/sandbox1 |getPreferredValue |P180 |fwd=ALL |qid=Q29016906 |osd=no}} |
colspan="2" | Using getValue only: | |
| {{#invoke:WikidataIB/sandbox1 |getValue |P180 |fwd=ALL |qid=Q29016906 |osd=no |rank=}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P180 |fwd=ALL |qid=Q29016906 |osd=no |rank=p}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P180 |fwd=ALL |qid=Q29016906 |osd=no |rank=n}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P180 |fwd=ALL |qid=Q29016906 |osd=no |rank=b}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P180 |fwd=ALL |qid=Q29016906 |osd=no |rank=x}} |
----
Using template – Fetching the names of the {{Q|P170}} from {{Q|Q29016906}} (one value preferred):
class="wikitable" | |
scope="col" | Code
! scope="col" | Result | |
---|---|
| {{wdib |P170 |qid=Q29016906 |fwd=ALL |osd=no}} |
| {{wdib |P170 |qid=Q29016906 |fwd=ALL |osd=no |rank=p}} |
| {{wdib |P170 |qid=Q29016906 |fwd=ALL |osd=no |rank=n}} |
| {{wdib |P170 |qid=Q29016906 |fwd=ALL |osd=no |rank=best}} |
| {{wdib |P170 |qid=Q29016906 |fwd=ALL |osd=no |rank=xyz}} |
Language code
class= "wikitable" | ||
{{Q|Q16240603}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P734 |qid=Q16240603 |fwd=ALL | osd=no | linked=no |lang=}} |
{{Q|Q16240603}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P734 |qid=Q16240603 |fwd=ALL | osd=no | linked=no |lang=en}} |
{{Q|Q16240603}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P734 |qid=Q16240603 |fwd=ALL | osd=no | linked=no |lang=ru}} |
Monolingual text handling
- {{q|P1477}}
class= "wikitable"
|+ Testing getValue using {{q|P1477}} for {{Q|Q16185856}} | ||
{{Q|Q16185856}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q16185856 |fwd=ALL |osd=no}} |
{{Q|Q16185856}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q16185856 |fwd=ALL |osd=no |lang=}} |
{{Q|Q16185856}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q16185856 |fwd=ALL |osd=no |lang=en}} |
{{Q|Q16185856}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q16185856 |fwd=ALL |osd=no |lang=en-gb}} |
{{Q|Q16185856}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q16185856 |fwd=ALL |osd=no |lang=de}} |
{{Q|Q16185856}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q16185856 |fwd=ALL |osd=no |lang=zh-mo}} |
class= "wikitable"
|+ Testing getValue using {{q|P1477}} for {{Q|Q5816}} | ||
{{Q|Q5816}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q5816 |fwd=ALL |osd=no}} |
{{Q|Q5816}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q5816 |fwd=ALL |osd=no |lang=}} |
{{Q|Q5816}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q5816 |fwd=ALL |osd=no |lang=en}} |
{{Q|Q5816}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q5816 |fwd=ALL |osd=no |lang=en-gb}} |
{{Q|Q5816}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q5816 |fwd=ALL |osd=no |lang=gu}} |
{{Q|Q5816}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q5816 |fwd=ALL |osd=no |lang=zh-mo}} |
class= "wikitable"
|+ Testing getValue using {{q|P1477}} for {{Q|Q1001}} | ||
{{Q|Q1001}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q1001 |fwd=ALL |osd=no}} |
{{Q|Q1001}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q1001 |fwd=ALL |osd=no |lang=}} |
{{Q|Q1001}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q1001 |fwd=ALL |osd=no |lang=en}} |
{{Q|Q1001}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q1001 |fwd=ALL |osd=no |lang=en-gb}} |
{{Q|Q1001}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q1001 |fwd=ALL |osd=no |lang=gu}} |
{{Q|Q1001}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P1477 |qid=Q1001 |fwd=ALL |osd=no |lang=zh-mo}} |
Coordinates
- {{q|Q265628}}
- {{q|P625}}
class="wikitable" | |
scope="col" | Code
! scope="col" | Result | |
---|---|
| |
24.627333 | |
70.404167 |display=inline}} | {{coord |
24.627333 | |
70.404167 |display=inline}} | |
| |
24.627333 | |
70.404167 |display=inline |format=dms}} | {{coord |
24.627333 | |
70.404167 |display=inline |format=dms}} | |
| {{#invoke:WikidataIB/sandbox1 |getValue |P625 |fwd=ALL |osd=no |qid=Q265628}} |
| {{#invoke:WikidataIB/sandbox1 |getCoords |fwd=ALL |osd=no |qid=Q265628 |display=inline}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P625 |fwd=ALL |osd=no |qid=Q265628 |format=dms}} |
| {{#invoke:WikidataIB/sandbox1 |getCoords |fwd=ALL |osd=no |qid=Q265628 |display=inline|format=dms}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P625 |fwd=ALL |osd=no |qid=Q265628 |format=dec}} |
| {{#invoke:WikidataIB/sandbox1 |getCoords |fwd=ALL |osd=no |qid=Q265628 |display=inline|format=dec}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P625 |fwd=ALL |osd=no |qid=Q265628 |noicon=true |show=long}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P625 |fwd=ALL |osd=no |qid=Q265628 |noicon=true |show=lat}} |
| {{#invoke:WikidataIB/sandbox1 |getValue |P625 |fwd=ALL |osd=no |qid=Q265628 |noicon=true |show=longlat}} |
getQualifierValue
; Date precision is month:
: In {{q|Q1513315}}: property {{q|P793}} equal to {{q|Q385378}} has a {{q|P580}} qualifier
class="wikitable" | |
scope="col" | Code
! scope="col" | Result | |
---|---|
| {{#invoke:WikidataIB/sandbox1 |getQualifierValue |P793 |pval=Q385378 |qual=P580 |fwd=ALL |qid=Q1513315}} |
| {{#invoke:WikidataIB/sandbox1 |getQualifierValue |P793 |pval=Q385378 |qual=P580 |fwd=ALL |qid=Q1513315 |osd=no}} |
; Date precision is day:
: In {{q|Q151973}}: property {{q|P26}} equal to {{q|Q3469983}} has a {{q|P580}} qualifier
class="wikitable" | |
scope="col" | Code
! scope="col" | Result | |
---|---|
| {{#invoke:WikidataIB/sandbox1 |getQualifierValue |P26 |pval=Q3469983 |qual=P580 |fwd=ALL |qid=Q151973}} |
| {{#invoke:WikidataIB/sandbox1 |getQualifierValue |P26 |pval=Q3469983 |qual=P580 |fwd=ALL |qid=Q151973 |osd=no}} |
| {{#invoke:WikidataIB/sandbox1 |getQualifierValue |P26 |pval=Q3469983 |qual=P580 |fwd=ALL |qid=Q151973 |osd=no |df=mdy}} |
; Multiple date values:
: In {{q|Q151973}}: property {{q|P26}} equal to {{q|Q34851}} has {{q|P580}} qualifiers
class="wikitable" | |
scope="col" | Code
! scope="col" | Result | |
---|---|
| {{#invoke:WikidataIB/sandbox1 |getQualifierValue |P26 |pval=Q34851 |qual=P580 |fwd=ALL |qid=Q151973}} |
| {{#invoke:WikidataIB/sandbox1 |getQualifierValue |P26 |pval=Q34851 |qual=P580 |fwd=ALL |qid=Q151973 |osd=no}} |
| {{#invoke:WikidataIB/sandbox1 |getQualifierValue |P26 |pval=Q34851 |qual=P580 |fwd=ALL |qid=Q151973 |osd=no |df=mdy}} |
; Qualifier value is an article:
: In {{q|Q1513315}}: property {{q|P2670}} equal to {{q|Q1205231}} has an {{q|P31}} qualifier
class="wikitable" | |
scope="col" | Code
! scope="col" | Result | |
---|---|
| {{#invoke:WikidataIB/sandbox1 |getQualifierValue |P2670 |pval=Q1205231 |qual=P31 |fwd=ALL |qid=Q1513315}} |
| {{#invoke:WikidataIB/sandbox1 |getQualifierValue |P2670 |pval=Q1205231 |qual=P31 |fwd=ALL |qid=Q1513315 |osd=no}} |
getValueByQual
In {{q|Q10990}}, the value of the property {{q|P443}} which has qualifier {{q|P407}} equal to {{q|Q7979}} is:
class = "wikitable" |
| {{#invoke:WikidataIB/sandbox1 |getValueByQual |qid=Q10990 |P443 |qualID=P407 |qvalue=Q7979 |fwd=ALL |osd=no |noicon=true}} |
getValueByLang
In {{q|Q10990}}, the value of the property {{q|P443}} which has the fixed qualifier "language of work or name" equal to a given language code (or default) is:
class = "wikitable" |
| {{#invoke:WikidataIB/sandbox1 |getValueByLang |qid=Q10990 |P443 |fwd=ALL |osd=no |noicon=true}} |
| {{#invoke:WikidataIB/sandbox1 |getValueByLang |qid=Q10990 |P443 |fwd=ALL |osd=no |noicon=true |lang=sv}} |
| {{#invoke:WikidataIB/sandbox1 |getValueByLang |qid=Q10990 |P443 |fwd=ALL |osd=no |noicon=true |lang=en}} |
| {{#invoke:WikidataIB/sandbox1 |getValueByLang |qid=Q10990 |P443 |fwd=ALL |osd=no |noicon=true |lang=en-gb}} |
| {{#invoke:WikidataIB/sandbox1 |getValueByLang |qid=Q10990 |P443 |fwd=ALL |osd=no |noicon=true |lang=en-us}} |
getDescription
class= "wikitable"
|+ Testing getDescription | ||
{{Q|42}} |
| {{#invoke:WikidataIB/sandbox1 |getDescription}} |
{{Q|42}} |
| {{#invoke:WikidataIB/sandbox1 |getDescription |qid=}} |
{{Q|42}} |
| {{#invoke:WikidataIB/sandbox1 |getDescription |qid=Q42}} |
{{Q|42}} |
|
|-
| {{Q|42}} ||
|| {{#invoke:WikidataIB/sandbox1 |getDescription |qid=Q42 |1=}}
|-
| {{Q|42}} ||
|| {{#invoke:WikidataIB/sandbox1 |getDescription |qid=Q42 |wikidata}}
|-
| {{Q|42}} ||
|| {{#invoke:WikidataIB/sandbox1 |getDescription |qid=Q42 |1=wikidata}}
|-
| {{Q|42}} ||
|| {{#invoke:WikidataIB/sandbox1 |getDescription |qid=Q42 |locally supplied description}}
|-
| {{Q|42}} ||
|| {{#invoke:WikidataIB/sandbox1 |getDescription |qid=Q42 |none}}
|}
location
; {{q|Q248188}}
: {{#invoke:WikidataIB/sandbox1 |location |Q248188}}
: {{#invoke:WikidataIB/sandbox1 |location |Q248188 |first=no}}
: {{#invoke:WikidataIB/sandbox1 |location |Q248188 |first=yes}}
; {{q|Q9141}}
:
→ {{#invoke:WikidataIB/sandbox1 |location |Q9141 |first=yes |skip=yes}}
:
→ {{#invoke:WikidataIB/sandbox1 |location |Q9141 |first=yes}}
But for the USA, we normally miss off the "US" part. So put it back and change Wikidata's "USA" to enwiki's "US" when skip is true.
; {{q|Q9188}}
:
→ {{#invoke:WikidataIB/sandbox1 |location |Q9188 |first=yes |skip=yes}}
:
→ {{#invoke:WikidataIB/sandbox1 |location |Q9188 |first=yes}}
For British locations, it would skip to {{q|Q145}} which is the first instance of {{q|Q6256}}. Unfortunately {{q|Q21}} is not an instance of a country, but an instance of a {{q|Q3336843}}, according to Wikidata. So also test for Q3336843 when skip is true.
; {{q|Q248188}}
:
→ {{#invoke:WikidataIB/sandbox1 |location |Q248188 |first=y |skip=y}}
:
→ {{#invoke:WikidataIB/sandbox1 |location |Q248188 |first=y}}
examine
; Examining {{q|Q1396889}} {{q|P18}}
:
→
{{#invoke:WikidataIB/sandbox1 |examine |pid=P18 |qid=Q1396889}}
:
→
{{#invoke:WikidataIB/sandbox1 |examine |P18 |qid=Q1396889}}
:
→
{{#invoke:WikidataIB/sandbox1 |examine |pid=P18 |Q1396889}}
:
→
{{#invoke:WikidataIB/sandbox1 |examine |P18 |Q1396889}}
:
→
{{#invoke:WikidataIB/sandbox1 |examine |Q1396889 |P18}}
; Using wrapper template
:
→
{{examine|Q1396889 |P18}}
Format Dates
Some test cases for the function formatDate. Call like
class="wikitable" style="width:24em;"
|+ Input date: 1 August 30 BCE, 12:39:56 | |
no parameters | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56}} |
bc=BC | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |bc=BC}} |
bc=BCE | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |bc=BCE}} |
bc=bc | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |bc=bc}} |
bc=bce | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |bc=bce}} |
bc=XYZ | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 | bc=XYZ}} |
df=dmy | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |df=dmy}} |
df=DMY | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |df=DMY}} |
df=mdy | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |df=mdy}} |
df=MDY | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |df=MDY}} |
df=ABC | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |df=ABC}} |
df=y | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |df=y }} |
bc=BCE df=dmy | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |bc=BCE |df=dmy}} |
bc=BCE df=mdy | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |bc=BCE |df=dmy}} |
bc=BCE df=y | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |bc=BCE |df=y}} |
bc=BC df=dmy | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |bc=BC |df=dmy}} |
bc=BC df=mdy | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |bc=BC |df=mdy}} |
bc=BC df=y | {{#invoke:WikidataIB/sandbox1 |formatDate | 1 August 30 BCE, 12:39:56 |bc=BC |df=y}} |
class="wikitable" style="width:24em;"
|+ Input date: 20 January 2017, 12:39:56 | |
no parameters | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56}} |
bc=BC | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |bc=BC}} |
bc=BCE | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |bc=BCE}} |
bc=bc | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |bc=bc}} |
bc=bce | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |bc=bce}} |
bc=XYZ | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 | bc=XYZ}} |
df=dmy | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |df=dmy}} |
df=DMY | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |df=DMY}} |
df=mdy | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |df=mdy}} |
df=MDY | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |df=MDY}} |
df=ABC | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |df=ABC}} |
df=y | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |df=y }} |
bc=BCE df=dmy | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |bc=BCE |df=dmy}} |
bc=BCE df=mdy | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |bc=BCE |df=dmy}} |
bc=BCE df=y | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |bc=BCE |df=y}} |
bc=BC df=dmy | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |bc=BC |df=dmy}} |
bc=BC df=mdy | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |bc=BC |df=mdy}} |
bc=BC df=y | {{#invoke:WikidataIB/sandbox1 |formatDate | 20 January 2017, 12:39:56 |bc=BC |df=y}} |