Check Predicate from Attribute List

/api/repositories/{repository}/checkpredicatefromattributelist
Parameter Type Purpose
repository string The name of the repository to access

Post

POST /api/repositories/(string: repository)/checkpredicatefromattributelist

Validate a predicate against a list of attributes

POST /api/repositories/jupiter/checkpredicatefromattributelist HTTP/1.1
Content-Type: application/json

{
    "attributeList": [
        {
            "columnisedName": "Account_id",
            "humanisedName": "Account ID"
        },
        {
            "columnisedName": "Customer_id",
            "humanisedName": "Customer ID"
        }
    ],
    "expression": "DIVIDEINT('Account ID', 4) > 0"
}

The message body is a JSON string containing two key-value pairs: attributeList is an array of the columns; expression is the humanised predicate to check.

The attributeList does not have to list every available attribute for a particular entity, but it must have an entry for each attribute that is referenced in the expression.

Response Code Reason
200 Success
500 Server error

A successful response contains the predicate transformed into XML. If the predicate is transformed into XML, it means it returns a boolean value.

The request above would result in the following response:

HTTP/1.1 200 OK
Content-type: text/xml

<?xml version="1.0" ?>
<expr>
    <text>DIVIDEINT('Account ID',4) &gt; 0</text>
    <gt>
        <call name="::com::avellino::metabase::builtins::divideint" type="number">
            <var>Account_id</var>
            <int>4</int>
        </call>
        <int>0</int>
    </gt>
</expr>