Testing Calls: Difference between revisions

From Bodhicitta
(VSCode edit)
(VSCode edit)
Line 61: Line 61:
|props=Bio
|props=Bio
}}
}}
=== Straight up ED call using #externalvalue ===

Revision as of 13:07, 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