look in db/cache.py at functions with *annotations* in their name. Annotations in calibre are simple JSON objects that store highlighted text and start and end positions as EPUB CFI paths, alongwith colors/styles. Just creating a few different annotations with the calibre viewer and examining the resulting obets will do the trick.
You can get the db/cache.py object like this:
from calibre.library import db
cache = db('/path/to/library/folder').new_api
this is from a standalone script run via calibre-debug if you are in a gui plugin then you get it as:
from calibre.gui2.ui import get_gui()
cache = get_gui().current_db.new_api
|