Extension:WikiLambda/API

From Linux Web Expert

The WikiLambda extension has a simple API for internal and external use. These APIs let you search and fetch WikiFunctions content and retrieve it in different formats and after different transformations.

These APIs are modules and submodules of MediaWiki Action API. You can make requests, explore the examples and see the results in the MediaWiki API Sandbox.

wikilambda_fetch

This API allows to retrieve one or more of ZObject pages from Wikifunctions. Every requested ZObject will be returned as a string encoding its canonical JSON representation. If a particular language is requested, the ZObject will return its root object label in the selected language (or fallbacks).

This API, designed as an Action API module, is created for its external use and hence the returned ZObjects are encoded as strings. For internal use in the Wikifunctions application, please see below the documentation of #list=wikilambdaload_zobjects

Documentation

Method: GET

Action: wikilambda_fetch

Request: api.php?action=wikilambda_fetch&format=json&zids=Z111|Z112&language=en

Response:

{
  "Z111": {
    "wikilambda_fetch": "{\n    \"Z1K1\": \"Z2\",\n    \"Z2K1\": \"Z111\"\n}"
  },
  "Z112": {
    "wikilambda_fetch": "{\n    \"Z1K1\": \"Z2\",\n    \"Z2K1\": \"Z112\"\n}"
  }
}

Parameters

name description
zids

required | string

List of ZObject Identifiers (ZIDs) to fetch, separated by pipes.

E.g. zids=Z1|Z2|Z3

language

optional | string

String code for the language in which to return the results. Must be an accepted MediaWiki language code. If not present, the API will return the root label in all available languages.

E.g. language=es

Possible Errors

This API expects no errors to be found. If any of the ZIDs is invalid or cannot be found, the returned object will consist solely on the found error and will not return the valid objects.


error name error type (Z50) description
Invalid ZID Z549 The given ZID is an invalid ZObject ID. This means that it does not follow the expected format of ID starting with the capital letter Z and followed by a natural number.
ZID not found Z500 The given ZID does not exist in this wiki.

Examples

api.php?action=wikilambda_fetch&format=json&zids=Z1
Returns the canonical representation of the ZObject with ZID Z1 with its labels in all available languages.


api.php?action=wikilambda_fetch&format=json&zids=Z1|Z2|Z3
Returns the canonical representation of the ZObjects with ZIDs Z1, Z2 and Z3 with its labels in all available languages.


api.php?action=wikilambda_fetch&format=json&zids=Z4|Z6&language=es
Returns the canonical representation of the ZObjects with ZIDs Z4 and Z6 with its root-level label in Spanish or available fallback languages.


wikilambda_edit

Docs for internal team purposes only

This API allows to create/edit persisted ZObject pages in Wikifunctions. The API expects the parameter zobject to be a valid JSON representation of the ZObject in its canonical form.

To create a new ZObject, the parameter zid must be omitted, and Wikifunctions will find and assign the next available ZID. Also, the keys from the JSON ZObject that refer to its identity (for example, Z2K1 or the values of Z4K1 and Z3K2), must be set to the Null Reference (Z0).

To edit an existing ZObject, the parameter zid must have the ZID of the ZObject to edit (which will be the same one as the internal identity keys).

Documentation

Method: GET

Action: wikilambda_edit

Request: api.php?action=wikilambda_edit&format=json&summary=TestSummary&zid=Z10001&zobject=<URL_ENCODED_JSON_OBJECT>

Response:

{
    "wikilambda_edit": {
        "success": "",
        "articleId": 1096,
        "title": "Z10001",
        "page": "Z10001"
    }
}

Parameters

name description
summary

required | string

Summary message for the edit.

E.g. summary=New%20zobject

zid

optional | string

ZID of the ZObject to edit. In case of creating a new ZObject, the field must be empty.

E.g. zid=Z10001

zobject

required | string

