Somewhere you'd need a "parent" object that tells you the hierarchy of objects in your package.
Like Rocael said, if the context_id is set to the package_id, that might help out.