Class ClassificationMapping


  • public class ClassificationMapping
    extends InstanceAuditHeaderMapping
    Maps the properties of Classifications between persistence and objects. The idea is to map Classifications into a Crux data model that flattens their structure into the EntitySummary structure itself (so they are always retrieved with the EntitySummary document), using the following convention: { ... :classifications.Confidentiality/type :type/(GUID) :classifications.Confidentiality/instanceLicense "" :classifications.Confidentiality/createTime #inst "2021-01-26T16:35:37.504-00:00" :classifications.Confidentiality.classificationProperties/level ... ... :classifications.AnotherClassification/type :type/(GUID) :classifications.AnotherClassification/createTime #inst "2021-01-26T16:30:37.504-00:00" :classifications.AnotherClassification.classificationProperties/property ... ... } In this way, each classification can be kept separate from other classifications, and a single classification's value remains mutually-exclusive with any other values for that classification (due to the unique reference name of the properties of that classification).
    • Constructor Detail

      • ClassificationMapping

        public ClassificationMapping​(CruxOMRSRepositoryConnector cruxConnector,
                                     List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification> classifications,
                                     String namespace)
        Construct a mapping from a Classification (to map to a Crux representation).
        Parameters:
        cruxConnector - connectivity to Crux
        classifications - from which to map
        namespace - under which to qualify the classifications
      • ClassificationMapping

        public ClassificationMapping​(CruxOMRSRepositoryConnector cruxConnector,
                                     crux.api.CruxDocument cruxDoc,
                                     String namespace)
        Construct a mapping from a Crux map (to map to an Egeria representation).
        Parameters:
        cruxConnector - connectivity to Crux
        cruxDoc - from which to map
        namespace - under which the classifications are qualified
    • Method Detail

      • isKnownBaseProperty

        public static boolean isKnownBaseProperty​(String property)
        Check whether the specified property is a known base-level Classification property.
        Parameters:
        property - to check
        Returns:
        boolean
      • addToCruxDoc

        public void addToCruxDoc​(crux.api.CruxDocument.Builder builder)
        Add the details of the mapping to the provided CruxDocument builder.
        Parameters:
        builder - into which to add the classification details
      • fromDoc

        protected List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification> fromDoc()
        Translate the provided Crux representation into an Egeria representation.
        Returns:
        List<Classification>
      • getNamespaceForClassification

        public static String getNamespaceForClassification​(String root,
                                                           String classificationName)
        Given a classification name and qualifying namespace, convert into a qualified name that can be used for the classification-specific namespace.
        Parameters:
        root - namespace
        classificationName - of the classification
        Returns:
        String qualified namespace
      • getClassificationNameFromNamespace

        public static String getClassificationNameFromNamespace​(String root,
                                                                String qualifiedNamespace)
        Given a fully-qualified classification namespace and a root, parse out the name of the classification.
        Parameters:
        root - namespace
        qualifiedNamespace - fully-qualified classification namespace
        Returns:
        String classification name
      • getClassificationOriginFromSymbolicName

        public static org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ClassificationOrigin getClassificationOriginFromSymbolicName​(CruxOMRSRepositoryConnector cruxConnector,
                                                                                                                                                                                           String symbolicName)
        Convert the provided symbolic name into its ClassificationOrigin.
        Parameters:
        cruxConnector - connectivity to the repository
        symbolicName - to convert
        Returns:
        ClassificationOrigin
      • getSymbolicNameForClassificationOrigin

        public static String getSymbolicNameForClassificationOrigin​(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ClassificationOrigin co)
        Convert the provided ClassificationOrigin into its symbolic name.
        Parameters:
        co - to convert
        Returns:
        String
      • getNamespaceForProperties

        public static String getNamespaceForProperties​(String qualifiedRoot)
        Retrieve the namespace for properties of the classification
        Parameters:
        qualifiedRoot - the classification-qualified root for the namespace
        Returns:
        String