JSON representation of the ZObject to be saved, in canonical form. If it's a new ZObject to be saved, the self-referential keys must be replaced by Z0 instead of the ZID. For example Z2K1 and Z4K1 must take the value of Z0, and the key IDs must be Z0K1, Z0K2, etc.

E.g. zobject={ "Z1K1":"Z2","Z2K1":"Z0","Z2K2":"value","Z2K3":{"Z1K1":"Z12","Z12K1":[]}}

token

required | string

CSRF token


Possible Errors

This API can return a wide variety of errors, because the provided ZObject is parsed and validated against the canonical schemata. All the validation errors will be wrapped in a error of type Z502. Apart from the validation errors, Wikifunctions can detect a variety of problems described below.

error name error type (Z50) description
Validation error Z502 The given ZObject is not well formed. The error body will contain the nested sub-errors that better describe the problem. For more information about nesting of validation error, read the Representation of errors page in meta.
Invalid page title Z556 The given ZID is an invalid page title and could not be created.
Unmatching ZID and page title Z555 The given ZID and the content of the self-referential keys (E.g. Z2K1) does not match.
User does not have permission to edit Z557 The user is not logged in or does not have the required permissions to create or edit pages.
Disallowed root type Z553 The ZPersistentObject or ZObject passed as the value of the zobject parameter is disallowed from being saved directly as a page. Disallowed ZObjects are Z3/Key, Z5/Error, Z16/Code, Z17/Argument declaration, Z18/Argument reference and Z39/Key reference.
Disallowed root type Z553 The ZPersistentObject or ZObject passed as the value of the zobject parameter is disallowed from being saved directly as a page. Disallowed ZObjects are Z3/Key, Z5/Error, Z16/Code, Z17/Argument declaration, Z18/Argument reference and Z39/Key reference.
Label clash Z554 The given label for a language clashes with another ZObject's label in that language.

Examples

api.php?action=wikilambda_edit&format=json&summary=New zobject&zobject=urlencode( ZOBJECT )&token=%2B\
Where ZOBJECT is:
{
	"Z1K1": "Z2",
	"Z2K1": "Z0",
	"Z2K2": "zobject value",
	"Z2K3": {
		"Z1K1": "Z12",
		"Z12K1": [{
			"Z1K1": "Z11",
			"Z11K1": "Z1002",
			"Z11K2": "zobject label"
		}]
	}
}
Creates and saves a new ZObject in the database (empty values) and returns the newly assigned ZID.


api.php?action=wikilambda_edit&format=json&summary=Edit zobject&zid=Z10004&zobject=urlencode( ZOBJECT )&token=%2B\
Where ZOBJECT is:
{
	"Z1K1": "Z2",
	"Z2K1": {
		"Z1K1": "Z6",
		"Z6K1": "Z10004"
	},
	"Z2K2": "new zobject value",
	"Z2K3": {
		"Z1K1": "Z12",
		"Z12K1": [{
			"Z1K1": "Z11",
			"Z11K1": "Z1002",
			"Z11K2": "new zobject label"
		}]
	}
}
Edits the ZObject with title Z10004 and overwrites it with the given JSON ZObject.

wikilambda_function_call

Docs for internal team purposes only

One of the entrypoints to the Wikifunctions orchestration and evaluation back-end. This API receives a required JSON formatted ZObject and sends it to the function-orchestrator services for it to be evaluated and returned. Hence, the ZObject sent must be a Z7/Function call.

Documentation

Method: GET

Action: wikilambda_function_call

Request: api.php?action=wikilambda_function_call&format=json&wikilambda_function_call_zobject=<URL_ENCODED_JSON_FUNCTION>

Response:

{
    "query": {
        "wikilambda_function_call": {
            "Orchestrated": {
                "success": "",
                "data": "{\"Z1K1\":\"Z22\",\"Z22K1\":{\"Z1K1\":\"Z40\",\"Z40K1\":\"Z42\"},\"Z22K2\":\"Z23\"}"
            }
        }
    }
}

Parameters

name description
wikilambda_function_call_zobject

required | string

JSON representation of the ZObject to send for its execution

