176 lines
5.9 KiB
JSON
176 lines
5.9 KiB
JSON
{
|
|
"description": "Test `_ref_rec` with a `_eid` field (#2985)",
|
|
"setup": [
|
|
{
|
|
"namespace": "SMW_NS_PROPERTY",
|
|
"page": "WDID",
|
|
"contents": "[[Has type::External identifier]][[External formatter uri::https://www.wikidata.org/entity/$1]]"
|
|
},
|
|
{
|
|
"namespace": "SMW_NS_PROPERTY",
|
|
"page": "wikipedia",
|
|
"contents": "[[Has type::External identifier]][[External formatter uri::https://en.wikipedia.org/w/index.php?title=$1&oldid=$2]]"
|
|
},
|
|
{
|
|
"namespace": "SMW_NS_PROPERTY",
|
|
"page": "Has page",
|
|
"contents": "[[Has type::Page]]"
|
|
},
|
|
{
|
|
"namespace": "SMW_NS_PROPERTY",
|
|
"page": "WD reference (url,eid)",
|
|
"contents": "[[Has type::Reference]] [[Has fields::URL;WDID]]"
|
|
},
|
|
{
|
|
"namespace": "SMW_NS_PROPERTY",
|
|
"page": "WD reference (eid,url)",
|
|
"contents": "[[Has type::Reference]] [[Has fields::WDID;URL]]"
|
|
},
|
|
{
|
|
"namespace": "SMW_NS_PROPERTY",
|
|
"page": "WD reference (wpg,eid,url)",
|
|
"contents": "[[Has type::Reference]] [[Has fields::Has page;WDID;URL]]"
|
|
},
|
|
{
|
|
"namespace": "SMW_NS_PROPERTY",
|
|
"page": "Wikipedia reference",
|
|
"contents": "[[Has type::Reference]] [[Has fields::Number;wikipedia]]"
|
|
},
|
|
{
|
|
"page": "Franz Schubert",
|
|
"contents": "[[WD reference (url,eid)::https://en.wikipedia.org/wiki/Franz_Schubert;Q7312]]"
|
|
},
|
|
{
|
|
"page": "P0916/1",
|
|
"contents": "[[WD reference (url,eid)::https://en.wikipedia.org/wiki/Franz_Schubert;Q7312]]"
|
|
},
|
|
{
|
|
"page": "P0916/Q.1.1",
|
|
"contents": "{{#show: P0916/1 |?WD reference (url,eid) }}"
|
|
},
|
|
{
|
|
"page": "P0916/2",
|
|
"contents": "[[Wikipedia reference::837787373;Truid Aagesen{837787373}]]"
|
|
},
|
|
{
|
|
"page": "P0916/3",
|
|
"contents": "[[WD reference (eid,url)::Q7312;https://en.wikipedia.org/wiki/Franz_Schubert]]"
|
|
},
|
|
{
|
|
"page": "P0916/Q.3.1",
|
|
"contents": "{{#show: P0916/3 |?WD reference (eid,url) }}"
|
|
},
|
|
{
|
|
"page": "P0916/4",
|
|
"contents": "[[WD reference (wpg,eid,url)::Franz Schubert;Q7312;https://en.wikipedia.org/wiki/Franz_Schubert]]"
|
|
},
|
|
{
|
|
"page": "P0916/Q.4.1",
|
|
"contents": "{{#show: P0916/4 |?WD reference (wpg,eid,url) }}"
|
|
}
|
|
],
|
|
"tests": [
|
|
{
|
|
"type": "parser",
|
|
"about": "#0 (reference with url,eid)",
|
|
"subject": "P0916/1",
|
|
"assert-store": {
|
|
"semantic-data": {
|
|
"strict-mode-valuematch": false,
|
|
"propertyCount": 3,
|
|
"propertyKeys": [
|
|
"_MDAT",
|
|
"_SKEY",
|
|
"WD reference (url,eid)"
|
|
]
|
|
}
|
|
},
|
|
"assert-output": {
|
|
"to-contain": [
|
|
"data-content=\"<ul><li><a href=".*:WDID"",
|
|
"title=".*:WDID">WDID</a>: <a href="https://www.wikidata.org/entity/Q7312" target="_blank">Q7312</a></li></ul>\" title=\"WDID: Q7312\">"
|
|
],
|
|
"not-contain": [
|
|
"title=".*:WDID">WDID</a>: <span class="plainlinks smw-eid"><a rel=\"nofollow\" class=\"external text\" href=\"https://www.wikidata.org/entity/Q7312\">Q7312</a></span></li></ul>\" title=\"WDID: <a rel=\"nofollow\" class=\"external text\" href=\"https://www.wikidata.org/entity/Q7312\">Q7312</a>\">"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "parser",
|
|
"about": "#1 (reference with url,eid)",
|
|
"subject": "P0916/2",
|
|
"assert-store": {
|
|
"semantic-data": {
|
|
"strict-mode-valuematch": false,
|
|
"propertyCount": 3,
|
|
"propertyKeys": [
|
|
"_MDAT",
|
|
"_SKEY",
|
|
"Wikipedia reference"
|
|
]
|
|
}
|
|
},
|
|
"assert-output": {
|
|
"to-contain": [
|
|
"Wikipedia">Wikipedia</a>: <a href="https://en.wikipedia.org/w/index.php?title=Truid_Aagesen&amp;oldid=837787373" target="_blank">Truid Aagesen"
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "parser",
|
|
"about": "#2 (#show reference with url,eid)",
|
|
"subject": "P0916/Q.1.1",
|
|
"assert-output": {
|
|
"to-contain": [
|
|
"<p><a rel=\"nofollow\" class=\"external text\" href=\"https://en.wikipedia.org/wiki/Franz_Schubert\">https://en.wikipedia.org/wiki/Franz Schubert</a>",
|
|
"data-content=\"<ul><li><a href=".*WDID" title=".*WDID">WDID</a>: <a",
|
|
"href="https://www.wikidata.org/entity/Q7312" target="_blank">Q7312</a></li></ul>\""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "parser",
|
|
"about": "#3 (#show reference with eid,url)",
|
|
"subject": "P0916/Q.3.1",
|
|
"assert-output": {
|
|
"to-contain": [
|
|
"<p><span class=\"plainlinks smw-eid\"><a rel=\"nofollow\" class=\"external text\" href=\"https://www.wikidata.org/entity/Q7312\">Q7312</a></span>",
|
|
"data-content=\"<ul><li><a",
|
|
"href=".*URL" title=".*URL">URL</a>: <a class="external" rel="nofollow"",
|
|
"href="https://en.wikipedia.org/wiki/Franz_Schubert">https://en.wikipedia.org/wiki/Franz Schubert</a></li></ul>\""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "parser",
|
|
"about": "#4 (#show reference with wpg,eid,url)",
|
|
"subject": "P0916/Q.4.1",
|
|
"assert-output": {
|
|
"to-contain": [
|
|
"<p><a href=\".*Franz_Schubert\" title=\"Franz Schubert\">Franz Schubert</a>",
|
|
"data-content=\"<ul><li><a",
|
|
"href=".*WDID" title=".*WDID">WDID</a>: <a",
|
|
"href="https://www.wikidata.org/entity/Q7312" target="_blank">Q7312</a></li><li><a",
|
|
"href=".*URL" title=".*URL">URL</a>: <a class="external" rel="nofollow"",
|
|
"href="https://en.wikipedia.org/wiki/Franz_Schubert">https://en.wikipedia.org/wiki/Franz Schubert</a></li></ul>\""
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"settings": {
|
|
"wgContLang": "en",
|
|
"wgLang": "en",
|
|
"smwgPageSpecialProperties": [
|
|
"_MDAT"
|
|
],
|
|
"smwgNamespacesWithSemanticLinks": {
|
|
"NS_MAIN": true,
|
|
"SMW_NS_PROPERTY": true
|
|
}
|
|
},
|
|
"meta": {
|
|
"version": "2",
|
|
"is-incomplete": false,
|
|
"debug": false
|
|
}
|
|
} |