Project

General

Profile

feature request #6794

Improve term structure

Added by Andreas Müller about 2 years ago. Updated 19 days ago.

Status:
In Progress
Priority:
Highest
Category:
cdm
Target version:
Start date:
07/09/2017
Due date:
% Done:

20%

Severity:
normal

Description

Terms, terms structures and term collections need to be improved. Currently the only structures we have for terms are vocabularies (ordered and unordered) and part-of and kind-of relations, where for each term only exactly one parent kind-of and one parent part-of is allowed. Further more we do have FeatureTree and -Node as structure but only for features.

Generally what we need are

  1. containers to group terms in collections, where each term might be part of many collections. how ever it is probably a good idea to let a term belong to exactly one vocabulary.
  2. structures to sort terms also in the above containers
  3. structures to build term trees according to relationship types like part-of and kind-of (do we also need mixed trees? does it make sense)
  4. concept relationships between terms similar to taxon relationships with a relationship type based on set semantic (taxon relationship types can be reused) or other semantic

To achieve this we could do the following

  • Open FeatureTree to all terms, rename it TermTree, add termtype to it to define what kind of term is handled (but discuss if a tree could also have different types included, e.g. leaves could be of different type than inner nodes (SDD)), so we could further define termtype, e.g. by being a set or defining different types for root, inner nodes and leaves, ...). These trees can also be used for sorted lists and maybe even for unordered sets of terms. FeatureNodes may be renamed to TermNode (1, 2, 3)
  • Common base class (or at least interface) TermCollection for vocabularies and TermTree to easy retrieve term collections available to choose from. (1)
  • New class TermRelationship that combines terms with a relationship and relationship type, similar to taxon relationships