E.g. {"Z1K1":"Z7","Z7K1":"Z881","Z881K1":"Z6"}


Possible Errors

Describe function-orchestrator and evaluator most probable errors

error name error type (Z50) description
Connection error (TODO) Unable to connect to the function orchestrator service.
Validation error Z502 The given function call is not well formed. The error body will contain the nested sub-errors that better describe the problem. For more information about nesting of validation error, read the Representation of errors page in meta.
Zid not found Z504 One of the Type ZIDs from the objects involved in the function call cannot be found and hence cannot be validated.
Argument type mismatch Z506 The type of an argument instantiated in the function call does not match with its function argument definition.
Error in evaluation Z507 Something happened during the execution step which raised an error. The returned value of this error will also include the error propagated from the function evaluator and/or executor services.
Argument value error Z516 One of the arguments passed to a built-in function had a wrong value or type.
Return type mismatch Z517 The type returned by a function call does not match the expected type from that function definition.
Object type mismatch Z518 One of the arguments passed to the function call cannot be processed or their type evaluated.
Unexpected ZObject type Z542 (TODO) Currently this is Z539

The ZObject passed as wikilambda_function_call_zobject argument has an incorrect type, while it should be a Z7/Function call

Examples

api.php?action=wikilambda_function_call&format=json&wikilambda_function_call_zobject=<URL_ENCODED_JSON_FUNCTION>
Where the function is:
{
	"Z1K1": "Z7",
	"Z7K1": "Z802",
	"Z802K1": {
		"Z1K1": "Z40",
		"Z40K1": "Z42"
	},
	"Z802K2": ["arbitrary ZObject"],
	"Z802K3": {
		"Z1K1": "Z40",
		"Z40K1": "Z42"
	}
}
Requests the execution of the function with ZID Z802 (built-in function If(condition, then, else)), where the value of Z802K1/Condition is Z42/False. The expected result is to be returned the value of Z802K3/Else. The returned result, as expected:
{
    "query": {
        "wikilambda_function_call": {
            "Orchestrated": {
                "success": "",
                "data": "{\"Z1K1\":\"Z22\",\"Z22K1\":{\"Z1K1\":\"Z40\",\"Z40K1\":\"Z42\"},\"Z22K2\":\"Z23\"}"
            }
        }
    }
}
Observe what happens when, instead of passing Z42/False as the condition, we pass Z41/True:
{
    "query": {
        "wikilambda_function_call": {
            "Orchestrated": {
                "success": "",
                "data": "{\"Z1K1\":\"Z22\",\"Z22K1\":[\"arbitrary ZObject\"],\"Z22K2\":\"Z23\"}"
            }
        }
    }
}

wikilambda_perform_test

Docs for internal team purposes only

This is an internal API endpoint to query test results for a ZFunction. Accepts a Z8/Function, a list of Z14/Implementations, and a list of Z20/Testers. Accepts a ZID for the ZFunction, and a list of either ZIDs or full JSON ZObjects for the ZImplementations and ZTesters.

If a test result is up-to-date in the results database cache, it will be retrieved from there. Otherwise, the test will be run by a call to the WikiFunctions orchestrator.

In addition, under certain conditions this API reorders the implementations of the given function and updates the function's Z8K4/implementations property in persistent storage. The reordering indicates increasing average execution times of the orchestrator (and possibly other backend services) in running the ZTesters. Reordering only involves the function's currently attached ZImplementations and ZTesters. For reordering to occur, the requested ZImplementations / ZTesters must either be blank or a superset of currently attached ZImplementations / ZTesters, and there must be no results retrieved from the cache.

Documentation

Method: GET

Action: wikilambda_perform_test

Request: api.php?action=wikilambda_perform_test&format=json&wikilambda_perform_test_zfunction=Z813&wikilambda_perform_test_zimplementations=Z913& wikilambda_perform_test_ztesters=Z8130

Response:

