Class DesignModelArchiveBuilder
java.lang.Object
org.odpi.openmetadata.archiveutilities.designmodels.base.DesignModelArchiveBuilder
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 Summary
-
Constructor Summary
ModifierConstructorDescriptionDefault constructorprotected
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. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAttributeToBead
(String beadId, String attributeId, int position, int minCardinality, int maxCardinality, boolean uniqueValues, boolean orderedValues) 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.protected void
addCategoryHierarchy
(String childCategoryName, Set<String> parentNames) Add Category hierarchy relationshipprotected void
addCategoryToCategory
(String parentCategoryId, String childCategoryId) Link two categories together as part of the parent child hierarchy.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.protected String
addConceptBeadAttribute
(String modelId, List<String> groupIds, String qualifiedName, String displayName, String technicalName, String description, String versionNumber, String author) Create a concept attribute.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.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.protected String
addDesignModel
(String qualifiedName, String displayName, String technicalName, String description, String versionNumber, String author) Create an element that represents a design model.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.protected String
addGlossary
(String qualifiedName, String displayName, String description, String language, String usage, String externalLink, String scope) Create a glossary entity.protected void
addHasARelationship
(String conceptQName, String propertyQName) protected void
addIsATypeOfRelationship
(String specialTermQName, String generalizedTermQName) Add an is-a-type-of relationshipprotected void
addLinkToBead
(String beadId, String linkId, String attributeName, ConceptModelDecoration decoration, int position, int minCardinality, int maxCardinality, boolean uniqueValues, boolean orderedValues) protected void
addMoreInformationLink
(String describedElementId, String describerElementId) Create a navigation link from one referenceable to another to show they provide more information.protected void
addRelatedTermRelationship
(String conceptQName, String propertyQName) 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.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.protected OpenMetadataArchive
Returns the open metadata type archive containing all of the content loaded by the subclass.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.protected void
linkTermToReferenceable
(String termId, String referenceableId) Create a semantic assignment between a term and a Referenceable - for example a model element.protected void
logBadArchiveContent
(String methodName) Throws an exception if there is a problem building the archive.
-
Field Details
-
writeToFile
protected boolean writeToFile
-
-
Constructor Details
-
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 Details
-
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 glossarydisplayName
- display name for the glossarydescription
- description about the glossarylanguage
- language that the glossary is written inusage
- how the glossary should be usedexternalLink
- link to materialscope
- 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 glossarycategoryIds
- unique identifiers of the categoriesqualifiedName
- unique name of the termdisplayName
- display name of the termdescription
- 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 glossarycategoryIds
- unique identifiers of the categoriesqualifiedName
- unique name of the termdisplayName
- display name of the termdescription
- description of the termexamples
- examples of the termisSpineObject
- term is a spine objectisSpineAttribute
- term is a spine attributecategoriesAsNames
- when true the categories are specified as qualified names, otherwise they are guids.- Returns:
- unique identifier of the term
-
addCategoryToCategory
Link two categories together as part of the parent child hierarchy.- Parameters:
parentCategoryId
- unique identifier for the parent categorychildCategoryId
- unique identifier for the child category
-
addMoreInformationLink
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
Create a semantic assignment between a term and a Referenceable - for example a model element.- Parameters:
termId
- identifier of termreferenceableId
- 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 modeldisplayName
- display nametechnicalName
- non-spaced namedescription
- descriptionversionNumber
- version descriptionauthor
- 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 modeldisplayName
- display nametechnicalName
- non-spaced namedescription
- descriptionversionNumber
- version descriptionauthor
- 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 typemodelId
- unique identifier of model (or null)groupIds
- list of model groups to add this element toqualifiedName
- unique name for the modeldisplayName
- display nametechnicalName
- non-spaced namedescription
- descriptionversionNumber
- version descriptionauthor
- 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 toqualifiedName
- unique name for the modeldisplayName
- display nametechnicalName
- non-spaced namedescription
- descriptionversionNumber
- version descriptionauthor
- 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 toqualifiedName
- unique name for the modeldisplayName
- display nametechnicalName
- non-spaced namedescription
- descriptionversionNumber
- version descriptionauthor
- 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 elementgroupIds
- list of model groups to add this element toqualifiedName
- unique name for the modeldisplayName
- display nametechnicalName
- non-spaced namedescription
- descriptionversionNumber
- version descriptionauthor
- author- Returns:
- guid of element
-
addAttributeToBead
-
addLinkToBead
protected void addLinkToBead(String beadId, String linkId, String attributeName, ConceptModelDecoration decoration, int position, int minCardinality, int maxCardinality, boolean uniqueValues, boolean orderedValues) -
addIsATypeOfRelationship
Add an is-a-type-of relationship- Parameters:
specialTermQName
- qualified name of the specialized termgeneralizedTermQName
- qualified name of the generalized term
-
addHasARelationship
-
addRelatedTermRelationship
-
addCategoryHierarchy
Add Category hierarchy relationship- Parameters:
childCategoryName
- name of the child categoryparentNames
- set of the names of the parent categories qualified names
-
getOpenMetadataArchive
Returns the open metadata type archive containing all of the content loaded by the subclass.- Returns:
- populated open metadata archive object
-
logBadArchiveContent
Throws an exception if there is a problem building the archive.- Parameters:
methodName
- calling method
-