Build an Engine
An SKL Engine is a code package that allows developers to call Verbs and Mappings defined in SKL Schemas from code.
This guide introduces some of the key features an SKL Engine should implement to adhere to the SKL specification. A more detailed SKL specicifcation will be released soon.
Implementation
The essential requirements of an Engine are:
Allow developers to set a source of schemas.
Allow developers to call Verbs.
In addition to these two requirements, an Engine may also expose the ability to create and update SKL Schemas in the schema source.
Schema source
A developer using an Engine should be able to set the source of the schemas they want the Engine to use at any time via one or several options:
supplied via a variable
read from a file
queried from an SKDS (see Ecosystem for more info)
Supplied via a variable:
const schema = [ ... ];
const engine = new SKLEngine({
type: 'memory',
schemas: schema
});Queried from an SKDS:
Verbs
An Engine should support calling Verbs using functions with the same name as the Verb. For example:
The Engine may also allow Verbs to be called on entities. When used this way, the entity on which the Verb is called must be one of the Verb's expected parameters. For example the following statements should be equivalent to the one above:
In all three cases, the Engine would call the getFilesInFolder Verb with an Account and a Folder as parameters.
This diagram gives more detail about the procedure an Engine should take when a Verb is executed:

The procedure follows these steps:
Find the configuration for the Verb from the currently set schema source.
Ensure the validity of the parameters supplied according to the SHACL Shape identified by the Verb’s
parametersproperty.Find the configuration for the VerbToIntegrationMapping that relates the Verb to the Integration of the Account parameter from the currently set schema source.
Perform the parameter and operation RML Mapping(s) - defined in the Mapping's
parameterMappingsandoperationMappingsproperties respectively - to obtain the unique parameters and operation to perform the Verb using an Integration's API.Perform the Verb’s operation using the Integration's API.
Obtain the response from performing the Verb’s operation.
Perform the return value RML Mapping(s) - defined in the Mapping's
returnValueMappingsproperty - to obtain the return value of the Verb.Ensure the validity of the return value according to the SHACL Shape identified by the Verb’s
returnValueproperty.Return the output of the Verb.
If ever a Verb or a Mapping cannot be found by querying the currently set schema source, the Engine must throw an error.
Last updated