Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Introduction:

Hierarchy APIs is for creating, updating or reading the entire hierarchy of collection mimetypes. As part of refactoring hierarchy APIs, below are implementation changes.

Design:

UpdateHierarchy API:

Ontology Engine Changes

Introduce `mode=edit` in DataNode.update(), to upsert hierarchy to `rootId.img`

API changes

read rootnode -> If live fetch image node
construct new nodes and validate the same against schema
construct hierarchy
call dataNode.update() with `mode=edit`


GetHierarchy API:

Code Block
if(mode == edit) {
	DataNode.read() using rootNodeId with `mode=edit`
	DataNode.read() with `mode=edit` and fields=hierarchy
	merge the above responses and return
}
else {
	get Hierarchy from redis
	if(Hierarchy not present in redis){
		DataNode.read() using rootNodeId and fields=hierarchy
		if(Hierarchy is not present in cassandra)
			throw ResourceNot Found
	}
}