feature request #6581
Make all microreferenced references OriginalSources
Currently we have OriginalSource usually used for collections of sources while single references such as nomenclaturalReference or references for relations (or even secundum reference) use 2 fields for defining the reference, the references and the microreference fields. This is generally problematic e.g. when formatting the nomenclatural citation. Also it reduces the possibility to add further information that is available in OriginalSource such as name used in source (could be used for original spelling), source information (currently "name in source"), or further features such as URL(s) that do link to an online version of the source together with a comment (see #6588).
We may want to handle all these references as OriginalSources. Also this eases the usage of the Reference class as it is not linked from so many places anymore (but therefore OriginalSource is linked more). Also we can easier implement common formatters for sources.
Also this could improve the handling for protologues and similar "proves" for nomenclatural acts or references in general.
Possible candidates are
- nomenclatural reference
- RelationshipBase reference (TaxonRelationship, NameRelationship, HybridRelationship)
- TypeDesignation (rename to designationSource => #9332)
- Classification => needs further discussion as classification is SourcedEntityBase #9211
- Secundum reference => #9327
Note: We already have the class ReferencedEntityBase which inherits from AnnotatableEntity and is the base class for RelationshipBase and TypeDesignation. This can be kept and the 3 parameters citation, microCitation and originalNameString can be replaced by according OriginalSource fields.
do we want to keep the direct methods, e.g. getNomenclaturalReference() in the main classes=> for now we keep it, may be removed later how to delete a source if it became completely empty how to decide if a source is completely empty (is an attached annotation or import source enough to make it not empty, or is it required that a "citation" exist. What about external links as only information=> isEmpty has been implemented and works on completely empty sources where to delete it (in model or only during persistence)=> #9069
should we support one common interface which makes it easier to program against but methods are difficult to name, getSource() or getOriginalSource() might not be an expected label for getNomenclaturalSource() in TaxonName or TypeDesignationBase. Maybe we use 2 interfaces, one for nomenclatural sources.=> we do have a common interface where appropriate now What OriginalSourceType to use: NomenclaturalReference could be a very strict source type for names and type designations, OriginalSource might be a more general one, maybe NomenclaturalReference might become a subtype; how is the relationship to PrimaryTaxonomicSource=> partly handled in #9330 IMPORTANT: should we store this source together with other sources if available. This is the case for TaxonName.nomenclaturalReference and TaxonBase.secundum where the main classes are identifiable and already have sources. There might be performance issues and lazy loading issues if the specific source is stored together with the set of OrginalSources.=> we decided not to do so Should we have a strict type checking for the OriginalSourceType?=> we do not handle source type for these sources in TaxEditor yet, maybe this becomes more interesting if we have something like SecondaryTaxonomicSource Should we allow to always return a placeholder empty source in case no source exists, this reduces NPEs but the semantic must be strictly followed that this placeholder may not be attached to the parent and therefore changes will have no effect; we may have a singleton for this to improve performance and to throw exceptions when any changes are done on this placeholder=> we do not use such an placeholder but we offer a get method with parameter createIfNotExists Rename DescriptionElementSource to NamedSource as the only reason for distinguishing it from IdentifiableSource is now the additional attribute; the back link to the sourced entity does not exist anymore=> #9331
ref #6581 first incomplete version for making nomenclatural reference an orginal source
ref #6581 nomRef to OriginalSource allow setNomRef by Interface for compiling
ref #6581 add TaxonName.nomenclaturalSource_id and adapt constructor visibility for DescriptionElementSource
ref #6581 preliminary revert some changes for making nomenclaturalReference an OriginalSource
ref #6581 add "source" to Classification, TypeDesignation, RelationshipBase and NomenclaturalStatus
ref #6581: adapt getter/setter of citation/microcitation in typedesignationbase
ref #6581 adapt registration tests to new source handling in typeDesignation and for nomenclaturalReference
ref #6581 remove null-values for nomenclaturalReference and nomenclaturalMicroReference from Test-Files
ref #6581 fix test data with nomenclaturalMicroReference not being null (cont)
ref #6581 remove null values for citationmicroreference and citation_id from test data
ref #6581 remove unnecessary links to nomenclaturalReference in persistence test data
ref #6581 remove CITATIONMICROREFERENCE from TaxonRelationship in test data
ref #6581 update HQL and property paths and similar to nomenclaturalSource (some issues unclear)
ref #6581 remove or adapt nomenclaturalReference in service test data (and some removing of not needed data)
ref #6581 adapt TaxonGraphBeforeTransactionCompleteProcess to nomenclaturalSource
ref #6581 adapt NoDuplicateNamesValidator to nomenclaturalSource (doubtful if correct, but all this validation rule must be refactored)
ref #6581 fully remove nomenclaturalReference and nomenclaturalMicroReference fields from TaxonName
ref #6581 fully remove nomenclaturalReference and nomenclaturalMicroReference fields from TaxonName (cont.)
ref #6581 remove unused reference and microreference fields from SingleSourced classes (incl. TypeDesignationBase)
ref #6581 fix testdata for DerivedUnitConverterIntegrationTest.cascadeDelete
ref #6581 try to fix key issue in SpecimenTypeDesignationWorkingSetServiceImplTest
ref #6581 move references to sources for NomenclaturalStatus, NameRelationship, TaxonRelationship, HybridRelationship, TypeDesignation and TaxonName.nomenclaturalReference
ref #6581 adapt BerlinModelTaxonNameExport to new nomenclatural source handling
#7 Updated by Andreas Müller about 4 years ago
AK: > Viel besser sollten wir das im ValidationFramework als Rule definieren.
das Ticket https://dev.e-taxonomy.eu/redmine/issues/6581 freut mich wirklich sehr, denn die Nomenklatorischen Referenzen sind auch in Portal sehr lästig, da man mit citation und citationDetail immer noch einen extra Request an den Server schicken muss um den kompletten Citation String zu bekommen.