Mòdul:CreateStatement
A continuació es mostra la documentació transclosa de la subpàgina /ús. [salta a la caixa de codi]
Crea el text de la crida a Module:Statement+ d'un qualificador i una propietat de Wikidata.
{{#invoke:CreateStatement|main|item=Q25169|property=P800}}
Retorna (per a Pentalogia de la Guia galàctica per a autoestopistes (Q25169) i Obres destacables (P800)):
{{Statement+
|P = {{P-|800}}
{{label|Q25169}}
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P800 |e={{DocInfobox prefix}}/doc/P800 |qid=Q25169 |d=
{{Button ST|red}} {{label|Q21503250}} → {{q-|Q5}}, {{q-|Q16334295}}, {{q-|Q95074}}, {{q-|Q14514600}}, {{q-|Q61002}}, {{q-|Q52688389}}, {{q-|Q968159}}, {{q-|Q431289}}, {{q-|Q107307291}}, {{q-|Q43229}}, {{q-|Q115537581}}, {{q-|Q193564}}
{{Button ST|red}} {{label|Q21510865}} → {{q-|Q386724}}, {{q-|Q1151067}}, {{q-|Q151885}}, {{q-|Q11862829}}, {{q-|Q211364}}, {{q-|Q1293220}}, {{q-|Q17737}}, {{q-|Q1799072}}, {{q-|Q14208553}}, {{q-|Q486902}}, {{q-|Q1298668}}, {{q-|Q170584}}, {{q-|Q36534}}, {{q-|Q12772819}}, {{q-|Q65943}}, {{q-|Q2424752}}, {{q-|Q43229}}, {{q-|Q2668072}}, {{q-|Q8261}}, {{q-|Q618779}}, {{q-|Q9081}}, {{q-|Q41553020}}, {{q-|Q1711593}}, {{q-|Q10541491}}, {{q-|Q7406919}}, {{q-|Q820655}}, {{q-|Q2095}}, {{q-|Q1914636}}, {{q-|Q1656682}}, {{q-|Q16510064}}, {{q-|Q22811462}}, {{q-|Q185925}}, {{q-|Q853614}}, {{q-|Q47461344}}, {{q-|Q27058}}, {{q-|Q193946}}, {{q-|Q12280}}, {{q-|Q124301146}}, {{q-|Q3658341}}, {{q-|Q131841}}, {{q-|Q41176}}, {{q-|Q811979}}, {{q-|Q483394}}, {{q-|Q3589144}}, {{q-|Q106822736}}, {{q-|Q17319698}}, {{q-|Q190084}}
}}
}}
{{#invoke:CreateStatement|main|item=Q691283|property=P69}}
Retorna (per a St John's College, Cambridge (Q691283) i Formació (P69)):
{{Statement+
|P = {{P-|69}}
{{label|Q691283}}
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P69 |e={{DocInfobox prefix}}/doc/P69 |qid=Q691283 |c=y |q=P580, P582, P1534, P512, P812, P811, P1026, P1066, P184, P585, P2047, P276, P7174, P7374, P1932, P1810, P5102, P805, P3680, P1310, P3323, P1480, P459, P4241, P1319, P8555, P8554, P1326, P1317, P101, P8258, P166, P39, P1416, P3831, P2868, P4626, P4649, P1552, P828, P8324, P2241, P7452, P10663, P1013, P131, P528, P8338, P12506 |d=
{{Button ST|red}} {{label|Q21503250}} → {{q-|Q5}}, {{q-|Q95074}}, {{q-|Q18204}}, {{q-|Q508719}}
{{Button ST|red}} {{label|Q21510865}} → {{q-|Q2385804}}, {{q-|Q15690029}}, {{q-|Q23005223}}, {{q-|Q44613}}, {{q-|Q1128397}}, {{q-|Q2023606}}, {{q-|Q16519632}}, {{q-|Q16917}}, {{q-|Q5341295}}, {{q-|Q504703}}, {{q-|Q20860083}}
}}
}}
{{#invoke:CreateStatement/prova|main|item=Q21503247|property=P746}}
Retorna (per a Restricció de declaració requerida (Q21503247) i Data de desaparició (P746)):
{{Statement+
|P = {{P-|746}}
{{label|Q21503247}}
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P746 |e={{DocInfobox prefix}}/doc/P746 |qid=Q21503247 |r=y |d=
{{Button ST|red}} {{label|Q21503247}} → {{p-|P21}}, {{p-|P569}}
{{Button ST|red}} {{label|Q21503250}} → {{q-|Q215627}}, {{q-|Q95074}}
}}
}}
Sintaxi
[modifica]{{#invoke:CreateStatement|main|item|property|long_names}}
long_names: Boolean values for {{DocInfobox docStatement}} parameters.
Exemples
[modifica]Mínim
[modifica]{{#invoke:CreateStatement|main|item=Q5705|property=P138}}
Retorna (per a Catalunya (Q5705) i Epònim (P138)):
Contingut desplegable |
---|
[
{
"mainsnak": {
"snaktype": "value",
"property": "P138",
"datavalue": {
"value": {
"id": "Q244504",
"numeric-id": 244504,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-item"
},
"type": "statement",
"id": "Q5705$33b226f0-44c5-ed70-01f1-2a1ad4b68f74",
"rank": "normal"
}
]
|
{{Statement+
|P = {{P-|138}}
{{label|Q5705}}
|v1= {{Q-|244504}}
|v1.q1.v1={{Q-|244504}}
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P138 |e={{DocInfobox prefix}}/doc/P138 |qid=Q5705 |q=P5168, P8338, P1545, P1810, P1932, P1683, P1480, P407, P1559, P3938, P585, P580, P582, P642, P1557, P805, P1310, P3680, P5102, P5886, P6254, P5830, P276, P495, P1114, P1013, P518, P2283, P828, P3113, P1319, P8554, P8555, P2868, P3831, P1706, P50, P2093, P2241, P7452, P1814, P8703, P1705, P1039, P7528, P138, P1535}}
}}
Quantitat
[modifica]{{#invoke:CreateStatement|main|item=Q5705|property=P2132}}
Retorna (per a Catalunya (Q5705) i PIB per capita (P2132)):
Contingut desplegable |
---|
[]
|
{{Statement+
|P = {{P-|2132}}
{{label|Q5705}}
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P2132 |e={{DocInfobox prefix}}/doc/P2132 |qid=Q5705 |m=1 |u=y |d=
{{Button ST|red}} {{label|Q21503250}} → {{q-|Q56061}}, {{q-|Q3624078}}, {{q-|Q100773131}}
}}
}}
Data antiga i amb una referència
[modifica]{{#invoke:CreateStatement|main|item=Q1405|property=P569}}
Retorna (per a August (Q1405) i Data de naixement (P569)):
Contingut desplegable |
---|
[
{
"type": "statement",
"references": [
{
"snaks": {
"P854": [
{
"snaktype": "value",
"property": "P854",
"datavalue": {
"value": "http://www.nytimes.com/1984/01/10/science/scholar-detectives-learn-how-augustus-idealized-his-image.html",
"type": "string"
},
"datatype": "url"
}
]
},
"snaks-order": [
"P854"
],
"hash": "112c8e4fe05e9a347377483ee27c1e0344877b06"
},
{
"snaks": {
"P50": [
{
"snaktype": "value",
"property": "P50",
"datavalue": {
"value": {
"id": "Q65669268",
"numeric-id": 65669268,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-item"
}
],
"P304": [
{
"snaktype": "value",
"property": "P304",
"datavalue": {
"value": "195",
"type": "string"
},
"datatype": "string"
}
],
"P577": [
{
"snaktype": "value",
"property": "P577",
"datavalue": {
"value": {
"before": 0,
"time": "+2007-00-00T00:00:00Z",
"timezone": 0,
"precision": 9,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"datatype": "time"
}
],
"P248": [
{
"snaktype": "value",
"property": "P248",
"datavalue": {
"value": {
"id": "Q186717",
"numeric-id": 186717,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-item"
}
],
"P478": [
{
"snaktype": "value",
"property": "P478",
"datavalue": {
"value": "161",
"type": "string"
},
"datatype": "string"
}
]
},
"snaks-order": [
"P248",
"P577",
"P478",
"P304",
"P50"
],
"hash": "aa9ce114ecec96bbbb2cb33ea0f2ba19066a354d"
},
{
"snaks": {
"P248": [
{
"snaktype": "value",
"property": "P248",
"datavalue": {
"value": {
"id": "Q100166489",
"numeric-id": 100166489,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-item"
}
],
"P813": [
{
"snaktype": "value",
"property": "P813",
"datavalue": {
"value": {
"before": 0,
"time": "+2021-06-29T00:00:00Z",
"timezone": 0,
"precision": 11,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"datatype": "time"
}
],
"P1810": [
{
"snaktype": "value",
"property": "P1810",
"datavalue": {
"value": "C. Iulius (132) C. f. C. n. Fab. Caesar Octavianus = C. Octavius C. f. Sca. Thurinus (or Caepias)",
"type": "string"
},
"datatype": "string"
}
],
"P6863": [
{
"snaktype": "value",
"property": "P6863",
"datavalue": {
"value": "2597",
"type": "string"
},
"datatype": "external-id"
}
]
},
"snaks-order": [
"P248",
"P6863",
"P1810",
"P813"
],
"hash": "c8dab81dc2f160d763f2a3aabdc5ad445c18c594"
}
],
"mainsnak": {
"snaktype": "value",
"property": "P569",
"datavalue": {
"value": {
"before": 0,
"time": "-0063-00-00T00:00:00Z",
"timezone": 0,
"precision": 9,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985786"
},
"type": "time"
},
"datatype": "time"
},
"id": "Q1405$4d08c813-4c25-0795-5e35-c850192b0b16",
"rank": "normal"
},
{
"type": "statement",
"references": [
{
"snaks": {
"P248": [
{
"snaktype": "value",
"property": "P248",
"datavalue": {
"value": {
"id": "Q45262034",
"numeric-id": 45262034,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-item"
}
]
},
"snaks-order": [
"P248"
],
"hash": "ebf43d7a0987f540460a9b17cbefbff957cc244c"
},
{
"snaks": {
"P248": [
{
"snaktype": "value",
"property": "P248",
"datavalue": {
"value": {
"id": "Q110768614",
"numeric-id": 110768614,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-item"
}
],
"P958": [
{
"snaktype": "value",
"property": "P958",
"datavalue": {
"value": "5",
"type": "string"
},
"datatype": "string"
}
]
},
"snaks-order": [
"P248",
"P958"
],
"hash": "12af922bbd70bbc671fda3faa61f84ec860f1552"
}
],
"mainsnak": {
"snaktype": "value",
"property": "P569",
"datavalue": {
"value": {
"before": 0,
"time": "-0063-09-23T00:00:00Z",
"timezone": 0,
"precision": 11,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985786"
},
"type": "time"
},
"datatype": "time"
},
"id": "Q1405$69bd812d-4fb8-8dbc-1f74-4620f5bd2e61",
"rank": "preferred"
}
]
|
{{Statement+
|P = {{P-|569}}
{{label|Q1405}}
|v1 = -63 {{label|Q1985786}}
|v1.r1.p1 = {{P-|854}}
|v1.r1.p1.v1=http://www.nytimes.com/1984/01/10/science/scholar-detectives-learn-how-augustus-idealized-his-image.html
|v2 = {{date|0063-09-23}} {{label|Q1985786}}
|v2.r2.p1 = {{P-|248}}
|v2.r2.p1.v1={{Q-|45262034}}
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P569 |e={{DocInfobox prefix}}/doc/P569 |qid=Q1405 |r=y |q=P459, P805, P1319, P1326, P1480, P1013, P2241, P1310, P4241, P4895, P5102, P3680, P421, P7452, P1932, P10663, P837, P3831, P31 |d=
{{Button ST|red}} {{label|Q21503250}} → {{q-|Q5}}, {{q-|Q95074}}, {{q-|Q21070568}}, {{q-|Q146}}, {{q-|Q144}}, {{q-|Q726}}, {{q-|Q3542731}}, {{q-|Q30017383}}, {{q-|Q13002315}}, {{q-|Q75855169}}, {{q-|Q64520857}}, {{q-|Q64643615}}, {{q-|Q18347143}}, {{q-|Q2345820}}, {{q-|Q57812611}}, {{q-|Q611804}}, {{q-|Q729}}, {{q-|Q10855152}}
}}
}}
Imatge o so
[modifica]En aquest cas caldrà afegir els dobles claudàtors davant i darrera.
{{#invoke:CreateStatement|main|item=Q235605|property=P18}}
Retorna (per a Jeanne Hébuterne (Q235605) i Imatge (P18)):
Contingut desplegable |
---|
[
{
"mainsnak": {
"snaktype": "value",
"property": "P18",
"datavalue": {
"value": "Jeanne Hébuterne.jpg",
"type": "string"
},
"datatype": "commonsMedia"
},
"type": "statement",
"id": "Q235605$1DA292E2-3605-4F23-AE1A-6D93786D1681",
"rank": "normal"
}
]
|
{{Statement+
|P = {{P-|18}}
{{label|Q235605}}
|v1 = File:Jeanne Hébuterne.jpg|thumb|left|Jeanne Hébuterne.jpg
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P18 |e={{DocInfobox prefix}}/doc/P18 |qid=Q235605 |q=P585, P2096, P180, P1683, P407, P2061, P1752, P276, P625, P131, P7108, P1259, P2093, P170, P123, P1433, P958, P3831, P2868, P4626, P4649, P7380, P1932, P805, P3680, P1310, P5102, P1552, P6477, P21, P3629, P580, P582, P4241, P1319, P8555, P8554, P1326, P1480, P459, P348, P6216, P1001, P518, P195, P1545, P7887, P2699, P1065, P2960, P2241, P7452, P6500, P275, P7103, P7104, P1299, P1706, P2739, P8138, P1534, P10663, P5830, P8798, P5980, P1947, P577, P8791, P1071, P1406, P4878, P17, P1810, P462, P6375, P10408, P50, P11265, P2701, P9302, P6072, P1684, P2441}}
}}
{{#invoke:CreateStatement|main|item=Q1525170|property=P51}}
Retorna (per a Estridor (Q1525170) i Àudio (P51)):
Contingut desplegable |
---|
[
{
"mainsnak": {
"snaktype": "value",
"property": "P51",
"datavalue": {
"value": "Stridor NP OGG.ogg",
"type": "string"
},
"datatype": "commonsMedia"
},
"type": "statement",
"id": "Q1525170$755c7b89-45ae-832f-114b-d716a9db4d7a",
"rank": "normal"
},
{
"mainsnak": {
"snaktype": "value",
"property": "P51",
"datavalue": {
"value": "Stridor NP OGG 2.ogg",
"type": "string"
},
"datatype": "commonsMedia"
},
"type": "statement",
"id": "Q1525170$cbf7bb97-443a-88d1-798d-2dff55a7d734",
"rank": "normal"
}
]
|
{{Statement+
|P = {{P-|51}}
{{label|Q1525170}}
|v1 = File:Stridor NP OGG.ogg|thumb|left|Stridor NP OGG.ogg
|v2 = File:Stridor NP OGG 2.ogg|thumb|left|Stridor NP OGG 2.ogg
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P51 |e={{DocInfobox prefix}}/doc/P51 |qid=Q1525170 |q=P175, P407, P1545, P2096, P2241, P7452, P921, P2701, P3831, P180, P518}}
}}
Extern amb referències
[modifica]{{#invoke:CreateStatement|main|item=Q1525170|property=P51}}
Retorna (per a Estridor (Q1525170) i Identificador Freebase (P646)):
Contingut desplegable |
---|
[
{
"type": "statement",
"references": [
{
"snaks": {
"P248": [
{
"snaktype": "value",
"property": "P248",
"datavalue": {
"value": {
"id": "Q15241312",
"numeric-id": 15241312,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-item"
}
],
"P577": [
{
"snaktype": "value",
"property": "P577",
"datavalue": {
"value": {
"before": 0,
"time": "+2013-10-28T00:00:00Z",
"timezone": 0,
"precision": 11,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"datatype": "time"
}
]
},
"snaks-order": [
"P248",
"P577"
],
"hash": "2b00cb481cddcac7623114367489b5c194901c4a"
}
],
"mainsnak": {
"snaktype": "value",
"property": "P646",
"datavalue": {
"value": "/m/05rtnw",
"type": "string"
},
"datatype": "external-id"
},
"id": "Q1525170$37C72588-467A-47F9-8C24-8B3650B40DC8",
"rank": "normal"
}
]
|
{{Statement+
|P = {{P-|646}}
{{label|Q1525170}}
|v1 = /m/05rtnw
|v1.r1.p1 = {{P-|248}}
|v1.r1.p1.v1={{Q-|15241312}}
|v1.r1.p2 = {{P-|577}}
|v1.r1.p2.v1={{date|2013-10-28}}
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P646 |e={{DocInfobox prefix}}/doc/P646 |qid=Q1525170 |m=1 |q=P459, P2241, P7452, P1810, P1683, P4390, P518 |d=
{{Button ST|red}} {{label|Q21503250}} → {{q-|Q35120}}
}}
}}
Propietats múltiples
[modifica]{{#invoke:CreateStatement|main|item=Q235605|property=P119}}
Retorna (per a Jeanne Hébuterne (Q235605) i Sepultura (P119)):
Contingut desplegable |
---|
[
{
"type": "statement",
"qualifiers-order": [
"P373",
"P580",
"P965",
"P625",
"P1706",
"P276"
],
"mainsnak": {
"snaktype": "value",
"property": "P119",
"datavalue": {
"value": {
"id": "Q112333548",
"numeric-id": 112333548,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-item"
},
"qualifiers": {
"P276": [
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "Q311",
"numeric-id": 311,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"property": "P276",
"hash": "2a92af0e37d9f7555dc0c633b67d1cfbc7cc3e55",
"datatype": "wikibase-item"
}
],
"P625": [
{
"snaktype": "value",
"datavalue": {
"value": {
"longitude": 2.3985154,
"precision": 1.0e-7,
"globe": "http://www.wikidata.org/entity/Q2",
"latitude": 48.8598029
},
"type": "globecoordinate"
},
"property": "P625",
"hash": "795737ce0dc274c2d8bcb979ca0266d301a3169e",
"datatype": "globe-coordinate"
}
],
"P373": [
{
"snaktype": "value",
"datavalue": {
"value": "Grave of Amedeo Modigliani and Jeanne Hébuterne",
"type": "string"
},
"property": "P373",
"hash": "2baeb94bc45140e01ecb0ade8da862446d3f6b76",
"datatype": "string"
}
],
"P580": [
{
"snaktype": "value",
"datavalue": {
"value": {
"before": 0,
"time": "+1930-01-01T00:00:00Z",
"timezone": 0,
"precision": 9,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"property": "P580",
"hash": "464f757e8e243e6c5659e96164b943a2b323821f",
"datatype": "time"
}
],
"P965": [
{
"snaktype": "value",
"datavalue": {
"value": "96",
"type": "string"
},
"property": "P965",
"hash": "6633f7ae8bf1601aa8e4c589a8549676183e574b",
"datatype": "string"
}
],
"P1706": [
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "Q120993",
"numeric-id": 120993,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"property": "P1706",
"hash": "eaa4294a07a0211f2b64be080faacbf16a5e9482",
"datatype": "wikibase-item"
}
]
},
"id": "q235605$D42D2C56-5061-4D3F-B6DB-42E6624C852A",
"rank": "normal"
},
{
"type": "statement",
"qualifiers-order": [
"P580",
"P582"
],
"mainsnak": {
"snaktype": "value",
"property": "P119",
"datavalue": {
"value": {
"id": "Q2482942",
"numeric-id": 2482942,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-item"
},
"qualifiers": {
"P580": [
{
"snaktype": "value",
"datavalue": {
"value": {
"before": 0,
"time": "+1920-01-28T00:00:00Z",
"timezone": 0,
"precision": 11,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"property": "P580",
"hash": "e7e2ad6b137d2ba8d70c8a79556f857779bfc16b",
"datatype": "time"
}
],
"P582": [
{
"snaktype": "value",
"datavalue": {
"value": {
"before": 0,
"time": "+1930-01-01T00:00:00Z",
"timezone": 0,
"precision": 9,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"property": "P582",
"hash": "9197c7b457111994c582ba7446258586fc75767f",
"datatype": "time"
}
]
},
"id": "q235605$f22da864-4baf-bfe9-c705-334b8a3305ac",
"rank": "normal"
}
]
|
{{Statement+
|P = {{P-|119}}
{{label|Q235605}}
|v1= {{Q-|112333548}}
|v1.q1.p = {{P-|373}}
|v1.q1.v1=Grave of Amedeo Modigliani and Jeanne Hébuterne
|v1.q2.p = {{P-|580}}
|v1.q2.v1=1930
|v1.q3.p = {{P-|965}}
|v1.q3.v1=96
|v1.q4.p = {{P-|625}}
|v1.q4.v1={{coord|48.8598029|2.3985154}}
|v1.q5.p = {{P-|1706}}
|v1.q5.v1={{Q-|120993}}
|v1.q6.p = {{P-|276}}
|v1.q6.v1={{Q-|311}}
|v2= {{Q-|2482942}}
|v2.q1.p = {{P-|580}}
|v2.q1.v1={{date|1920-01-28}}
|v2.q2.p = {{P-|582}}
|v2.q2.v1=1930
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P119 |e={{DocInfobox prefix}}/doc/P119 |qid=Q235605 |q=P373, P580, P582, P625, P805, P965, P1480, P518, P585, P1545, P1706, P217, P1684, P1932, P1534, P1683, P1442, P828, P1810, P2241, P7452, P1310, P3680, P8555, P1319, P8554, P1326, P131, P17, P4602, P1552, P276, P5102, P4241, P421, P654, P11693, P7678, P3749, P10689, P402 |d=
{{Button ST|red}} {{label|Q21503247}} → {{p-|P570}}
{{Button ST|red}} {{label|Q21503250}} → {{q-|Q5}}, {{q-|Q95074}}, {{q-|Q16334295}}, {{q-|Q622852}}, {{q-|Q21070598}}, {{q-|Q502931}}, {{q-|Q36341}}, {{q-|Q57812611}}, {{q-|Q199414}}, {{q-|Q3409626}}, {{q-|Q26401003}}
{{Button ST|red}} {{label|Q21510865}} → {{q-|Q618123}}, {{q-|Q16859021}}, {{q-|Q3895768}}, {{q-|Q82794}}, {{q-|Q48634}}, {{q-|Q6023295}}, {{q-|Q39614}}, {{q-|Q630013}}, {{q-|Q3024240}}, {{q-|Q6256}}, {{q-|Q567603}}, {{q-|Q62077203}}
}}
}}
Propietats múltiples amb referències
[modifica]{{#invoke:CreateStatement|main|item=Q5705|property=P119}}
Retorna (per a Catalunya (Q5705) i Part de (P361)):
Contingut desplegable |
---|
[
{
"type": "statement",
"references": [
{
"snaks": {
"P854": [
{
"snaktype": "value",
"property": "P854",
"datavalue": {
"value": "https://portal.cor.europa.eu/egtc/CoRActivities/Pages/Euroregion-Pyrenees-Mediterranean.aspx",
"type": "string"
},
"datatype": "url"
}
],
"P813": [
{
"snaktype": "value",
"property": "P813",
"datavalue": {
"value": {
"before": 0,
"time": "+2019-02-08T00:00:00Z",
"timezone": 0,
"precision": 11,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"datatype": "time"
}
]
},
"snaks-order": [
"P854",
"P813"
],
"hash": "e11b4d57de5435d10f14c93f4d5e2dfa60a587e0"
}
],
"mainsnak": {
"snaktype": "value",
"property": "P361",
"datavalue": {
"value": {
"id": "Q1849394",
"numeric-id": 1849394,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-item"
},
"id": "Q5705$3689b4f8-4756-a8b9-2939-55fa2fcd66a1",
"rank": "normal"
}
]
|
{{Statement+
|P = {{P-|361}}
{{label|Q5705}}
|v1= {{Q-|1849394}}
|v1.q1.v1={{Q-|1849394}}
|v1.r1.p1 = {{P-|854}}
|v1.r1.p1.v1=https://portal.cor.europa.eu/egtc/CoRActivities/Pages/Euroregion-Pyrenees-Mediterranean.aspx
|v1.r1.p2 = {{P-|813}}
|v1.r1.p2.v1={{date|2019-02-08}}
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P361 |e={{DocInfobox prefix}}/doc/P361 |qid=Q5705}}
}}
{{#invoke:CreateStatement|main|item=Q1373218|property=P742}}
Retorna (per a Eugeni Xammar i Puigventós (Q1373218) i Altres noms (P742)):
Contingut desplegable |
---|
[
{
"qualifiers": {
"P2553": [
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "Q13634244",
"numeric-id": 13634244,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"property": "P2553",
"hash": "dbe78e2a289f699a1cb341a54863fbdffddb337d",
"datatype": "wikibase-item"
}
],
"P580": [
{
"snaktype": "value",
"datavalue": {
"value": {
"before": 0,
"time": "+1936-01-00T00:00:00Z",
"timezone": 0,
"precision": 10,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"property": "P580",
"hash": "a0d9a1c1f0c55f73566dadbed53c12ebd7ce0391",
"datatype": "time"
}
],
"P3831": [
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "Q127843",
"numeric-id": 127843,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"property": "P3831",
"hash": "f1939e29cc088b84c94e4102682e148a70dd0e8c",
"datatype": "wikibase-item"
}
],
"P582": [
{
"snaktype": "value",
"datavalue": {
"value": {
"before": 0,
"time": "+1936-05-00T00:00:00Z",
"timezone": 0,
"precision": 10,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"property": "P582",
"hash": "11b453bfdda905e64f6f08fd8b08f1c7404a4b48",
"datatype": "time"
}
]
},
"qualifiers-order": [
"P2553",
"P580",
"P582",
"P3831"
],
"references": [
{
"snaks": {
"P854": [
{
"snaktype": "value",
"property": "P854",
"datavalue": {
"value": "https://www.raco.cat/index.php/Ponencies/article/view/255497/342426",
"type": "string"
},
"datatype": "url"
}
]
},
"snaks-order": [
"P854"
],
"hash": "772e3f3eba93d06510302650083446dc47d05b1c"
}
],
"mainsnak": {
"snaktype": "value",
"property": "P742",
"datavalue": {
"value": "Peer Gynt",
"type": "string"
},
"datatype": "string"
},
"id": "Q1373218$4b3ec9d7-43a9-3615-e374-ff157be9fcfb",
"type": "statement",
"rank": "normal"
},
{
"qualifiers": {
"P2553": [
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "Q5821801",
"numeric-id": 5821801,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"property": "P2553",
"hash": "d14dda5b228dda56b33cb3300f34496175f1b8b4",
"datatype": "wikibase-item"
}
],
"P580": [
{
"snaktype": "value",
"datavalue": {
"value": {
"before": 0,
"time": "+1913-00-00T00:00:00Z",
"timezone": 0,
"precision": 9,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"property": "P580",
"hash": "938769cc9a3712dd761e8302716efe470b0b01f2",
"datatype": "time"
}
],
"P3831": [
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "Q127843",
"numeric-id": 127843,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"property": "P3831",
"hash": "f1939e29cc088b84c94e4102682e148a70dd0e8c",
"datatype": "wikibase-item"
}
],
"P582": [
{
"snaktype": "value",
"datavalue": {
"value": {
"before": 0,
"time": "+1916-00-00T00:00:00Z",
"timezone": 0,
"precision": 9,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"property": "P582",
"hash": "47775fb913c07913b087dea9086fc24a73bfbb8c",
"datatype": "time"
}
]
},
"qualifiers-order": [
"P2553",
"P580",
"P582",
"P3831"
],
"references": [
{
"snaks": {
"P854": [
{
"snaktype": "value",
"property": "P854",
"datavalue": {
"value": "https://www.raco.cat/index.php/Ponencies/article/view/255497/342426",
"type": "string"
},
"datatype": "url"
}
]
},
"snaks-order": [
"P854"
],
"hash": "772e3f3eba93d06510302650083446dc47d05b1c"
}
],
"mainsnak": {
"snaktype": "value",
"property": "P742",
"datavalue": {
"value": "Harry Doggerel",
"type": "string"
},
"datatype": "string"
},
"id": "Q1373218$1301389c-4302-aa1a-b2e8-c206f6660865",
"type": "statement",
"rank": "normal"
},
{
"qualifiers": {
"P580": [
{
"snaktype": "value",
"datavalue": {
"value": {
"before": 0,
"time": "+1904-00-00T00:00:00Z",
"timezone": 0,
"precision": 9,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"property": "P580",
"hash": "74a92a73dabd44b9d17ad6a28727c28f29cd06dc",
"datatype": "time"
}
],
"P3831": [
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "Q127843",
"numeric-id": 127843,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"property": "P3831",
"hash": "f1939e29cc088b84c94e4102682e148a70dd0e8c",
"datatype": "wikibase-item"
}
],
"P582": [
{
"snaktype": "value",
"datavalue": {
"value": {
"before": 0,
"time": "+1909-00-00T00:00:00Z",
"timezone": 0,
"precision": 9,
"after": 0,
"calendarmodel": "http://www.wikidata.org/entity/Q1985727"
},
"type": "time"
},
"property": "P582",
"hash": "21f75b2c9bcb5005591111dae294b4afabc86295",
"datatype": "time"
}
]
},
"qualifiers-order": [
"P580",
"P582",
"P3831"
],
"references": [
{
"snaks": {
"P248": [
{
"snaktype": "value",
"property": "P248",
"datavalue": {
"value": {
"id": "Q558617",
"numeric-id": 558617,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-item"
}
],
"P854": [
{
"snaktype": "value",
"property": "P854",
"datavalue": {
"value": "https://www.ara.cat/premium/elegancia-aliadofilia_0_1172882708.html",
"type": "string"
},
"datatype": "url"
}
]
},
"snaks-order": [
"P854",
"P248"
],
"hash": "65fcd7ce72f52a674b5a25d648ba915d147195f2"
}
],
"mainsnak": {
"snaktype": "value",
"property": "P742",
"datavalue": {
"value": "Douglas Flint",
"type": "string"
},
"datatype": "string"
},
"id": "Q1373218$d223e0ee-4678-a0ee-d702-5a21ec9be13a",
"type": "statement",
"rank": "normal"
}
]
|
{{Statement+
|P = {{P-|742}}
{{label|Q1373218}}
|v1= Peer Gynt
|v1.q1.p = {{P-|2553}}
|v1.q1.v1={{Q-|13634244}}
|v1.q2.p = {{P-|580}}
|v1.q2.v1=1936
|v1.q3.p = {{P-|582}}
|v1.q3.v1=1936
|v1.q4.p = {{P-|3831}}
|v1.q4.v1={{Q-|127843}}
|v1.r1.p1 = {{P-|854}}
|v1.r1.p1.v1=https://www.raco.cat/index.php/Ponencies/article/view/255497/342426
|v2= Harry Doggerel
|v2.q1.p = {{P-|2553}}
|v2.q1.v1={{Q-|5821801}}
|v2.q2.p = {{P-|580}}
|v2.q2.v1=1913
|v2.q3.p = {{P-|582}}
|v2.q3.v1=1916
|v2.q4.p = {{P-|3831}}
|v2.q4.v1={{Q-|127843}}
|v2.r2.p1 = {{P-|854}}
|v2.r2.p1.v1=https://www.raco.cat/index.php/Ponencies/article/view/255497/342426
|v3= Douglas Flint
|v3.q1.p = {{P-|580}}
|v3.q1.v1=1904
|v3.q2.p = {{P-|582}}
|v3.q2.v1=1909
|v3.q3.p = {{P-|3831}}
|v3.q3.v1={{Q-|127843}}
|v3.r3.p1 = {{P-|854}}
|v3.r3.p1.v1=https://www.ara.cat/premium/elegancia-aliadofilia_0_1172882708.html
|v3.r3.p2 = {{P-|248}}
|v3.r3.p2.v1={{Q-|558617}}
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P742 |e={{DocInfobox prefix}}/doc/P742 |qid=Q1373218 |r=y |q=P3831, P407, P898, P580, P582, P282, P805, P2241, P7452, P2440, P1706, P1814, P2125, P8555, P1319, P8554, P1326, P3005, P138, P10663, P7528, P2183, P5886, P4970, P1721, P527, P1942, P2001, P3938, P8991, P9453, P9373, P585, P828, P1534, P5625, P123, P1552, P9311, P2441, P366, P3680, P2868, P1535 |d=
{{Button ST|red}} {{label|Q21503250}} → {{q-|Q5}}, {{q-|Q95074}}, {{q-|Q16334295}}, {{q-|Q26401003}}, {{q-|Q618779}}, {{q-|Q16887380}}, {{q-|Q11578774}}
}}
}}
Altres
[modifica]{{#invoke:CreateStatement/prova|main|item=Q76736492|property=P1963}}
Retorna (per a Bloc temàtic "premis" per Template:Global Infobox person (Q76736492) i Propietat de Wikidata per aquest tipus (P1963)):
Contingut desplegable |
---|
[
{
"type": "statement",
"qualifiers-order": [
"P2561",
"P518",
"P2306"
],
"mainsnak": {
"snaktype": "value",
"property": "P1963",
"datavalue": {
"value": {
"id": "P166",
"numeric-id": 166,
"entity-type": "property"
},
"type": "wikibase-entityid"
},
"datatype": "wikibase-property"
},
"qualifiers": {
"P2306": [
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "P585",
"numeric-id": 585,
"entity-type": "property"
},
"type": "wikibase-entityid"
},
"property": "P2306",
"hash": "a6be4e7a327c415e1c8d7d72c7fe6e7f784d4f57",
"datatype": "wikibase-property"
},
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "P1686",
"numeric-id": 1686,
"entity-type": "property"
},
"type": "wikibase-entityid"
},
"property": "P2306",
"hash": "4823e92ac83b0a4cb838d05c587cc3e1a2b066d2",
"datatype": "wikibase-property"
},
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "P1027",
"numeric-id": 1027,
"entity-type": "property"
},
"type": "wikibase-entityid"
},
"property": "P2306",
"hash": "f93df5e71f9a1e533cae64bcd25db20eaa16e392",
"datatype": "wikibase-property"
},
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "P642",
"numeric-id": 642,
"entity-type": "property"
},
"type": "wikibase-entityid"
},
"property": "P2306",
"hash": "31696ca64ef67bab9f7b9a2e73fb597eded6804c",
"datatype": "wikibase-property"
},
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "P2425",
"numeric-id": 2425,
"entity-type": "property"
},
"type": "wikibase-entityid"
},
"property": "P2306",
"hash": "a3de61521442835ea9cd134e714e5710c023d1c6",
"datatype": "wikibase-property"
}
],
"P2561": [
{
"snaktype": "value",
"datavalue": {
"value": {
"language": "ca",
"text": "premis"
},
"type": "monolingualtext"
},
"property": "P2561",
"hash": "6a7e496484650237669eaecb9f9fa104e5d7590f",
"datatype": "monolingualtext"
}
],
"P518": [
{
"snaktype": "value",
"datavalue": {
"value": {
"id": "Q199693",
"numeric-id": 199693,
"entity-type": "item"
},
"type": "wikibase-entityid"
},
"property": "P518",
"hash": "3ee58462859323b3341ec0c02fd16aa9036af0fd",
"datatype": "wikibase-item"
}
]
},
"id": "Q76736492$562303ce-4645-1f21-be5a-3f72ffe5d0d2",
"rank": "normal"
}
]
|
{{Statement+
|P = {{P-|1963}}
{{label|Q76736492}}
|v1= {{P-|166}}
|v1.q1.p = {{P-|2561}}
|v1.q1.v1=premis (ca)
|v1.q2.p = {{P-|518}}
|v1.q2.v1={{Q-|199693}}
|v1.q3.p = {{P-|2306}}
|v1.q3.v1={{P-|585}}
|v1.q3.v2={{P-|1686}}
|v1.q3.v3={{P-|1027}}
|v1.q3.v4={{P-|642}}
|v1.q3.v5={{P-|2425}}
|doc = {{DocInfobox docStatement |doc = {{{doc|}}} |p=P1963 |e={{DocInfobox prefix}}/doc/P1963 |qid=Q76736492 |q=P8395, P8396, P1552, P8397, P2559, P1480, P11889, P1011, P8111 |d=
{{Button ST|red}} {{label|Q21503247}} → {{p-|P279}}
{{Button ST|red}} {{label|Q21510865}} → {{q-|Q18616576}}
}}
}}
Vegeu també
[modifica]local p = {}
local SA = require "Module:SimpleArgs"
local SD = require "Module:SimpleDebug"
local WD = require "Module:Wikidades"
function FromWbEntity (value)
local Char = ''
if value["entity-type"] == "item" then
Char = 'Q'
else -- == "property",
Char = 'P'
end
return '{{'..Char..'-|'..value["numeric-id"]..'}}'
end --FromWbEntity
function p.main (frame)
local args, NArgs = SA.GetArgs (frame)
if NArgs == 0 then return end
local qid = SA.RStr_Par (args, 'item')
local pid = SA.RStr_Par (args, 'property')
local long_names = SA.Bool_Par (args, 'long_names', false)
local S = '{{Statement+<br/>'
S = S..'|P = {{P-|'..string.sub(pid,2)..'}}<br/><small>{{label|'..qid..'}}</small><br/>'
tab = mw.wikibase.getAllStatements (qid, pid)
local v = 1
local q = 1
local val = ''
local qualifiers = nil
local qualorder = nil
local references = nil
local reforder = nil
function prepQ (id)
return '{{Q-|'..string.sub(id,2)..'}}'
end
function forValue (datatype, value)
local val1 = ''
local val2 = ''
if datatype == 'string' then
val1 = value
elseif datatype == 'monolingualtext' then
local lang = value["language"]
val1 = value["text"]..' ('..lang..')'
elseif datatype == "quantity" then
val1 = tonumber(value["amount"])
if (val1 > 999) or (val1 ~= math.floor(val1)) then
val1 = '{{Nts|'..val1..'}}'
end
local unit = value["unit"]
if unit == '1' then
unit = ''
else
unit = string.sub (unit, (#unit - unit:reverse():find("/"))+2)
unit = '{{label|'..unit..'}}'
end
if unit ~= '' then
val1 = val1.. ' '..unit
end
elseif datatype == 'time' then
val1 = value["time"]
precision = value["precision"]
val1 = string.sub(val1, 1, precision)
if precision == 11 then
val1 = '{{date|'..string.sub(val1,2)..'}}'
else
val1 = string.sub(val1, 1, 5)
val1 = tonumber (val1)
end
local calmod = value["calendarmodel"]
if calmod ~= nil then
calmod = string.sub (calmod, (#calmod - calmod:reverse():find("/"))+2)
--[[]
if calmod == 'Q1985727' then
calmod = '{{int:Wikibase-time-calendar-gregorian}}'
else
calmod = '{{label|'..calmod..'}}'
end
val1 = val1..' <sup><i>'..calmod..'</i></sup>'
--]]
if calmod ~= 'Q1985727' then
val1 = val1..' <sup><i>{{label|'..calmod..'}}</i></sup>'
end
end
elseif datatype == 'globecoordinate' then
val1 = '{{coord|'..value["latitude"]..'|'..value["longitude"]..'}}'
elseif datatype == 'wikibase-entityid' then
val1 = FromWbEntity (value)
end
return val1, val2
end --forValue
function forDatavalue (dv, char1, char2, AsProp)
if dv == nil then return end
local val1, val2 = forValue (dv["type"], dv["value"])
local ini = char1..v
if char1 == 'r' then
ini = 'v'..v..'.'..ini
end
local SNow = '|'..ini
if AsProp then
SNow = SNow..' = '..val1..'<br/>'
else
SNow = SNow..'.'..char2..q..'.v1='..val1..'<br/>'
if val2 ~= '' then
SNow = SNow..'.'..char2..q..'.v2='..val2..'<br/>'
end
q = q + 1
end
S = S..SNow
end --forDatavalue
function forDatavalueProp (dv, z)
local val1, val2 = forValue (dv["type"], dv["value"])
local SNow = '|v'..v..'.q'..q..'.v'..z..'='..val1..'<br/>'
S = S..SNow
end --forDatavalueProp
function forRef ()
if reforder == nil then
else
for c, d in pairs(reforder) do
forp = references[d][1]["datavalue"]
S = S..'|v'..v..'.r'..v..'.p'..q..' = {{P-|'..string.sub(d,2)..'}}<br/>'
forDatavalue (forp, 'r', 'p')
end
end
end --forRef
local Docprop = {
p = {'property', 'p', 0},
e = {'example', 'e', 0},
qid = {'case', 'qid', 0},
m = {'monovalue', 'm', 2, 'Q19474404', 'Q21510857'},
s = {'symmetric', 's', 1, 'Q21510862'},
u = {'units', 'u', 1, 'Q21514353'},
r = {'reference', 'r', 1, 'Q54554025'},
i = {'inverse', 'i', 1, 'Q21510855'},
o = {'one_of', 'o', 1, 'Q21510859'},
c = {'contemporary','c', 1, 'Q25796498'},
q = {'qualifier', 'q', 0, 'Q21510851'},
d = {'description', 'd', 0},
}
---begin main---
for a, b in pairs(tab) do
q = 1
if b["qualifiers"] ~= nil then
local qualis = b["qualifiers"][1]
qualorder = b["qualifiers-order"]
qualifiers = b["qualifiers"]
end
if b["references"] ~= nil then
local refs = b["references"][1]
reforder = refs["snaks-order"]
references = refs["snaks"]
end
local datatype = b["mainsnak"]["datatype"]
local datavalue = b["mainsnak"]["datavalue"]
local Isdv = false
if datatype == nil then
datatype = b["dv"]["datatype"]
Isdv = true
end
if datatype == "wikibase-property" then
if qualorder == nil then
else
S = S..'|v'..v..'= '..FromWbEntity (datavalue["value"])..'<br/>'
for c, d in pairs(qualorder) do
S = S..'|v'..v..'.q'..q..'.p = {{P-|'..string.sub(d,2)..'}}<br/>'
local z = 1
for cc, dd in ipairs(qualifiers[d]) do
forp = dd["datavalue"]
forDatavalueProp (forp, z)
z = z + 1
end
q = q + 1
end
end
elseif datatype == "wikibase-item" then
local id = datavalue["value"]["id"]
S = S..'|v'..v..'= '..prepQ(id)..'<br/>'
local forp = ''
if qualorder == nil then
forDatavalue (datavalue, 'v', 'q')
else
for c, d in pairs(qualorder) do
forp = qualifiers[d][1]["datavalue"]
S = S..'|v'..v..'.q'..q..'.p = {{P-|'..string.sub(d,2)..'}}<br/>'
forDatavalue (forp, 'v', 'q')
end
end
elseif datatype == "commonsMedia" then
local name = datavalue["value"]
local media = 'File:'..name..'|thumb|left|'..name
S = S..'|v'..v..' = '..media..'<br/>'
else
if Isdv then
forDatavalue (b["dv"]["datavalue"], 'v', 'q', true)
else --external-id, quantity
local forp = datavalue
if forp == nil then
--unknown value
else
if qualorder == nil then
forDatavalue (forp, 'v', 'q', true)
else
local val = forValue (forp["type"], forp["value"])
S = S..'|v'..v..'= '..val..'<br/>'
for c, d in pairs(qualorder) do
forp = qualifiers[d][1]["datavalue"]
S = S..'|v'..v..'.q'..q..'.p = {{P-|'..string.sub(d,2)..'}}<br/>'
forDatavalue (forp, 'v', 'q')
end
end
end
end
end
q = 1
forRef ()
v = v + 1
end
function ItemName (what)
if long_names then
return Docprop[what][1]
else
return Docprop[what][2]
end
end
local doc = '{{DocInfobox docStatement |doc = {{{doc|}}} |'..ItemName('p')..'='..pid..' |'..ItemName('e')..'={{DocInfobox prefix}}/doc/'..pid
doc = doc..' |'..ItemName('qid')..'='..qid
local lines = WD.claim{item=pid, property='P2302', formatting='raw', separator=',', editicon='false'}
if lines ~= nil then
lines = mw.text.split(mw.text.trim(lines), ',')
for k, v in pairs (Docprop) do
if v[3] > 0 then
for kk, vv in ipairs (lines) do
if v[3] == 2 then
if vv == v[4] then
doc = doc..' |'..ItemName(k)..'=1'
break
elseif vv == v[5] then
doc = doc..' |'..ItemName(k)..'=2'
break
end
elseif vv == v[4] then
doc = doc..' |'..ItemName(k)..'=y'
break
end
end
end
end
for kk, vv in ipairs (lines) do
if vv == Docprop['q'][4] then
lines = WD.claim {item=pid, property='P2302', qualifier='P2306',
formatting='table', whitelist0='Q21510851', rowformat='$1', colformat1='raw', editicon='false'}
doc = doc..' |'..ItemName('q')..'='..lines
break
end
end
local subdoc = ''
function WDHere (whitelist0, qualifier, labchar)
local lin = WD.claim {item=pid, property='P2302', qualifier=qualifier,
formatting='table', whitelist0=whitelist0, rowformat='$1', colformat1='raw', editicon='false'}
if lin ~= nil then
local sep = ''
if labchar == 'p' then
sep = '<br />'
else --labchar == 'q' then
sep = ', '
end
lin = mw.text.split(mw.text.trim(lin), sep)
local labels = ''
for j, w in ipairs (lin) do
if labels ~= '' then
labels = labels..','
end
labels = labels..' {{'..labchar..'-|'..w..'}}'
end
subdoc = subdoc..'{{Button ST|red}} {{label|'..whitelist0..'}} →'..labels..'<br>'
end
end
line = WDHere ('Q21503247', 'P2306', 'p')
line = WDHere ('Q21503250', 'P2308', 'q')
line = WDHere ('Q21510865', 'P2308', 'q')
if subdoc ~= '' then
doc = doc..' |'..ItemName('d')..'='..'<small><br>'..subdoc..'</small>'
end
end
S = S..'|doc = '..doc..'}}'
S = S..'<br/>}}'
return S
end --main
return p