You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@predictionio.apache.org by Vaghawan Ojha <va...@gmail.com> on 2017/05/04 05:25:18 UTC

How $set events works together?

Hi,

It's quite a novice question, but I was curious how $set events are handled
by the engine.

For say I've a user1 buying item2 from the category fruits.

so the event without $set would look like this:
{"eventTime":"2016-04-01T00:03:16+05:41","entityType":"user","targetEntityType":"item","event":"purchase","entityId":"user5","targetEntityId":"apple","properties":{"category":"fruits"}}

But if I use $set, that would be something like this:
{ "event" : "$set", "entityType" : "item", "entityId" : "apple",
"properties" : { "category": ["fruits"] }, "eventTime" : "
2016-04-01T00:03:16+05:41" }
So here I can't place the user, I think I'm wrong about how to implement
$set events, in this case how the engine knows that the item was bought by
 the user5 at that particular time?

Am I supposed to send two events, one with user5 bought apple, and another
$set event with category fruits?

Someday who have already used this feature could let me know?

Thanks

Re: How $set events works together?

Posted by Pat Ferrel <pa...@occamsmachete.com>.
I’m sure you did, I sometimes magnify so other readers will get it too :-)


On May 4, 2017, at 7:52 PM, Vaghawan Ojha <va...@gmail.com> wrote:

Hi Pat,

Ok, thanks for the addition, I got the point. 

Thanks

On Thu, May 4, 2017 at 9:41 PM, Pat Ferrel <pat@occamsmachete.com <ma...@occamsmachete.com>> wrote:
Correct. The purchase is associated with the user so any properties would be attached to user objects and for the UR there are no user objects in the EventStore. Users are represented by the collection of their events, not properties.


On May 3, 2017, at 10:47 PM, Vaghawan Ojha <vaghawan781@gmail.com <ma...@gmail.com>> wrote:

Hi Marius, 

Thank you very much for the quick reply. That helps, thank you. 



On Thu, May 4, 2017 at 11:23 AM, Marius Rabenarivo <mariusrabenarivo@gmail.com <ma...@gmail.com>> wrote:
Hi Vaghawan,

yes, you have to send two events : one for the purchase and one for the $set property.

2017-05-04 9:25 GMT+04:00 Vaghawan Ojha <vaghawan781@gmail.com <ma...@gmail.com>>:
Hi, 

It's quite a novice question, but I was curious how $set events are handled by the engine. 

For say I've a user1 buying item2 from the category fruits. 

so the event without $set would look like this: 
{"eventTime":"2016-04-01T00:03:16+05:41","entityType":"user","targetEntityType":"item","event":"purchase","entityId":"user5","targetEntityId":"apple","properties":{"category":"fruits"}}

But if I use $set, that would be something like this: 
{
   "event" : "$set",
   "entityType" : "item",
   "entityId" : "apple",
   "properties" : {
      "category": ["fruits"]
   },
   "eventTime" : "2016-04-01T00:03:16+05:41"
}
So here I can't place the user, I think I'm wrong about how to implement $set events, in this case how the engine knows that the item was bought by  the user5 at that particular time? 

Am I supposed to send two events, one with user5 bought apple, and another $set event with category fruits? 

Someday who have already used this feature could let me know? 

Thanks



-- 
You received this message because you are subscribed to the Google Groups "actionml-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to actionml-user+unsubscribe@googlegroups.com <ma...@googlegroups.com>.
To post to this group, send email to actionml-user@googlegroups.com <ma...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/actionml-user/CA%2B69RXaQyLtM2y18wWsKtds099YvAMVyjPB3OqjRnC5M_YahZg%40mail.gmail.com <https://groups.google.com/d/msgid/actionml-user/CA%2B69RXaQyLtM2y18wWsKtds099YvAMVyjPB3OqjRnC5M_YahZg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.



-- 
You received this message because you are subscribed to the Google Groups "actionml-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to actionml-user+unsubscribe@googlegroups.com <ma...@googlegroups.com>.
To post to this group, send email to actionml-user@googlegroups.com <ma...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/actionml-user/CA%2B69RXa8t8F%2B8A%2BRZFLFz-a2AO4wU3UKUcPmM9PhxjLmRv5GOw%40mail.gmail.com <https://groups.google.com/d/msgid/actionml-user/CA%2B69RXa8t8F%2B8A%2BRZFLFz-a2AO4wU3UKUcPmM9PhxjLmRv5GOw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.


