Class DesignModelArchiveBuilder


  • public class DesignModelArchiveBuilder
    extends Object
    DesignModelArchiveBuilder creates the open metadata compliant instances for content that is typically found in a common/standard design model. This initial implementation is focused on concept models.
    • Field Detail

      • writeToFile

        protected boolean writeToFile
    • Constructor Detail

      • DesignModelArchiveBuilder

        protected DesignModelArchiveBuilder​(String archiveGUID,
                                            String archiveName,
                                            String archiveDescription,
                                            OpenMetadataArchiveType archiveType,
                                            String archiveRootName,
                                            String originatorName,
                                            String originatorLicense,
                                            Date creationDate,
                                            long versionNumber,
                                            String versionName)
        Typical constructor passes parameters used to build the open metadata archive's property header.
        Parameters:
        archiveGUID - unique identifier for this open metadata archive.
        archiveName - name of the open metadata archive.
        archiveDescription - description of the open metadata archive.
        archiveType - enum describing the type of archive this is.
        archiveRootName - non-spaced root name of the open metadata archive elements.
        originatorName - name of the originator (person or organization) of the archive.
        originatorLicense - license for the content.
        creationDate - data that this archive was created.
        versionNumber - version number of the archive.
        versionName - version name for the archive.
      • DesignModelArchiveBuilder

        public DesignModelArchiveBuilder()
        Default constructor
    • Method Detail

      • initialize

        protected void initialize​(String archiveGUID,
                                  String archiveName,
                                  String archiveDescription,
                                  OpenMetadataArchiveType archiveType,
                                  String archiveRootName,
                                  String originatorName,
                                  String originatorLicense,
                                  Date creationDate,
                                  long versionNumber,
                                  String versionName)
        Typical constructor passes parameters used to build the open metadata archive's property header.
        Parameters:
        archiveGUID - unique identifier for this open metadata archive.
        archiveName - name of the open metadata archive.
        archiveDescription - description of the open metadata archive.
        archiveType - enum describing the type of archive this is.
        archiveRootName - non-spaced root name of the open metadata archive elements.
        originatorName - name of the originator (person or organization) of the archive.
        originatorLicense - license for the content.
        creationDate - data that this archive was created.
        versionNumber - version number of the archive.
        versionName - version name for the archive.
      • addGlossary

        protected String addGlossary​(String qualifiedName,
                                     String displayName,
                                     String description,
                                     String language,
                                     String usage,
                                     String externalLink,
                                     String scope)
        Create a glossary entity. If the external link is specified, the glossary entity is linked to an ExternalGlossaryLink entity. If the scope is specified, the glossary entity is classified as a CanonicalGlossary.
        Parameters:
        qualifiedName - unique name for the glossary
        displayName - display name for the glossary
        description - description about the glossary
        language - language that the glossary is written in
        usage - how the glossary should be used
        externalLink - link to material
        scope - scope of the content.
        Returns:
        id for the glossary
      • addCategory

        protected String addCategory​(String glossaryId,
                                     String qualifiedName,
                                     String displayName,
                                     String description,
                                     String subjectArea)
        Add a glossary category to the archive and connect it to glossary.
        Parameters:
        glossaryId - identifier of the glossary.
        qualifiedName - unique name for the category.
        displayName - display name for the category.
        description - description of the category.
        subjectArea - name of the subject area if this category contains terms for the subject area.
        Returns:
        identifier of the category
      • addTerm

        protected String addTerm​(String glossaryId,
                                 List<String> categoryIds,
                                 String qualifiedName,
                                 String displayName,
                                 String description)
        Add a term and link it to the glossary and an arbitrary number of categories.
        Parameters:
        glossaryId - unique identifier of the glossary
        categoryIds - unique identifiers of the categories
        qualifiedName - unique name of the term
        displayName - display name of the term
        description - description of the term
        Returns:
        unique identifier of the term
      • addTerm

        protected String addTerm​(String glossaryId,
                                 List<String> categoryIds,
                                 String qualifiedName,
                                 String displayName,
                                 String description,
                                 String examples,
                                 boolean isSpineObject,
                                 boolean isSpineAttribute,
                                 boolean categoriesAsNames)
        Add a term and link it to the glossary and an arbitrary number of categories.
        Parameters:
        glossaryId - unique identifier of the glossary
        categoryIds - unique identifiers of the categories
        qualifiedName - unique name of the term
        displayName - display name of the term
        description - description of the term
        examples - examples of the term
        isSpineObject - term is a spine object
        isSpineAttribute - term is a spine attribute
        categoriesAsNames - when true the categories are specified as qualified names, otherwise they are guids.
        Returns:
        unique identifier of the term
      • addCategoryToCategory

        protected void addCategoryToCategory​(String parentCategoryId,
                                             String childCategoryId)
        Link two categories together as part of the parent child hierarchy.
        Parameters:
        parentCategoryId - unique identifier for the parent category
        childCategoryId - unique identifier for the child category
      • addMoreInformationLink

        protected void addMoreInformationLink​(String describedElementId,
                                              String describerElementId)
        Create a navigation link from one referenceable to another to show they provide more information.
        Parameters:
        describedElementId - unique identifier for the element that is referencing the other.
        describerElementId - unique identifier for the element being pointed to.
      • linkTermToReferenceable

        protected void linkTermToReferenceable​(String termId,
                                               String referenceableId)
        Create a semantic assignment between a term and a Referenceable - for example a model element.
        Parameters:
        termId - identifier of term
        referenceableId - identifier of referenceable
      • addDesignModel

        protected String addDesignModel​(String qualifiedName,
                                        String displayName,
                                        String technicalName,
                                        String description,
                                        String versionNumber,
                                        String author)
        Create an element that represents a design model.
        Parameters:
        qualifiedName - unique name for the model
        displayName - display name
        technicalName - non-spaced name
        description - description
        versionNumber - version description
        author - author
        Returns:
        guid of model
      • addDesignModelGroup

        protected String addDesignModelGroup​(String modelId,
                                             String parentGroupId,
                                             String qualifiedName,
                                             String displayName,
                                             String technicalName,
                                             String description,
                                             String versionNumber,
                                             String author)
        Create an element for a model group and link it to a model and any parent model group.
        Parameters:
        modelId - unique identifier of model (or null)
        parentGroupId - unique identifier of parent (or null)
        qualifiedName - unique name for the model
        displayName - display name
        technicalName - non-spaced name
        description - description
        versionNumber - version description
        author - author
        Returns:
        guid of model group
      • addConceptModelElement

        protected String addConceptModelElement​(String typeName,
                                                String modelId,
                                                List<String> groupIds,
                                                String qualifiedName,
                                                String displayName,
                                                String technicalName,
                                                String description,
                                                String versionNumber,
                                                String author)
        Create an element of a concept model.
        Parameters:
        typeName - unique name of the element's type
        modelId - unique identifier of model (or null)
        groupIds - list of model groups to add this element to
        qualifiedName - unique name for the model
        displayName - display name
        technicalName - non-spaced name
        description - description
        versionNumber - version description
        author - author
        Returns:
        guid of element
      • addConceptBead

        protected String addConceptBead​(String modelId,
                                        List<String> groupIds,
                                        String qualifiedName,
                                        String displayName,
                                        String technicalName,
                                        String description,
                                        String versionNumber,
                                        String author)
        Create an element that describes a concept bead.
        Parameters:
        modelId - unique identifier of model (or null)
        groupIds - list of model groups to add this element to
        qualifiedName - unique name for the model
        displayName - display name
        technicalName - non-spaced name
        description - description
        versionNumber - version description
        author - author
        Returns:
        guid of element
      • addConceptBeadLink

        protected String addConceptBeadLink​(String modelId,
                                            List<String> groupIds,
                                            String qualifiedName,
                                            String displayName,
                                            String technicalName,
                                            String description,
                                            String versionNumber,
                                            String author)
        Create a concept bead link.
        Parameters:
        modelId - unique identifier of model (or null)
        groupIds - list of model groups to add this element to
        qualifiedName - unique name for the model
        displayName - display name
        technicalName - non-spaced name
        description - description
        versionNumber - version description
        author - author
        Returns:
        guid of element
      • addConceptBeadAttribute

        protected String addConceptBeadAttribute​(String modelId,
                                                 List<String> groupIds,
                                                 String qualifiedName,
                                                 String displayName,
                                                 String technicalName,
                                                 String description,
                                                 String versionNumber,
                                                 String author)
        Create a concept attribute.
        Parameters:
        modelId - unique identifier for the model element
        groupIds - list of model groups to add this element to
        qualifiedName - unique name for the model
        displayName - display name
        technicalName - non-spaced name
        description - description
        versionNumber - version description
        author - author
        Returns:
        guid of element
      • addAttributeToBead

        protected void addAttributeToBead​(String beadId,
                                          String attributeId,
                                          int position,
                                          int minCardinality,
                                          int maxCardinality,
                                          boolean uniqueValues,
                                          boolean orderedValues)
      • addLinkToBead

        protected void addLinkToBead​(String beadId,
                                     String linkId,
                                     String attributeName,
                                     ConceptModelDecoration decoration,
                                     int position,
                                     int minCardinality,
                                     int maxCardinality,
                                     boolean uniqueValues,
                                     boolean orderedValues)
      • addIsATypeOfRelationship

        protected void addIsATypeOfRelationship​(String specialTermQName,
                                                String generalizedTermQName)
        Add an is-a-type-of relationship
        Parameters:
        specialTermQName - qualified name of the specialized term
        generalizedTermQName - qualified name of the generalized term
      • addHasARelationship

        protected void addHasARelationship​(String conceptQName,
                                           String propertyQName)
      • addRelatedTermRelationship

        protected void addRelatedTermRelationship​(String conceptQName,
                                                  String propertyQName)
      • addCategoryHierarchy

        protected void addCategoryHierarchy​(String childCategoryName,
                                            Set<String> parentNames)
        Add Category hierarchy relationship
        Parameters:
        childCategoryName - name of the child category
        parentNames - set of the names of the parent categories qualified names
      • getOpenMetadataArchive

        protected OpenMetadataArchive getOpenMetadataArchive()
        Returns the open metadata type archive containing all of the content loaded by the subclass.
        Returns:
        populated open metadata archive object
      • logBadArchiveContent

        protected void logBadArchiveContent​(String methodName)
        Throws an exception if there is a problem building the archive.
        Parameters:
        methodName - calling method