Skip to content

Commit

Permalink
Merge branch 'master' into issue4734i
Browse files Browse the repository at this point in the history
  • Loading branch information
planetf1 authored Mar 5, 2021
2 parents 7f5260a + 3e27692 commit e93467e
Show file tree
Hide file tree
Showing 58 changed files with 3,328 additions and 1,394 deletions.
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ but manage it in a siloed, proprietary way that assumes
they are the only technology employed by the organization.
The result is that knowledge is not shared between people that use different tool sets.

ODPi Egeria is an open source project dedicated to making metadata open and automatically exchanged between tools
Egeria is an open source project dedicated to making metadata open and automatically exchanged between tools
and platforms, no matter which vendor they come from.

We believe in the **open metadata and governance manifesto**:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetailDifferences;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceHeader;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDef;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper;

Expand Down Expand Up @@ -317,27 +316,19 @@ private void createSchemaAttribute(String userId, SchemaType schemaType, String
final String methodName = "createSchemaAttribute";
SchemaAttributeBuilder schemaAttributeBuilder = getSchemaAttributeBuilder(attribute);
SchemaTypeBuilder schemaTypeBuilder = getSchemaTypeBuilder(schemaType);
schemaTypeBuilder.setDataType(dataType);
schemaAttributeBuilder.setSchemaType(userId, schemaTypeBuilder, methodName);
final String schemaTypeGUIDParameterName = "schemaTypeGUID";
final String qualifiedNameParameterName = "schemaAttribute.getQualifiedName()";

String externalSourceGUID = dataEngineRegistrationHandler.getExternalDataEngineByQualifiedName(userId, externalSourceName);

String schemaAttributeGUID = schemaAttributeHandler.createNestedSchemaAttribute(userId, externalSourceGUID,
schemaAttributeHandler.createNestedSchemaAttribute(userId, externalSourceGUID,
externalSourceName, schemaTypeGUID, schemaTypeGUIDParameterName,
OpenMetadataAPIMapper.TABULAR_SCHEMA_TYPE_TYPE_NAME,
OpenMetadataAPIMapper.TYPE_TO_ATTRIBUTE_RELATIONSHIP_TYPE_GUID,
OpenMetadataAPIMapper.TYPE_TO_ATTRIBUTE_RELATIONSHIP_TYPE_NAME,
attribute.getQualifiedName(), qualifiedNameParameterName, schemaAttributeBuilder, methodName);

TypeDef classificationTypeDef = repositoryHelper.getTypeDefByName(userId, SchemaTypePropertiesMapper.TYPE_EMBEDDED_ATTRIBUTE_NAME);
InstanceProperties properties = repositoryHelper.addStringPropertyToInstance(serviceName, null,
SchemaTypePropertiesMapper.DATA_TYPE, dataType, methodName);

repositoryHandler.classifyEntity(userId, externalSourceGUID,
externalSourceName, schemaAttributeGUID, classificationTypeDef.getGUID(), classificationTypeDef.getName(),
null, null, properties, methodName);

}

private EntityDetail buildSchemaTypeEntityDetail(String schemaTypeGUID, SchemaType schemaType) throws InvalidParameterException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,6 @@ void createSchemaTypeWithSchemaAttribute() throws InvalidParameterException, Pro
.validateName(QUALIFIED_NAME, SchemaTypePropertiesMapper.QUALIFIED_NAME_PROPERTY_NAME, methodName);
verify(invalidParameterHandler, times(1))
.validateName(NAME, SchemaTypePropertiesMapper.DISPLAY_NAME_PROPERTY_NAME, methodName);

TypeDef classificationTypeDef = repositoryHelper.getTypeDefByName(USER, SchemaTypePropertiesMapper.TYPE_EMBEDDED_ATTRIBUTE_NAME);
InstanceProperties properties = repositoryHelper.addStringPropertyToInstance("sourceName", null,
SchemaTypePropertiesMapper.DATA_TYPE, attribute.getDataType(), methodName);

verify(repositoryHandler, times(1)).classifyEntity(USER, EXTERNAL_SOURCE_DE_GUID,
EXTERNAL_SOURCE_DE_QUALIFIED_NAME, ATTRIBUTE_GUID, classificationTypeDef.getGUID(), classificationTypeDef.getName(),
null, null, properties, "createSchemaAttribute");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,44 @@ OpenMetadataElement getMetadataElementByGUID(String userId,
PropertyServerException;


/**
* Retrieve the metadata element using its unique name (typically the qualified name).
*
* @param userId caller's userId
* @param uniqueName unique name for the metadata element
* @param uniquePropertyName name of property name to test in the open metadata element - if null "qualifiedName" is used
*
* @return metadata element properties
* @throws InvalidParameterException the unique identifier is null or not known.
* @throws UserNotAuthorizedException the governance action service is not able to access the element
* @throws PropertyServerException there is a problem accessing the metadata store
*/
OpenMetadataElement getMetadataElementByUniqueName(String userId,
String uniqueName,
String uniquePropertyName) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException;


/**
* Retrieve the unique identifier of a metadata element using its unique name (typically the qualified name).
*
* @param userId caller's userId
* @param uniqueName unique name for the metadata element
* @param uniquePropertyName name of property name to test in the open metadata element - if null "qualifiedName" is used
*
* @return metadata element unique identifier (guid)
* @throws InvalidParameterException the unique identifier is null or not known.
* @throws UserNotAuthorizedException the governance action service is not able to access the element
* @throws PropertyServerException there is a problem accessing the metadata store
*/
String getMetadataElementGUIDByUniqueName(String userId,
String uniqueName,
String uniquePropertyName) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException;


/**
* Retrieve the metadata elements that contain the requested string.
*
Expand All @@ -62,6 +100,7 @@ List<OpenMetadataElement> findMetadataElementsWithString(String userId,
*
* @param userId caller's userId
* @param elementGUID unique identifier for the starting metadata element
* @param startingAtEnd indicates which end to retrieve from (0 is "either end"; 1 is end1; 2 is end 2)
* @param relationshipTypeName type name of relationships to follow (or null for all)
* @param startFrom paging start point
* @param pageSize maximum results that can be returned
Expand All @@ -74,6 +113,7 @@ List<OpenMetadataElement> findMetadataElementsWithString(String userId,
*/
List<RelatedMetadataElement> getRelatedMetadataElements(String userId,
String elementGUID,
int startingAtEnd,
String relationshipTypeName,
int startFrom,
int pageSize) throws InvalidParameterException,
Expand Down
Loading

0 comments on commit e93467e

Please sign in to comment.