PR #68 adds visitor methods to the openminds.abstract.Schema class for saving, serializing and resolving instances (save, serialize, resolve), in addition to "interfaces" that can visit these methods:
openminds.interface.MetadataStore (for saving)
openminds.internal.serializer.BaseSerializer (for serialization)
openminds.internal.resolver.AbstractLinkResolver (for resolving)
The main idea is to make it easy for external libraries to implement their own specialization for visitor classes which can then visit and do operations on openMINDS instances. One specific example is added here for Serialization of instances before upload to the EBRAINS Knowledge Graph.
Now, the implementation is very crude, and will require refinement and improvements later. This issue will serve as a brainstorm/discussion for how to make such improvements.
For example
- There is a lot of overlapping logic for all of these actions, and this can perhaps be abstracted into a
BaseVisitor/AbstractVisitor class.
- Typically, linked and embedded nodes should be handled differently. Maybe visitor classes can have abstract
doForLinkedNode, doForEmbeddedNode abstract methods.
- Deserialization is currently all over the place, and should also be collected into a Deserialization interface.
PR #68 adds visitor methods to the
openminds.abstract.Schemaclass for saving, serializing and resolving instances (save,serialize,resolve), in addition to "interfaces" that can visit these methods:openminds.interface.MetadataStore(for saving)openminds.internal.serializer.BaseSerializer(for serialization)openminds.internal.resolver.AbstractLinkResolver(for resolving)The main idea is to make it easy for external libraries to implement their own specialization for visitor classes which can then visit and do operations on openMINDS instances. One specific example is added here for Serialization of instances before upload to the EBRAINS Knowledge Graph.
Now, the implementation is very crude, and will require refinement and improvements later. This issue will serve as a brainstorm/discussion for how to make such improvements.
For example
BaseVisitor/AbstractVisitorclass.doForLinkedNode,doForEmbeddedNodeabstract methods.