Extension:External Data/Common problems


 * If the call to #get_web_data or #for_external_table isn't returning any data, and the page being accessed is large, it could be because the call to retrieve is getting timed out. You should set the flag in your LocalSettings.php file (which represents a number of seconds) to some number greater than 25, its default value. You could call, for instance:




 * If the data being accessed has changed, but the wiki page accessing it still shows the old data, it is because that page is being cached by MediaWiki. There are several solutions to this: if you are an administrator, you can hit the "refresh" tab above the page, which will purge the cache. You can also easily disable caching for the entire wiki; see here for how. Finally, if you wait long enough (typically no more than 24 hours), the page will get refreshed on its own and display the new data.


 * If you host a private wiki locally but use a dynamic IP service to access it, your wiki will connect to itself through your public IP and not through localhost or 127.0.0.1 (or an IPv6 equivalent). In such a case, your wiki is not allowed to query itself so the examples given here will work when data are hosted on a different server but not if they are hosted on your wiki. A workaround is to use the extension Extension:NetworkAuth which allows you to automatically authenticate your router/box/modem to access your wiki. Note: the security of this approach is not guaranteed.


 * If the extension is not correctly handling non-ASCII characters, the problem might be that your PHP instance lacks the mbstring extension - make sure that it is installed.


 * To query data from another wiki that uses Semantic MediaWiki, it is recommended to use the Special:Ask page, rather than one of SMW's API actions, to construct the URL that will be passed in to #get_web_data, since the API will not output data in a syntax that External Data can use. To construct the URL, go to Special:Ask, create the desired query, then copy the URL from the "Download queried results in CSV format" link.
 * If such queries of Semantic MediaWiki data are adapted for use inside templates by adding parameters, it is required to escape special characters that are contained in the parameter. The appropriate encoding method is hex ASCII encoding, with each encoded character preceded by a single hyphen-minus (-). Although some characters in the query URL provided by Special:Ask are percent-encoded,1 the query generally requires special characters to be hyphen-encoded rather than percent-encoded. Using percent-encoding causes the query to fail silently (it will neither return errors nor results). Character encoding can be achieved with any method, including the StringFunction (crude but it works) or a pertinent Lua module. The  magic word does not work however because it percent-encodes special characters, which isn't appropriate.
 * 1The query URL provided by Special:Ask hypen-encodes elements like property names and values but percent-encodes characters that delimit parts of the smw query; e.g.,,  ,  ,  ,  . ''However, tests suggest that even the latter parts of queries can safely be hyphen-encoded.