unomi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe K <risto.kowaczew...@gmail.com>
Subject Unomi Query Language help?
Date Fri, 12 Mar 2021 14:30:59 GMT
Hello everyone.

I am trying to use unomi as part of my project and during my work with
Unomi I found that it has a shallow learning curve (at least for me) due to
quite complex API.

Therefore I committed some time to write open-sourced Unomi Query
Language(UQL) that would ease the management of Unomi (
https://github.com/atompie/unomi-query-language). The language itself is
very similar to SQL. An example CREATE RULE statement looks like this:

CREATE RULE

   "if identify event then copy event properties to profile"

   DESCRIBE "Copies user data from events target properties to profile"

   IN SCOPE "my-site"

   WHEN event:type="identify" AND event:scope = "my-site"

   THEN CopyEventsToProfileProperties()

It connects to Unomi API (cxs/rules/) and performs:

{'actions': [{'parameterValues': {},

               'type': 'allEventToProfilePropertiesAction'}],

  'condition': {'parameterValues': {'operator': 'and',

                                    'subConditions': [{'parameterValues':
{'comparisonOperator': 'equals',


    'propertyName':
'eventType',


    'propertyValue':
'identify'},

                                                       'type':
'eventPropertyCondition'},

                                                      {'parameterValues':
{'comparisonOperator': 'equals',


    'propertyName':
'scope',


    'propertyValue':
'my-site'},

                                                       'type':
'eventPropertyCondition'}]},

                'type': 'booleanCondition'},

  'itemId': 'if-identify-event-then-copy-event-properties-to-profile',

  'itemType': 'rule',

  'metadata': {'description': 'Copies user data from events target
properties '

                              'to profile',

               'enabled': True,

               'hidden': False,

               'id':
'if-identify-event-then-copy-event-properties-to-profile',

               'missingPlugins': False,

               'name': 'if identify event then copy event properties to '

                       'profile',

               'readOnly': False,

               'scope': 'my-site',

               'tags': []},

  'priority': -1,

  'raiseEventOnlyOnceForProfile': False,

  'raiseEventOnlyOnceForSession': False}

UQL just maps simplified queries to API call.

I would like to further develop this language but I came to some issues
with the documentation that stopped me from doing this.

I could not find a full list of available booleanCondition operators:

This is what I gathered reading different unomi articles:

* exists

* between

* equals

* notEquals

* greaterThanOrEqualTo

* lessThanOrEqualTo

* greaterThan

* lessThan

* missing

* contains

I could not find any this on IS NULL, NOT CONTAINS, IS TRUE/FALSE

Furthermore I am having difficulties to find base property actions.I found
some examples on how to set profile properties but that's it. I could not
find examples of actions that would perform some core operations, such as:


   -

   increment a profile property.
   -

   append value to property (given the property is of type list)
   -

   remove value to property (given the property is of type list)
   -

   set property to true/false
   -

   remove property


Could you point me to the place where I could find such information or give
me an example of API calls that would do the above actions?

Furthermore are there any actions that perform requests to webhooks or pass
profiles to kafka?

Thanks in advance for your reply


---

Risto

Mime
View raw message