The database hierarchy is used to differentiate catalog objects with respect to the purpose of the catalog object and the owner/manager of the catalog object. For example, the catalog objects owned and managed by a given owner is the tree node structure under the node with the owners ID. Nodes representing a type of catalog object are represented by nodes of the type name all branches under that type node only refer to that type. Catalog objects of the same type are collected together facilitates querying. Queries refer to a set of catalog objects of the same type found directly under a given node. The query refers specific keywords values of the type. For example to isolate a specific symmetry type of
In the Firestore database, the data is stored in documents and these documents are stored in collections. The documents are a set of keyword-values pairs. The values can be simple data objects like strings or numerics, but also be subcollections. In these subcollections a nested set of documents are stored. As the hierarchy is traversed, at the top node is a collection and under the collection is a set of documents. If the document contains a subcollection, referenced by a key, then this subcollection contains another set of documents. Thus in terms of referencing keywords, there is an alternation between a collection and a document. A collection has a document which has a subcollection which can have a subdocument which itself can have a sub-subcollection, and so on..
The document in Firestore can be a mixture of subcollections, each referenced by a keyword, and keyword value pairs. in the JThermodynamicsCloud implementation the noSQL documents are restricted to two forms:
Only a set of subcollections: This means the document contains a set of keys and each of these keys points to a subcollection. There are no keys which point to data.
JSON object: This means that the document is pure data and none of the keywords points to a collection.
When traversing down the database hierarchy, this restriction gives rise to an alternating set of collection and document labels to finally a JSON object at the end of the hierarchy. The JSON object at the end of the hierarchy is, in fact, a catalog object. This means that the position of a catalog object in JThermodynamicsCloud is a set of labels, alternating to pointing to collections and documents. This is exactly the structure of JThermodynamicsCloud FirestoreID. Though the position is essentially a ordered set of keyword labels, due to how objects are accessed in Firestore, i.e. alternating collections and documents, a distinction of whether the label references a document or a collection kept in the reference.