Testing Calls: Difference between revisions
From Bodhicitta
(VSCode edit) |
(VSCode edit) |
||
| Line 68: | Line 68: | ||
=== Straight up ED call using #externalvalue === | === Straight up ED call using #externalvalue === | ||
<pre> | |||
{{#external_value:Bio|source=https://commons.tsadra.org/index.php?title=Special%3AAsk&q=%5B%5BLekden,_G.%5D%5D&po=Bio&p%5Blimit%5D=1&p%5Bformat%5D=csv&p%5Bvaluesep%5D=;}} | |||
</pre> | |||
Revision as of 13:09, 6 April 2026
Using $smwgQuerySources with a remote template
# Remote Queries settings
$smwgQuerySources = [
'research' => [
'\\SMW\\Query\\RemoteRequest',
'url' => 'https://research.tsadra.org/index.php',
'cache' => 86400
],
'commons' => [
'\\SMW\\Query\\RemoteRequest',
'url' => 'https://commons.tsadra.org/index.php',
'cache' => 86400
]
];
{{#ask:[[Lekden,_G.]]
|?Bio
|named args=true
|link=none
|source=commons
|format=template
|template=TestingCall
}}
CONCLUSION
- For SMW remote queries, REDIS is the only obstacle to changes propagating.
Using Module:GetData > remoteSet() (api.php?action=ask&format=json)
local remoteContent, rcErrors = mw.ext.externalData.getExternalData("https://" .. pargs.source .. ".tsadra.org/api.php?action=ask&query=" .. extQuery .. "&format=json&api_version=3")
{{SetRemoteValues
|page=Lekden,_G.
|source=commons
|props=Bio
}}
Straight up ED call using #externalvalue
{{#external_value:Bio|source=https://commons.tsadra.org/index.php?title=Special%3AAsk&q=%5B%5BLekden,_G.%5D%5D&po=Bio&p%5Blimit%5D=1&p%5Bformat%5D=csv&p%5Bvaluesep%5D=;}}