{
    "query": {
        "wikilambda_perform_test": [
            {
                "zFunctionId": "Z813",
                "zImplementationId": "Z913",
                "zTesterId": "Z8130",
                "testMetadata": "...",
                "validateStatus": "..."
            }
        ]
    }
}

Parameters

name description
wikilambda_perform_test_zfunction

required | string

String ZID of the Z8/Function to test.

E.g. Z101

wikilambda_perform_test_zimplementations

optional | string

Valid JSON representation of a list of Z14/Implementation objects. Each object can be either a canonical reference (ZID to that implementation), a literal Z14/Implementation object, or a literal Z2/Persistent object wrapping a Z14/Implementation.

E.g. ["Z201", {"Z1K1": "Z14","Z14K1": "Z101","Z14K4": {"Z1K1": "Z6","Z6K1": "Z201"}}]

If blank, all associated implementations will be run.

wikilambda_perform_test_ztest

optional | string

Valid JSON representation of a list of Z20/Tester objects. Each object can be either a canonical reference (ZID to that tester), a literal Z20/Tester object, or a literal Z2/Persistent object wrapping a Z20/Tester.

E.g. ["Z10006", {"Z1K1":"Z20","Z20K1":"Z101","Z20K2":{"Z1K1":"Z7","Z7K1":"Z101"},"Z20K3":{"Z1K1":"Z7","Z7K1":"Z10007"}}]

If blank, all associated testers will be run.


Possible Errors

If an error occurs when evaluating a given ZTester's Z20K2, this error will be found in the "errors" entry of the returned "testMetadata". The error may be of any sort returned by wikilambda_function_call . If an error occurs when evaluating Z20K3, this will be found in the "validateErrors" entry.

Other errors this API method may return:

error name description
wikilambda-performtest-error-unknown-zid No object found with the ZID provided for the ZFunction, or the ZID provided for one of the given ZImplementations or ZTesters.
wikilambda-performtest-error-nonfunction The ZID provided for the ZFunction does not refer to an object of that type.
wikilambda-performtest-error-nonimplementation The ZID provided for a ZImplementation does not refer to an object of that type.
wikilambda-performtest-error-nontester The ZID provided for a ZTester does not refer to an object of that type.

Examples

api.php?action=wikilambda_perform_test&format=json&wikilambda_perform_test_zfunction=Z813&wikilambda_perform_test_zimplementations=Z913&wikilambda_perform_test_ztesters=Z8130
Requests running ZTester Z8130 on ZFunction Z813, with Z813 implemented by ZImplementation Z913.
api.php?action=wikilambda_perform_test&format=json&wikilambda_perform_test_zfunction=Z813&wikilambda_perform_test_zimplementations=Z913
Requests running all available ZTesters for ZFunction Z813, with Z813 implemented by Z913.
api.php?action=wikilambda_perform_test&format=json&wikilambda_perform_test_zfunction=Z813&wikilambda_perform_test_ztesters=Z8130
Requests running ZTester Z8130 on ZFunction Z813, with Z813 implemented by each of its available ZImplementations in turn.
api.php?action=wikilambda_perform_test&format=json&wikilambda_perform_test_zfunction=Z813&wikilambda_perform_test_zimplementations=<URL_ENCODED_JSON_ZIMPLEMENTATION>&wikilambda_perform_test_ztesters=Z8130
Requests running ZTester Z8130 on ZFunction Z813, with Z813 implemented by the ZImplementation encoded in URL_ENCODED_JSON_ZIMPLEMENTATION. Where URL_ENCODED_JSON_ZIMPLEMENTATION is
{
    "Z1K1": "Z14",
    "Z14K1": "Z813",
    "Z14K3": {
        "Z1K1": "Z16",
        "Z16K1": {
            "Z1K1": "Z61",
            "Z61K1": "javascript"
        },
        "Z16K2": "function Z813( Z813K1 ) {\n  return Z813K1.length === 0;\n}"
    }
}
api.php?action=wikilambda_perform_test&format=json&wikilambda_perform_test_zfunction=Z813&wikilambda_perform_test_zimplementations=Z913&wikilambda_perform_test_ztesters=<URL_ENCODED_JSON_ZTESTER>
Requests running the ZTester encoded in URL_ENCODED_JSON_ZTESTER on ZFunction Z813, with Z813 implemented by ZImplementation Z913. Where URL_ENCODED_JSON_ZTESTER is:
{
    "Z1K1": "Z20",
    "Z20K1": "Z813",
    "Z20K2": {
        "Z1K1": "Z7",
        "Z7K1": "Z813",
        "Z813K1": [
            "Z1"
        ]
    },
    "Z20K3": {
        "Z1K1": "Z7",
        "Z7K1": "Z844",
        "Z844K2": {
            "Z1K1": "Z40",
            "Z40K1": "Z41"
        }
    }
}

