DiSSCo / disscover

Search, discover and act upon data within the DiSSCo digital infrastructure.
https://dev.dissco.tech
Apache License 2.0
1 stars 0 forks source link

Annotation class selector #72

Closed TomDijkema closed 9 months ago

TomDijkema commented 9 months ago

A Pull Request that completely changes up the Annotation game within DiSSCover. The changes makes the annotation process much more rich and completely dependent on the data model that is fed to the system; any changes in the data model like additions of properties or classes will be taken over without any problem. The biggest change surrounds the addition of the class selector for annotations.

Adding the class selector meant a lot of things had to shift around to make the nesting, required for accessing the properties of a class, sub class or array of sub classes possible. A crucial distinction now made in the Annotate Target state variable is the targetField and targetClass.

A field always points to a single property of an object (class), and is easy annotatable, only needing a motivation, annotation value and possible additional fields based upon the chosen motivation.

A class points to an object, containing multiple properties, sub classes or even arrays of sub classes. Its far more complicated than the field, but the two target types all share the same parent (state) variables and template files, this enlarges the files themselves, but keeps all the relevant code together. Since there can be multiple of the same classes within a Digital Specimen or Digital Media, an user will always annotate a certain instance of a class, say the third occurrence of a specimen, to catch the correct occurrence, the whole path to this sub class is remembered as the 'target'; JSON path is used for the syntax. This path also includes indexes for arrays to be able to indicate the right number of an array instance.

Annotating a field or class will now first search for existing instances within the Digital Specimen or Digital Media and return a list of these. The user can decide to add a completely new instance of this field or class, or annotate on of the existing ones. Annotating a class with the adding or editing motivations will generate a complete list of all the properties within the class which can be given values; opening the gateway for users to add completely new occurrences for example to the Digital Specimen.

Even though the annotation process should be relatively flexible from now on, it still requires review on how to act in certain scenarios. Updates will keep coming to this topic.

sonarcloud[bot] commented 9 months ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

6.9% 6.9% Coverage
0.0% 0.0% Duplication