A general problem is when should a term be referenced directly and when should we use a term node which is more or less a wrapper around a term which is a term within a given collection. We need this for 2 and 3 somehow (even if for 2 we only have a Set/List on TermCollection side on relational level we still need an M:N table as a term can be part of >1 such collections. If such a table is needed we can also make it a class and attache some more attributes if required.

Term relationships could work without such a TermNode but then we have different structures to define relationships between terms, one that uses term nodes as source and target of the relationships and one directly linking to terms, and if we keep the current part-of and kind-of structure a 3rd one that linking directly from one term to another (source information - "who says this is a child" is difficult to handle in this).

The simplest solution would be to only use TermNode for all relations. But this might be an overhead and also the handling in tree structures is still different to undefined relationships as the tree structure has a term as source but a node as target while general relationships have either both terms or nodes.

We could also consider nodes and relationships to be very similar, one handles a structure where each node can only be one time part of a relationship within a given graph (however in theory it is possible that a term is source for many relationships in this graph as terms may have multipe nodes), but these graphs are difficult to travers . Relationships require alternating traversion, from rel to term to rel to term ...
But as they differ only in the target type we may have them with a common base class (but then TermRelationship can not inherit from RelatioshipBase!) and store in the same table.
This makes it easy to query all terms belonging to a TermCollection as such a base class may have the attribute "termCollection" similar to current "featureTree" in FeatureNode or "classification" in TaxonNode. This is a unidirectional relationship as it may be a huge set. An exception might be terms belonging to a vocabulary as they directly point to there vocabulary (or can this be handled differently? We could also use something like TermNode but this is overhead and not necessary

Another open question is if we want to allow any kind of structure within vocabularies. Probably it is better to not allow semantic structure as this could lead to inconsistency. But purely to make terms easier to find it might be helpful to use hierarchies in large vocabularies.
For consistency it might be helpful to also use a term tree for this, algorithms may only be implemented once then. However, the model becomes more complex then with each term being represented by 2 objects instead of one. The first representing the term, the second representing its positions in the vocabulary.

If we don't have a hierarchy structure within vocabularies, vocabularies with existing structure such as TDWG areas may require an extra graph to represent the hierarchie, which is maybe not wanted. Hierarchy might become an optional attribute of a vocabulary, with still each term directly linking to the vocabulary but optionally being part of a tree which the vocabulary holds the root for.

Questions

What about inapplicableif and onlyapplicableif, can this be used for ohter term types too, or do we still need special FeatureNodes or simply don't use these fields for other term nodes.


Related issues

Related to Edit - feature request #8123: Make available Features a DB preference New 02/22/2019
Related to Edit - task #7515: TypeDesignationStatusComparator to sort by vocabulary first and then by term order Resolved 06/26/2018
Related to Edit - feature request #8146: Adapt taxeditor UI to structure and property term type Closed 02/27/2019
Related to Edit - task #8166: Adapt dataportal to term structure changes Closed 03/06/2019
Related to Edit - bug #8251: LazyInitializationException (LIE) in featureTree webservice Closed 04/30/2019
Related to Edit - feature request #8241: Rename FeatureTreeEditor to TermTreeEditor Closed 04/11/2019
Related to Edit - task #8405: Adapt cdm-vaadin to term structure changes Rejected 03/06/2019
Related to Edit - bug #8407: Fix "FeatureTest" New 07/25/2019
Related to Edit - task #8434: Change FeatureTree contollers to TermTree controllers Closed 08/01/2019
Related to Edit - feature request #8432: Improve "default" feature tree handling In Progress 07/31/2019
Related to Edit - feature request #8474: Make TermCollection.orderRelevant usable for TermTrees New 08/16/2019
Related to Edit - feature request #8476: Implement support for TermCollection.isFlat in TaxEditor New 08/16/2019
Related to Edit - feature request #8477: Implement support for TermCollection.isFlat in TaxEditor New 08/16/2019

Associated revisions

Revision 15e58dad (diff)
Added by Andreas Müller 6 months ago

ref #6794 remove setRoot from FeatureTree

Revision ffe5e099 (diff)
Added by Andreas Müller 6 months ago

ref #6794 add termType to FeatureTree and FeatureNode

Revision ba989ecb (diff)
Added by Patrick Plitzner 6 months ago

ref #6794 Fix termType comparison

Revision 2fe68f38 (diff)
Added by Patrick Plitzner 6 months ago

ref #6794 Adapt taxeditor to model changes (feature tree/node generics)

Revision c693e3b1 (diff)
Added by Patrick Plitzner 6 months ago

ref #6794 Add generics to FeatureNode and FeatureTree

Revision 86dbc0fc (diff)
Added by Patrick Plitzner 6 months ago

ref #6794 Add termType check to DefinedTermBase and TermVocabulary

Revision 64cf9d1d (diff)
Added by Andreas Müller 6 months ago

ref #6794 fix early setting of termType during term loading

Revision f4e9f32a (diff)
Added by Andreas Müller 6 months ago

ref #6794 fix termType settings in deleteTerms test and clean it up

Revision ee6886b5 (diff)
Added by Patrick Plitzner 6 months ago

ref #6794 deproxy term of feature node

Revision 30fc7ac4 (diff)
Added by Andreas Müller 6 months ago

ref #6794 adapt FeatureTreeController property path to new FeatureNode structure

Revision 9db81ba4 (diff)
Added by Andreas Müller 4 months ago

ref #6794 remove setRoot from FeatureTree

Revision 743a9157 (diff)
Added by Andreas Müller 4 months ago

ref #6794 add termType to FeatureTree and FeatureNode

Revision f2ae523b (diff)
Added by Patrick Plitzner 4 months ago

ref #6794 Fix termType comparison

Revision f98fee95 (diff)
Added by Patrick Plitzner 4 months ago

ref #6794 Add generics to FeatureNode and FeatureTree

Revision 70709f18 (diff)
Added by Patrick Plitzner 4 months ago

ref #6794 Add termType check to DefinedTermBase and TermVocabulary

Revision 78234aa8 (diff)
Added by Andreas Müller 4 months ago

ref #6794 fix early setting of termType during term loading

Revision 7f1eb40e (diff)
Added by Andreas Müller 4 months ago

ref #6794 fix termType settings in deleteTerms test and clean it up

Revision afc431d5 (diff)
Added by Patrick Plitzner 4 months ago

ref #6794 deproxy term of feature node

Revision 36d909f8 (diff)
Added by Andreas Müller 4 months ago

ref #6794 adapt FeatureTreeController property path to new FeatureNode structure

Revision 7c4fffcd (diff)
Added by Andreas Müller about 1 month ago

ref #6794 add TermRelationshipType

Revision cafaa5dd (diff)
Added by Andreas Müller about 1 month ago

ref #6794 add TermRelationshipType to test data

Revision 6645143a (diff)
Added by Andreas Müller about 1 month ago

ref #6794 adapt TermsDataSet-with_auditing_info in some packages after merge problem solved

Revision aa929473 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 add term relation type to TermType and fix TermRelationType class

Revision 1c313fd1 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 add TermRelation and TermRelationBase

Revision 951c829f (diff)
Added by Andreas Müller about 1 month ago

ref #6794 add TermRelation and rename FeatureNode -> TermTreeNode

Revision 3c06156c (diff)
Added by Andreas Müller about 1 month ago

ref #6794 rename TermVocabulary table to TermCollection and remaining rename FeatureNode -> TermTreeNode

Revision 4b1a00be (diff)
Added by Andreas Müller about 1 month ago

ref #6794 update script for name changes in FeatureNode and TermVocabulary

Revision b3340748 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 change FeatureTree to TermTree

Revision 11df83d8 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 add TermCollection and subclasses including TermTree

Revision 1cc29785 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 adjust hibernate configuration to new TermCollection and adjust test data

Revision c27ce9cc (diff)
Added by Andreas Müller about 1 month ago

ref #6794 update script for graph_id and root_id

Revision 4e5c4e73 (diff)
Added by Andreas Müller about 1 month ago

cleanup and ref #6794 rename TermTreeDaoImpl

Revision 502547d1 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 fix FeatureNodeServiceImplTest

Revision 18dfe77e (diff)
Added by Andreas Müller about 1 month ago

ref #6794 move term relations down to TermCollection

Revision ec978653 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 add TermRelation and rename FeatureNode -> TermTreeNode

Revision b72678a6 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 change FeatureTree to TermTree

Revision def33852 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 add TermCollection and subclasses including TermTree

Revision 94907e20 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 adapt TermCollection test data to boolean values in TermCollection

Revision 0d79c535 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 remove references to TermVocabulary.iterator()

Revision a2533432 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 change schema version and add missing attributes to updateScript

Revision cf862eed (diff)
Added by Andreas Müller about 1 month ago

ref #6794 FeatureTreeMover first implementation (not yet ready)

Revision e793a739 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 update some imports to model changes and add ITermTree

Revision 0d80c92f (diff)
Added by Andreas Müller about 1 month ago

ref #6794 add TermRelation and rename FeatureNode -> TermTreeNode

Revision 12740fe1 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 change FeatureTree to TermTree

Revision 645aca37 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 add TermCollection and subclasses including TermTree

Revision b996fc8c (diff)
Added by Andreas Müller about 1 month ago

cleanup and ref #6794 rename TermTreeDaoImpl

Revision 17ad77a7 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 add TermRelation and rename FeatureNode -> TermTreeNode

Revision 3048fbc9 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 add TermRelation and rename FeatureNode -> TermTreeNode

ref #6794 add TermRelation and TermRelationBase

Revision 0774bb03 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 remove FeatureTree class

Revision ab5b84ab (diff)
Added by Andreas Müller about 1 month ago

ref #6794 remove FeatureTree from hibernate.cfg

Revision 40b05355 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 remove duplicate TermRelationshipType in test/hibernate.cfg.xml

Revision 74d92b60 (diff)
Added by Andreas Müller about 1 month ago

ref #6794 minor adaptations of tests

Revision 3af337bb (diff)
Added by Andreas Müller about 1 month ago

ref #6794 finalize FeatureTreeMover (update treeindex)

Revision 76463827 (diff)
Added by Andreas Müller 29 days ago

ref #6794 rename TermTreeNode -> TermNode

Revision 41061791 (diff)
Added by Andreas Müller 29 days ago

ref #6794 rename TermTreeNode -> TermNode

Revision 77dad5ec (diff)
Added by Andreas Müller 29 days ago

ref #6794 rename getFeatureNode -> getTermNode in cdmlib-print

Revision 11bdf5c4 (diff)
Added by Andreas Müller 29 days ago

ref #6794 rename TermTreeNode -> TermNode

Revision eb9880a0 (diff)
Added by Andreas Müller 29 days ago

ref #6794 rename some parameters, methods and classes

Revision 2f72f4da (diff)
Added by Andreas Müller 29 days ago

ref #6794 add TermNodeService and TermTreeService and make FeatureXXX services deprecated

Revision cbfdd05c (diff)
Added by Andreas Müller 29 days ago

ref #6794 ignore FeatureTest

Revision f9e5c38d (diff)
Added by Andreas Müller 27 days ago

ref #6794 remove FeatureTree from some hibernate.cfgs again

Revision 85bfea3a (diff)
Added by Andreas Müller 27 days ago

ref #6794 add TermTreeService and TermNodeService to httpInvokerServices

Revision 36fc6b9d (diff)
Added by Andreas Müller 27 days ago

ref #6794 adapt jsonConfigurations.xml from FeatureTree/Node -> TermTree/Node

Revision cf4196d1 (diff)
Added by Andreas Müller 27 days ago

ref #6794 some adaptations in Jaxb to FeatureTree -> TermTree

Revision 62779ba1 (diff)
Added by Andreas Müller 27 days ago

ref #6794 javadoc update FeatureTree -> TermTree

Revision d10ceac8 (diff)
Added by Andreas Müller 27 days ago

ref #6794 delete FeatureDao

Revision c5564cac (diff)
Added by Andreas Müller 27 days ago

ref #6794 remove FeatureNodeService from BatchValidationUtil

Revision cb89f4f7 (diff)
Added by Andreas Müller 27 days ago

ref #6794 adapt TaxEditor to new term structure (rename FeatureNode and FeatureTree)

Revision 160f1cbd (diff)
Added by Patrick Plitzner 26 days ago

ref #6794 Fix compile error

Revision 549e8cc5 (diff)
Added by Andreas Müller 26 days ago

ref #6794 rename IFeatureTreeDao in ITermTreeDao

Revision 06de8afc (diff)
Added by Andreas Müller 26 days ago

ref #6794 rename TermTree.NewInstance and set old version to deprecated

(cherry picked from commit 08b758e2bfba66c82fbc5a636e455edcccb9fa11)

Revision 53c7a226 (diff)
Added by Andreas Müller 26 days ago

ref #6794 rename other TermTree.NewInstance methods and set old version to deprecated

Revision 845a6a70 (diff)
Added by Patrick Plitzner 26 days ago

ref #6794 Replace FeatureTreeService with TermTreeService

Revision dd49afb6 (diff)
Added by Andreas Müller 22 days ago

ref #6794 TermTreeNode-> TermNode in cdmlib-apps

Revision 165e1209 (diff)
Added by Andreas Müller 4 days ago

ref #6794 , ref #7099 adapt app-import, pesi, eflora to modelchanges

Revision de4de718 (diff)
Added by Andreas Müller 1 day ago

ref #6794 , ref #7099 adapt E+M activator to terms package structure

History

#1 Updated by Andreas Müller about 2 years ago

  • Description updated (diff)

#2 Updated by Andreas Müller about 2 years ago

  • Description updated (diff)

#3 Updated by Andreas Müller about 2 years ago

  • Description updated (diff)

#4 Updated by Andreas Müller about 2 years ago

  • Target version changed from Unassigned CDM tickets to CDM UML 5.0

#5 Updated by Andreas Müller over 1 year ago

  • Priority changed from New to Highest

#6 Updated by Andreas Müller over 1 year ago

  • Target version changed from CDM UML 5.0 to CDM UML 5.5

#7 Updated by Andreas Müller 6 months ago

#8 Updated by Andreas Müller 6 months ago

  • Related to task #7515: TypeDesignationStatusComparator to sort by vocabulary first and then by term order added

#9 Updated by Patrick Plitzner 6 months ago

#11 Updated by Andreas Müller 6 months ago

Current idea for a solution:

Collections:

  • Common base class TermCollection(Base) for all Vocabularies and Graphs (Trees, Lists, Relationship Graphs)
    • TermVocabulary: has a Set of Terms
    • OrderedTermVocabulary: like TermVocabulary but with additional TermTree functionality, where all terms are at the same time terms within the TermTree, allows to define a Vocabulary and its default feature tree at the same time
    • TermTree: like current FeatureTree, for sets, lists and ordered and unordered trees
    • TermGraph: Set of TermRelationships
  • Attributes for trees: orderRelevant, allowsDuplicates, isFlat; for graphs: directed
  • common method: getElements

Relationship:

  • common base class TermRelationshipBase
    • Relates to exactly 1 TermCollection
  • TermNode (or TermTreeNode) for hierarchical and flat structures, relates a child term to the parent/root node, allows tree index
  • TermRelationship for Graph structure, relates 2 terms (child, relatedToTerm)

Terms:

  • remove OrderedTermBase
  • term belongs to single vocabulary
  • term has multiple TermRelationshipBases

Others:

  • Collections and TermNode do have count cache

Open issues:

  • root = collection? => difficult due to inheritance from IdentifiableEntity
  • how to call "child" in TermRelationshipBase (fromTerm, child, baseTerm)
  • need to distinguish Term.fromRelationships and Term.toRelationships?
  • interface for subtrees as they are also term collections

#12 Updated by Andreas Kohlbecker 6 months ago

  • Related to task #8166: Adapt dataportal to term structure changes added

#13 Updated by Andreas Müller 4 months ago

  • Related to bug #8251: LazyInitializationException (LIE) in featureTree webservice added

#14 Updated by Andreas Müller 4 months ago

#15 Updated by Andreas Müller 4 months ago

  • Target version changed from CDM UML 5.5 to CDM UML 5.10

#16 Updated by Andreas Müller 28 days ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 20

#17 Updated by Andreas Müller 28 days ago

  • Target version changed from CDM UML 5.10 to CDM UML 5.8

#18 Updated by Andreas Kohlbecker 26 days ago

  • Related to task #8405: Adapt cdm-vaadin to term structure changes added

#19 Updated by Andreas Müller 26 days ago

  • Related to bug #8407: Fix "FeatureTest" added

#20 Updated by Andreas Kohlbecker 19 days ago

  • Related to task #8434: Change FeatureTree contollers to TermTree controllers added

#21 Updated by Andreas Kohlbecker 19 days ago

#22 Updated by Andreas Kohlbecker 19 days ago

  • Description updated (diff)

#23 Updated by Andreas Müller 4 days ago

#24 Updated by Andreas Müller 4 days ago

#25 Updated by Andreas Müller 4 days ago

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)