Hello,
There are no persistent id's attached to Open CASCADE entities in memory or in a brep file. There are temporary integers used instead of references in the file (or when you use the 'dump' command in Draw). Determinism is ensured by unambiguous traversal of the shape graph (from a shape itself recursively to all its children following the order in the child list).
Mapping of some arbitrary id's from external file to OCC shape would be job of your app. For instance, following XDE approach, using OCAF. Explode the shape into subshapes, attach each to the labels along with integer attribute. Alternative is to use some hash (data map) that would store mapping between shapes and integers.
Hope this helps.
Commenter-1
---
opencascade.blogspot.com - the Open CASCADE blog
www.cadexchanger.com - CAD Exchanger, your 3D data translator