Class ModelKnowledge

java.lang.Object
org.gcube.informationsystem.discovery.knowledge.ModelKnowledge

public class ModelKnowledge extends Object
Manages the discovered knowledge for a specific model, including type hierarchies and usage information.
Author:
Luca Frosini (ISTI - CNR)
  • Field Details

    • created

      protected boolean created
      Whether the knowledge base has been created.
    • usageKnowledges

      protected Map<AccessType,UsageKnowledge> usageKnowledges
      A map of usage knowledge, keyed by access type.
    • trees

      protected Map<AccessType,Tree<Class<Element>>> trees
      A map of class hierarchy trees, keyed by access type.
    • discoveries

      protected Map<AccessType,Discovery<Element>> discoveries
      A map of discovery instances, keyed by access type.
    • packages

      protected Set<Package> packages
      The set of packages to be scanned.
  • Constructor Details

    • ModelKnowledge

      public ModelKnowledge()
      Constructs a new ModelKnowledge instance.
  • Method Details

    • getUsageKnowledge

      public UsageKnowledge getUsageKnowledge(AccessType accessType)
      Returns the usage knowledge for a specific access type.
      Parameters:
      accessType - The access type.
      Returns:
      The UsageKnowledge for the type.
      Throws:
      RuntimeException - if the knowledge has not yet been created.
    • createKnowledge

      public void createKnowledge(boolean force) throws Exception
      Creates the knowledge base, with an option to force recreation.
      Parameters:
      force - true to force recreation of the knowledge base.
      Throws:
      Exception - if an error occurs during creation.
    • addPackages

      public void addPackages(Collection<Package> packages)
      Adds a collection of packages to be scanned for model types.
      Parameters:
      packages - The packages to add.
    • createKnowledge

      public void createKnowledge() throws Exception
      Creates the knowledge base by discovering types, building hierarchies, and gathering usage information.
      Throws:
      Exception - if an error occurs during creation.
    • getClassesTree

      public Tree<Class<Element>> getClassesTree(AccessType accessType)
      Returns the class hierarchy tree for a specific access type.
      Parameters:
      accessType - The access type.
      Returns:
      The Tree of classes.
    • getDiscovery

      public Discovery<Element> getDiscovery(AccessType accessType)
      Returns the discovery instance for a specific access type.
      Parameters:
      accessType - The access type.
      Returns:
      The Discovery instance.