ParentChildrenTracking

A version of the parent-children tracking example that takes all its input data from .csv files, simulating live RFID data, and publishes the alerts into output stream OutStreamAlerts.

The raw RFID data arrive in input stream InStreamRfid. This stream contains only a timestamp, ReaderID, and PersonID. A second input stream, InStreamReaders, carries information about the RFID reader coordinates, and a third stream, InStreamPersons, contains family and person IDs of the people wearing the RFID sensors, as well as a BOOLEAN column IsChild identifying if the family member is a child. Note that the information in stream InStreamPersons is rather static, and may be contained in a database in a real-world application. However, for this example, person information is represented as a data stream.

The local stream StreamRfidFull joins the information coming in on the three input streams. This stream is then split into two streams: StreamChildren and StreamParents, according to the values in the BOOLEAN column IsChild.

Finally, a join is executed between StreamChildren and StreamParents. The query checks whether a child and a parent from the same family (as defined by FamilyID) are more than a certain distance away from each other. If they are, an alert is published into stream OutStreamAlerts.


Created March 8, 2010. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com