// get required properties
PropertyData<?> pd = properties.getProperties().get(PropertyIds.SOURCE_ID);
String sourceId = (String) pd.getFirstValue();
if (null == sourceId || sourceId.length() == 0)
throw new CmisInvalidArgumentException("Cannot create a relationship without a sourceId.");
pd = properties.getProperties().get(PropertyIds.TARGET_ID);
String targetId = (String) pd.getFirstValue();
if (null == targetId || targetId.length() == 0)
throw new CmisInvalidArgumentException("Cannot create a relationship without a targetId.");
RelationshipTypeDefinition typeDef = (RelationshipTypeDefinition) getTypeDefinition(repositoryId, properties);
// check if the given type is a relationship type
if (!typeDef.getBaseTypeId().equals(BaseTypeId.CMIS_RELATIONSHIP))
throw new CmisInvalidArgumentException("Cannot create a relationship, with a non-relationship type: " + typeDef.getId());
StoredObject[] relationObjects = validator.createRelationship(context, repositoryId, sourceId, targetId, extension);
TypeValidator.validateRequiredSystemProperties(properties);