Making connections 'transitive' between objects

Is it possible to make a connection ‘transitive’, so that if Object A connects to Object B, and Object B connects to Object C, then any B-C connections are automatically inherited by records in Object A, as A-C connections.

For example, if I have an object for counties (A), an object for towns (B), and an object for streets (C), each county connects to many towns and each town connects to many streets. Can I write a formula or simple script that has each county connect to the streets that it contains?