wikilambdaload_zobjects

Docs for internal team purposes only

Similarly to the wikilambda_fetch API detailed below, this API returns an aggregation of ZObject pages from Wikifunctions. This API is a list submodule of the action=query API and is dedicated to extension-wide internal requests. The return format is an array with the valid JSON representation of the ZObjects requested. It provides different parameters to configure the type of format to serialize the ZObjects to (either normal or canonical form) and the language for the object labels.

Documentation

Method: GET

Action: query

List: wikilambdaload_zobjects

Request: api.php?action=query&format=json&list=wikilambdaload_zobjects&wikilambdaload_zids=Z111|Z112&wikilambdaload_language=en&wikilambdaload_canonical=1

Response:

{
    "batchcomplete": "",
    "query": {
        "wikilambdaload_zobjects": {
            "Z111": {
                "success": "",
                "data": {
                    "Z1K1": "Z2",
                    "Z2K1": "Z111"
                }
            },
            "Z112": {
                "success": "",
                "data": {
                    "Z1K1": "Z2",
                    "Z2K1": "Z112"
                }
            }
        }
    }
}


Parameters

name description
wikilambdaload_zids

required | string

List of ZObject Identifiers (ZIDs) to fetch, separated by pipes.

E.g. wikilambdaload_zids=Z1|Z2|Z3

wikilambdaload_revisions

optional | string

List of Revision IDs to fetch, separated by pipes. The number of revision IDs, if set, must be equal to the number of ZIDs above.

E.g. wikilambdaload_revisions=1000|1001|1002

wikilambdaload_language

optional | string

String code for the language in which to return the results. Must be an accepted MediaWiki language code. If not present, the API will return the root label in all available languages.

E.g. wikilambdaload_language=es

wikilambdaload_get_dependencies

optional | boolean

When set to true, returns not only the requested ZObjects, but also the dependency types. These are: for every object of type Type/Z4, the types of all its keys, and for every object of type Function/Z8, the types of all its arguments. The default value is false.

E.g. wikilambdaload_get_dependencies=true

Possible Errors

Unlike the wikilambda_fetch API, this API can handle errors while still returning the information of the ZObjects that have been found. The returned errors will also be ZObjects of type ZError (Z5). To distinguish between the return of an error in the API execution and the return of a requested ZError object, the response includes the value `success` for each of the requested `ZIDs`.

The possible errors that can be returned for an individual ZID are detailed below.

error name error type (Z50) description
Invalid ZID Z549 The given ZID is an invalid ZObject ID. This means that it does not follow the expected format of ID starting with the capital letter Z and followed by a natural number.
ZID not found Z550 The given ZID does not exist in this wiki.

Examples

api.php?action=query&format=json&list=wikilambdaload_zobjects&wikilambdaload_zids=Z1|Z2
Returns the canonical JSON representation of the ZObjects with ZID Z1 and Z2 with its labels in all available languages.


api.php?action=query&format=json&list=wikilambdaload_zobjects&wikilambdaload_zids=Z3|Z4&wikilambdaload_language=ay
Returns the canonical JSON representation of the ZObjects with ZIDs Z3 and Z4 with all its ZMultilingual String (Z12) objects filtered to only return Aymaran labels. If an Aymaran label is not found, it will return those in any of the available fallback languages.


