Imported schemas can import schemas which import schemas which...
Declarations/Definitions belong to target namespace of where the occur (i.e. the value of the targetNamespace attribute nearest to them).
You don't have specify where imports of imported schemas are located.
At minimum you need to import the namespace of all definitions/declarations used.