Re: How $set events works together?

Posted by Vaghawan Ojha <va...@gmail.com>.
Hi Pat,

Ok, thanks for the addition, I got the point.

Thanks

On Thu, May 4, 2017 at 9:41 PM, Pat Ferrel <pa...@occamsmachete.com> wrote:

> Correct. The purchase is associated with the user so any properties would
> be attached to user objects and for the UR there are no user objects in the
> EventStore. Users are represented by the collection of their events, not
> properties.
>
>
> On May 3, 2017, at 10:47 PM, Vaghawan Ojha <va...@gmail.com> wrote:
>
> Hi Marius,
>
> Thank you very much for the quick reply. That helps, thank you.
>
>
>
> On Thu, May 4, 2017 at 11:23 AM, Marius Rabenarivo <mariusrabenarivo@
> gmail.com> wrote:
>
>> Hi Vaghawan,
>>
>> yes, you have to send two events : one for the purchase and one for the
>> $set property.
>>
>> 2017-05-04 9:25 GMT+04:00 Vaghawan Ojha <va...@gmail.com>:
>>
>>> Hi,
>>>
>>> It's quite a novice question, but I was curious how $set events are
>>> handled by the engine.
>>>
>>> For say I've a user1 buying item2 from the category fruits.
>>>
>>> so the event without $set would look like this:
>>> {"eventTime":"2016-04-01T00:03:16+05:41","entityType":"user"
>>> ,"targetEntityType":"item","event":"purchase","entityId":"us
>>> er5","targetEntityId":"apple","properties":{"category":"fruits"}}
>>>
>>> But if I use $set, that would be something like this:
>>> { "event" : "$set", "entityType" : "item", "entityId" : "apple",
>>> "properties" : { "category": ["fruits"] }, "eventTime" : "
>>> 2016-04-01T00:03:16+05:41" }
>>> So here I can't place the user, I think I'm wrong about how to implement
>>> $set events, in this case how the engine knows that the item was bought by
>>>  the user5 at that particular time?
>>>
>>> Am I supposed to send two events, one with user5 bought apple, and
>>> another $set event with category fruits?
>>>
>>> Someday who have already used this feature could let me know?
>>>
>>> Thanks
>>>
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "actionml-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to actionml-user+unsubscribe@googlegroups.com.
> To post to this group, send email to actionml-user@googlegroups.com.
> To view this discussion on the web visit https://groups.google.
> com/d/msgid/actionml-user/CA%2B69RXaQyLtM2y18wWsKtds099YvAM
> VyjPB3OqjRnC5M_YahZg%40mail.gmail.com
> <https://groups.google.com/d/msgid/actionml-user/CA%2B69RXaQyLtM2y18wWsKtds099YvAMVyjPB3OqjRnC5M_YahZg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>

Re: How $set events works together?

Posted by Pat Ferrel <pa...@occamsmachete.com>.
Correct. The purchase is associated with the user so any properties would be attached to user objects and for the UR there are no user objects in the EventStore. Users are represented by the collection of their events, not properties.


On May 3, 2017, at 10:47 PM, Vaghawan Ojha <va...@gmail.com> wrote:

Hi Marius, 

Thank you very much for the quick reply. That helps, thank you. 



On Thu, May 4, 2017 at 11:23 AM, Marius Rabenarivo <mariusrabenarivo@gmail.com <ma...@gmail.com>> wrote:
Hi Vaghawan,

yes, you have to send two events : one for the purchase and one for the $set property.

2017-05-04 9:25 GMT+04:00 Vaghawan Ojha <vaghawan781@gmail.com <ma...@gmail.com>>:
Hi, 

It's quite a novice question, but I was curious how $set events are handled by the engine. 

For say I've a user1 buying item2 from the category fruits. 

so the event without $set would look like this: 
{"eventTime":"2016-04-01T00:03:16+05:41","entityType":"user","targetEntityType":"item","event":"purchase","entityId":"user5","targetEntityId":"apple","properties":{"category":"fruits"}}

But if I use $set, that would be something like this: 
{
   "event" : "$set",
   "entityType" : "item",
   "entityId" : "apple",
   "properties" : {
      "category": ["fruits"]
   },
   "eventTime" : "2016-04-01T00:03:16+05:41"
}
So here I can't place the user, I think I'm wrong about how to implement $set events, in this case how the engine knows that the item was bought by  the user5 at that particular time? 

Am I supposed to send two events, one with user5 bought apple, and another $set event with category fruits? 

Someday who have already used this feature could let me know? 

Thanks



-- 
You received this message because you are subscribed to the Google Groups "actionml-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to actionml-user+unsubscribe@googlegroups.com <ma...@googlegroups.com>.
To post to this group, send email to actionml-user@googlegroups.com <ma...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/actionml-user/CA%2B69RXaQyLtM2y18wWsKtds099YvAMVyjPB3OqjRnC5M_YahZg%40mail.gmail.com <https://groups.google.com/d/msgid/actionml-user/CA%2B69RXaQyLtM2y18wWsKtds099YvAMVyjPB3OqjRnC5M_YahZg%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.


Re: How $set events works together?

Posted by Vaghawan Ojha <va...@gmail.com>.
Hi Marius,

Thank you very much for the quick reply. That helps, thank you.



On Thu, May 4, 2017 at 11:23 AM, Marius Rabenarivo <
mariusrabenarivo@gmail.com> wrote:

> Hi Vaghawan,
>
> yes, you have to send two events : one for the purchase and one for the
> $set property.
>
> 2017-05-04 9:25 GMT+04:00 Vaghawan Ojha <va...@gmail.com>:
>
>> Hi,
>>
>> It's quite a novice question, but I was curious how $set events are
>> handled by the engine.
>>
>> For say I've a user1 buying item2 from the category fruits.
>>
>> so the event without $set would look like this:
>> {"eventTime":"2016-04-01T00:03:16+05:41","entityType":"user"
>> ,"targetEntityType":"item","event":"purchase","entityId":"
>> user5","targetEntityId":"apple","properties":{"category":"fruits"}}
>>
>> But if I use $set, that would be something like this:
>> { "event" : "$set", "entityType" : "item", "entityId" : "apple",
>> "properties" : { "category": ["fruits"] }, "eventTime" : "
>> 2016-04-01T00:03:16+05:41" }
>> So here I can't place the user, I think I'm wrong about how to implement
>> $set events, in this case how the engine knows that the item was bought by
>>  the user5 at that particular time?
>>
>> Am I supposed to send two events, one with user5 bought apple, and
>> another $set event with category fruits?
>>
>> Someday who have already used this feature could let me know?
>>
>> Thanks
>>
>
>

Re: How $set events works together?

Posted by Marius Rabenarivo <ma...@gmail.com>.
Hi Vaghawan,

yes, you have to send two events : one for the purchase and one for the
$set property.

2017-05-04 9:25 GMT+04:00 Vaghawan Ojha <va...@gmail.com>:

> Hi,
>
> It's quite a novice question, but I was curious how $set events are
> handled by the engine.
>
> For say I've a user1 buying item2 from the category fruits.
>
> so the event without $set would look like this:
> {"eventTime":"2016-04-01T00:03:16+05:41","entityType":"
> user","targetEntityType":"item","event":"purchase","entityId":"user5","
> targetEntityId":"apple","properties":{"category":"fruits"}}
>
> But if I use $set, that would be something like this:
> { "event" : "$set", "entityType" : "item", "entityId" : "apple",
> "properties" : { "category": ["fruits"] }, "eventTime" : "
> 2016-04-01T00:03:16+05:41" }
> So here I can't place the user, I think I'm wrong about how to implement
> $set events, in this case how the engine knows that the item was bought by
>  the user5 at that particular time?
>
> Am I supposed to send two events, one with user5 bought apple, and another
> $set event with category fruits?
>
> Someday who have already used this feature could let me know?
>
> Thanks
>