api.php?action=query&format=json&list=wikilambdaload_zobjects&wikilambdaload_zids=Z6&wikilambdaload_get_dependencies=true
Returns the canonical representation of the ZObjects with zid Z802 (the function If), and the dependent type Z40 (which is referred by one of the function argument).

wikilambdasearch_labels

Docs for internal team purposes only

This API query list generator lets you search ZObjects by their labels or aliases in a given language. It also provides a series of parameters that allow to filter by the ZObject type or by the return type of existing ZFunctions. It principally exists to support the look-ahead search system, and it's generally used in the front-end components that allow the user to search and select persisted ZObjects.

Documentation

Method: GET

Action: query

List: wikilambdasearch_labels

Request: api.php?action=query&format=json&list=wikilambdasearch_labels&wikilambdasearch_search=foo&wikilambdasearch_language=eu&wikilambdasearch_type=Z4&wikilambdasearch_return_type=Z4&wikilambdasearch_strict_return_type=true

Response:

{
    "batchcomplete": "",
    "query": {
        "wikilambdasearch_labels": [
            {
                "page_namespace": 0,
                "page_title": "Z111",
                "page_type": "Z111",
                "return_type": null,
                "label": "foo",
                "is_primary": 1,
                "page_id": 0,
                "page_content_model": "zobject",
                "page_lang": "eu"
            }
        ]
    }
}


Parameters

name description
wikilambdasearch_search

required | string

The search term to find in all the present labels.

E.g. wikilambdasearch_search=text

wikilambdasearch_language

required | string

String code for the language in which to return the results. Must be an accepted MediaWiki language code. If the labels aren't present for this language, use fallback languages.

E.g. wikilambdasearch_language=eu

wikilambdasearch_nofallback

optional | boolean (default=false)

Whether to search only in the given language and not its fallback languages. If set to true, it will ignore the fallback languages and only search in the requested language.

E.g. wikilambdasearch_nofallback=1

wikilambdasearch_exact

optional | boolean (default=false)

Whether to search for exact matches. If disabled, input will be taken as a case-insensitive, Unicode-normalised search with accents on Latin characters ignored.

E.g. wikilambdasearch_exact=1

wikilambdasearch_type

optional | string

Restrict matches to a specific type of ZObject. If present, the search term will only be matched against the labels of ZObjects of the specified type. This is particularly useful for UI components such as the Type selector, which autocompletes a search input with only available ZType (Z4) objects.

E.g. wikilambdasearch_type=Z4

wikilambdasearch_return_type

optional | string

Restrict matches to ZFunctions that can return the given type, including those who return a generic ZObject. If present, the search term will only be matched against the labels of the specified type. If present along with the wikilambdasearch_type, the results will contain all results matching the type OR the return_type.

E.g. wikilambdasearch_return_type=Z40

wikilambdasearch_strict_return_type

optional | boolean (default=false)

If the parameter wikilambdasearch_return_type is present, setting this parameter to true will exclude the generic ZObjects from the result and will only return the rows that match strictly the return type passed as a parameter. If the parameter wikilambdasearch_return_type is not set, this value is irrelevant: it will not affect those matches returned by type (parameter wikilambdasearch_type).

E.g. wikilambdasearch_strict_return_type=true

wikilambdasearch_limit

optional | integer

The maximum number of results to return. The value must be between 1 and 5000. Enter max to use the maximum limit.

E.g. wikilambdasearch_limit=10

wikilambdasearch_continue

optional | integer

When more results are available, use this to continue.

E.g. wikilambdasearch_continue=1


Possible Errors

None. When nothing is found it will return an empty list.

Examples

api.php?action=query&format=json&list=wikilambdasearch_labels&wikilambdasearch_search=ThisLabelDoesNotExist&wikilambdasearch_language=en
No labels in English match or contain the substring ThisLabelDoesNotExist, so an empty batch is returned.


