Testing Calls: Difference between revisions

From Bodhicitta
(VSCode edit)
(VSCode edit)
Line 48: Line 48:




=== Using Module:GetData > remoteSet() (api.php?action=ask&format=json) ===
=== Using Module:GetData > remoteSet() (api.php?action=ask&format=json > ED function > parsed JSON) ===


<pre>
<pre>

Revision as of 13:15, 6 April 2026

Using $smwgQuerySources with a remote template

SETTINGS

# Remote Queries settings in LocalSettings.php
$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
}}

VALUE



CONCLUSION

  • For SMW remote queries, REDIS is the only obstacle to changes propagating.



Using Module:GetData > remoteSet() (api.php?action=ask&format=json > ED function > parsed 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
}}


Look at the Browse page for value.



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=;}}

Ven. Gyalten Lekden was born and raised outside of Boston. He first started studying and practicing Buddhism during his undergraduate studies, and after completing BAs in Theatre and Religious Studies he continued on to complete his Masters of Divinity in Buddhist Ministry at Harvard Divinity School. Ven. Lekden started leading Buddhist communities while an undergrad, and has studied, served, and taught at various Dharma centers since then. In 2012 he joined Sera Je Monastery in southern India, where he continues to study and practice. Ven. Lekden is a registered teacher in the Foundation for the Preservation of the Mahayana Tradition, and has given Dharma talks and meditation instruction in India and the USA. (Source Accessed Mar 27, 2026).