protected AtlasRelatedObjectId glossaryIdToRelatedObjectId(AtlasGlossaryHeader glossaryId) { AtlasRelatedObjectId ret = new AtlasRelatedObjectId(); ret.setGuid(glossaryId.getGlossaryGuid()); ret.setRelationshipGuid(glossaryId.getRelationGuid()); return ret; }
protected AtlasRelatedObjectId glossaryIdToRelatedObjectId(AtlasGlossaryHeader glossaryId) { AtlasRelatedObjectId ret = new AtlasRelatedObjectId(); ret.setGuid(glossaryId.getGlossaryGuid()); ret.setRelationshipGuid(glossaryId.getRelationGuid()); return ret; }
protected AtlasRelatedObjectId relatedCategoryIdToRelatedObjectId(AtlasRelatedCategoryHeader relatedCategoryId) { AtlasRelatedObjectId ret = new AtlasRelatedObjectId(); ret.setGuid(relatedCategoryId.getCategoryGuid()); ret.setRelationshipGuid(relatedCategoryId.getRelationGuid()); AtlasStruct relationshipAttributes = new AtlasStruct(); relationshipAttributes.setAttribute("description", relatedCategoryId.getDescription()); ret.setRelationshipAttributes(relationshipAttributes); return ret; }
protected AtlasRelatedObjectId relatedCategoryIdToRelatedObjectId(AtlasRelatedCategoryHeader relatedCategoryId) { AtlasRelatedObjectId ret = new AtlasRelatedObjectId(); ret.setGuid(relatedCategoryId.getCategoryGuid()); ret.setRelationshipGuid(relatedCategoryId.getRelationGuid()); AtlasStruct relationshipAttributes = new AtlasStruct(); relationshipAttributes.setAttribute("description", relatedCategoryId.getDescription()); ret.setRelationshipAttributes(relationshipAttributes); return ret; }
private AtlasRelatedObjectId mapVertexToRelatedObjectId(AtlasVertex entityVertex, AtlasEdge edge) throws AtlasBaseException { AtlasRelatedObjectId ret = null; if (GraphHelper.elementExists(edge)) { AtlasVertex referenceVertex = edge.getInVertex(); if (StringUtils.equals(getIdFromVertex(referenceVertex), getIdFromVertex(entityVertex))) { referenceVertex = edge.getOutVertex(); } if (referenceVertex != null) { String entityTypeName = getTypeName(referenceVertex); String entityGuid = getGuid(referenceVertex); AtlasEntity.Status entityStatus = GraphHelper.getStatus(referenceVertex); AtlasRelationship relationship = mapEdgeToAtlasRelationship(edge); ret = new AtlasRelatedObjectId(entityGuid, entityTypeName, entityStatus, relationship.getGuid(), relationship.getStatus(), new AtlasStruct(relationship.getTypeName(), relationship.getAttributes())); Object displayText = getDisplayText(referenceVertex, entityTypeName); if (displayText != null) { ret.setDisplayText(displayText.toString()); } } } return ret; }
private AtlasRelatedObjectId mapVertexToRelatedObjectId(AtlasVertex entityVertex, AtlasEdge edge) throws AtlasBaseException { AtlasRelatedObjectId ret = null; if (GraphHelper.elementExists(edge)) { AtlasVertex referenceVertex = edge.getInVertex(); if (StringUtils.equals(getIdFromVertex(referenceVertex), getIdFromVertex(entityVertex))) { referenceVertex = edge.getOutVertex(); } if (referenceVertex != null) { String entityTypeName = getTypeName(referenceVertex); String entityGuid = getGuid(referenceVertex); AtlasEntity.Status entityStatus = GraphHelper.getStatus(referenceVertex); AtlasRelationship relationship = mapEdgeToAtlasRelationship(edge); ret = new AtlasRelatedObjectId(entityGuid, entityTypeName, entityStatus, relationship.getGuid(), relationship.getStatus(), new AtlasStruct(relationship.getTypeName(), relationship.getAttributes())); Object displayText = getDisplayText(referenceVertex, entityTypeName); if (displayText != null) { ret.setDisplayText(displayText.toString()); } } } return ret; }
EntityMutationResponse response = entityStore.createOrUpdate(new AtlasEntityStream(assetEntity), false); AtlasEntityHeader firstEntityCreated = response.getFirstEntityCreated(); relatedObjectId = new AtlasRelatedObjectId(); relatedObjectId.setGuid(firstEntityCreated.getGuid()); relatedObjectId.setTypeName(firstEntityCreated.getTypeName());
EntityMutationResponse response = entityStore.createOrUpdate(new AtlasEntityStream(assetEntity), false); AtlasEntityHeader firstEntityCreated = response.getFirstEntityCreated(); relatedObjectId = new AtlasRelatedObjectId(); relatedObjectId.setGuid(firstEntityCreated.getGuid()); relatedObjectId.setTypeName(firstEntityCreated.getTypeName());
protected AtlasRelatedObjectId termIdToRelatedObjectId(AtlasRelatedTermHeader relatedTermId) { AtlasRelatedObjectId ret = new AtlasRelatedObjectId(); ret.setGuid(relatedTermId.getTermGuid()); ret.setRelationshipGuid(relatedTermId.getRelationGuid()); AtlasStruct relationshipAttributes = new AtlasStruct(); relationshipAttributes.setAttribute("description", relatedTermId.getDescription()); relationshipAttributes.setAttribute("expression", relatedTermId.getExpression()); relationshipAttributes.setAttribute("source", relatedTermId.getSource()); relationshipAttributes.setAttribute("steward", relatedTermId.getSteward()); relationshipAttributes.setAttribute("status", relatedTermId.getStatus().name()); ret.setRelationshipAttributes(relationshipAttributes); return ret; }
protected AtlasRelatedObjectId termIdToRelatedObjectId(AtlasRelatedTermHeader relatedTermId) { AtlasRelatedObjectId ret = new AtlasRelatedObjectId(); ret.setGuid(relatedTermId.getTermGuid()); ret.setRelationshipGuid(relatedTermId.getRelationGuid()); AtlasStruct relationshipAttributes = new AtlasStruct(); relationshipAttributes.setAttribute("description", relatedTermId.getDescription()); relationshipAttributes.setAttribute("expression", relatedTermId.getExpression()); relationshipAttributes.setAttribute("source", relatedTermId.getSource()); relationshipAttributes.setAttribute("steward", relatedTermId.getSteward()); relationshipAttributes.setAttribute("status", relatedTermId.getStatus().name()); ret.setRelationshipAttributes(relationshipAttributes); return ret; }