api.php?action=query&format=json&list=wikilambdasearch_labels&wikilambdasearch_search=TEX&wikilambdasearch_language=en
Return every label matching or containing the substring TEX in English. This might ensure that at least two builtin ZObjects will be returned: Z12 "Multilingual text" and Z11 "Monolingual text".


api.php?action=query&format=json&list=wikilambdasearch_labels&wikilambdasearch_search=TEX&wikilambdasearch_language=en&wikilambdasearch_exact=1
Return every label matching or containing the exact substring TEX in English. This will not return the two ZObjects returned in the previous example, as this search is case-sensitive.


api.php?action=query&format=json&list=wikilambdasearch_labels&wikilambdasearch_language=en&wikilambdasearch_return_type=Z40
Return the English label of every entry that has a ZBoolean (Z40) return type, including those that have a generic ZObject (Z1) return type.


api.php?action=query&format=json&list=wikilambdasearch_labels&wikilambdasearch_language=en&wikilambdasearch_return_type=Z40&wikilambdasearch_strict_return_type=true
Return the English label of every entry that has strictly a ZBoolean (Z40) return type.


wikilambdafn_search

This API query list searches for the IDs of all ZObjects associated with a provided Z8/Function ZID and that belong to a given type (either Z14/Implementations or Z20/Testers).

Documentation

Method: GET

Action: query

List: wikilambdafn_search

Request: api.php?action=query&format=json&list=wikilambdafn_search&wikilambdafn_zfunction_id=Z801&wikilambdafn_type=Z20

Response:

{
    "batchcomplete": "",
    "query": {
        "wikilambdafn_search": [
            "Z8010",
            "Z8011",
            "Z8012",
            "Z8013"
        ]
    }
}


Parameters

name description
wikilambdafn_zfunction_id

required | string

ZID belonging to the function of which we want to retrieve the associated ZObjects.

E.g. wikilambdafn_zfunction_id=Z801

wikilambdafn_type

required | string

Type of ZObjects related to the given function that we would like to retrieve. The value of this field is not restricted, although the typical values related to functions would be Z14/Implementation or Z20/Tester.

E.g. wikilambdafn_type=Z20

wikilambdafn_limit

optional | integer

The maximum number of results to return. The value must be between 1 and 5000. Enter max to use the maximum limit.

E.g. wikilambdfn_limit=10

wikilambdafn_continue

optional | integer

When more results are available, use this to continue.

E.g. wikilambdafn_continue=1


Possible Errors

None. When nothing is found it will return an empty list.


Examples

api.php?action=query&format=json&list=wikilambdafn_search&wikilambdafn_zfunction_id=Z801&wikilambdafn_type=Z20
Returns the list of Z20/Testers associated to the function with ZID Z801


api.php?action=query&format=json&list=wikilambdafn_search&wikilambdafn_zfunction_id=Z801&wikilambdafn_type=Z14
Returns the list of Z14/Implementations associated to the function with ZID Z801

wikilambda_supported_programming_languages

Docs for internal team purposes only

This is an internal API to retrieve the programming languages supported by the back-end evaluator service at the time of running, and so determine which languages to recommend to users on the front end. It takes no parameters.

Documentation

Method: GET

Action: wikilambda_supported_programming_languages

Request: api.php?action=wikilambda_supported_programming_languages

Response:
{
    "query": {
        "wikilambda_supported_programming_languages": {
            "success": true,
            "data": "[\"javascript-es2020\",\"javascript-es2019\",\"javascript-es2018\",\"javascript-es2017\",\"javascript-es2016\",\"javascript-es2015\",\"javascript\",\"python-3-9\",\"python-3-8\",\"python-3-7\",\"python-3\",\"python\"]"
        }
    }
}

Response content:

Key Value Description
success "true" | "false" Whether the server responded.
data string An escaped JSON array of the supported programming languages (by internal WikiLambda name).

Possible Errors

None, unless the orchestrator back-end service doesn't respond.