The current design provides for pre-declared vocabularies. This is used mainly to write the inference rules which rely on the ability to obtain the IV for a given URI from the Vocabulary class.
The Vocabulary is declared to the AbstractTripleStore when it is created and can not change thereafter (this constraint arises we guarantee a single representation for a given RDF Value).
IVs are now much more flexible than the original long termId representation. That flexibility can be exploited to encode the representation of pre-declared URIs (but not literals) within 1-2 bytes as follows. (This can not be done for literals because there is already an interpretation for the DTE of a Literal as the natural datatype of the Literal).
A Vocabulary having no more than 256 distinct URIs would be represented fully inline within 2 bytes. The first byte would be coded as:
The second byte would be the index of the URI in the Vocabulary class. A new method Vocabulary#get(int):URI would be used to retrieve the URI for that byte code.
Exactly the same mechanism could be used for a Vocabulary having up to 64k distinct URIs. The DTE would be set to XSDShort. The short value would be passed to Vocabulary#get(int) to decode the URI from its inline IV.
From a practical standpoint, it would be a good practice to provide the namespace of an ontology as well as the distinct URIs within that ontology when creating a Vocabulary class. This is because the Vocabulary class can not be "upgraded" later for a given AbstractTripleStore instance (since the IV to Value mapping must be one to one and stable). Therefore, if there are extensions to the ontology in the future the new URIs can be represented using the inline (2-3 byte) representation of the namespace and the inline representation of the localName for the new ontology URIs.