Tabnine Logo
AtlasRelationshipDef.getRelationshipLabel
Code IndexAdd Tabnine to your IDE (free)

How to use
getRelationshipLabel
method
in
org.apache.atlas.model.typedef.AtlasRelationshipDef

Best Java code snippets using org.apache.atlas.model.typedef.AtlasRelationshipDef.getRelationshipLabel (Showing top 4 results out of 315)

origin: apache/atlas

private String getRelationshipEdgeLabel(AtlasVertex fromVertex, AtlasVertex toVertex, String relationshipTypeName) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("getRelationshipEdgeLabel({})", relationshipTypeName);
  }
  AtlasRelationshipType   relationshipType   = typeRegistry.getRelationshipTypeByName(relationshipTypeName);
  String                  ret                = relationshipType.getRelationshipDef().getRelationshipLabel();
  AtlasRelationshipEndDef endDef1            = relationshipType.getRelationshipDef().getEndDef1();
  AtlasRelationshipEndDef endDef2            = relationshipType.getRelationshipDef().getEndDef2();
  Set<String>             fromVertexTypes    = getTypeAndAllSuperTypes(AtlasGraphUtilsV2.getTypeName(fromVertex));
  Set<String>             toVertexTypes      = getTypeAndAllSuperTypes(AtlasGraphUtilsV2.getTypeName(toVertex));
  AtlasAttribute          attribute          = null;
  // validate entity type and all its supertypes contains relationshipDefs end type
  // e.g. [hive_process -> hive_table] -> [Process -> DataSet]
  if (fromVertexTypes.contains(endDef1.getType()) && toVertexTypes.contains(endDef2.getType())) {
    String attributeName = endDef1.getName();
    attribute = relationshipType.getEnd1Type().getRelationshipAttribute(attributeName);
  } else if (fromVertexTypes.contains(endDef2.getType()) && toVertexTypes.contains(endDef1.getType())) {
    String attributeName = endDef2.getName();
    attribute = relationshipType.getEnd2Type().getRelationshipAttribute(attributeName);
  }
  if (attribute != null) {
    ret = attribute.getRelationshipEdgeLabel();
  }
  return ret;
}
origin: org.apache.atlas/atlas-repository

private String getRelationshipEdgeLabel(AtlasVertex fromVertex, AtlasVertex toVertex, String relationshipTypeName) {
  if (LOG.isDebugEnabled()) {
    LOG.debug("getRelationshipEdgeLabel({})", relationshipTypeName);
  }
  AtlasRelationshipType   relationshipType   = typeRegistry.getRelationshipTypeByName(relationshipTypeName);
  String                  ret                = relationshipType.getRelationshipDef().getRelationshipLabel();
  AtlasRelationshipEndDef endDef1            = relationshipType.getRelationshipDef().getEndDef1();
  AtlasRelationshipEndDef endDef2            = relationshipType.getRelationshipDef().getEndDef2();
  Set<String>             fromVertexTypes    = getTypeAndAllSuperTypes(AtlasGraphUtilsV2.getTypeName(fromVertex));
  Set<String>             toVertexTypes      = getTypeAndAllSuperTypes(AtlasGraphUtilsV2.getTypeName(toVertex));
  AtlasAttribute          attribute          = null;
  // validate entity type and all its supertypes contains relationshipDefs end type
  // e.g. [hive_process -> hive_table] -> [Process -> DataSet]
  if (fromVertexTypes.contains(endDef1.getType()) && toVertexTypes.contains(endDef2.getType())) {
    String attributeName = endDef1.getName();
    attribute = relationshipType.getEnd1Type().getRelationshipAttribute(attributeName);
  } else if (fromVertexTypes.contains(endDef2.getType()) && toVertexTypes.contains(endDef1.getType())) {
    String attributeName = endDef2.getName();
    attribute = relationshipType.getEnd2Type().getRelationshipAttribute(attributeName);
  }
  if (attribute != null) {
    ret = attribute.getRelationshipEdgeLabel();
  }
  return ret;
}
origin: apache/incubator-atlas

@Override
public void resolveReferencesPhase2(AtlasTypeRegistry typeRegistry) throws AtlasBaseException {
  super.resolveReferencesPhase2(typeRegistry);
  AtlasRelationshipEndDef endDef1           = relationshipDef.getEndDef1();
  AtlasRelationshipEndDef endDef2           = relationshipDef.getEndDef2();
  String                  relationshipLabel = null;
  // if legacyLabel is not specified at both ends, use relationshipDef name as relationship label.
  // if legacyLabel is specified in any one end, use it as the relationship label for both ends (legacy case).
  // if legacyLabel is specified at both ends use the respective end's legacyLabel as relationship label (legacy case).
  if (!endDef1.getIsLegacyAttribute() && !endDef2.getIsLegacyAttribute()) {
    relationshipLabel = relationshipDef.getRelationshipLabel();
  } else if (endDef1.getIsLegacyAttribute() && !endDef2.getIsLegacyAttribute()) {
    relationshipLabel = getLegacyEdgeLabel(end1Type, endDef1.getName());
  } else if (!endDef1.getIsLegacyAttribute() && endDef2.getIsLegacyAttribute()) {
    relationshipLabel = getLegacyEdgeLabel(end2Type, endDef2.getName());
  }
  addRelationshipAttributeToEndType(endDef1, end1Type, end2Type.getTypeName(), typeRegistry, relationshipLabel);
  addRelationshipAttributeToEndType(endDef2, end2Type, end1Type.getTypeName(), typeRegistry, relationshipLabel);
  // add relationship edge direction information
  addRelationshipEdgeDirection();
}
origin: org.apache.atlas/atlas-intg

@Override
void resolveReferencesPhase2(AtlasTypeRegistry typeRegistry) throws AtlasBaseException {
  super.resolveReferencesPhase2(typeRegistry);
  AtlasRelationshipEndDef endDef1           = relationshipDef.getEndDef1();
  AtlasRelationshipEndDef endDef2           = relationshipDef.getEndDef2();
  String                  relationshipLabel = null;
  // if legacyLabel is not specified at both ends, use relationshipDef name as relationship label.
  // if legacyLabel is specified in any one end, use it as the relationship label for both ends (legacy case).
  // if legacyLabel is specified at both ends use the respective end's legacyLabel as relationship label (legacy case).
  if (!endDef1.getIsLegacyAttribute() && !endDef2.getIsLegacyAttribute()) {
    relationshipLabel = relationshipDef.getRelationshipLabel();
  } else if (endDef1.getIsLegacyAttribute() && !endDef2.getIsLegacyAttribute()) {
    relationshipLabel = getLegacyEdgeLabel(end1Type, endDef1.getName());
  } else if (!endDef1.getIsLegacyAttribute() && endDef2.getIsLegacyAttribute()) {
    relationshipLabel = getLegacyEdgeLabel(end2Type, endDef2.getName());
  }
  addRelationshipAttributeToEndType(endDef1, end1Type, end2Type.getTypeName(), typeRegistry, relationshipLabel);
  addRelationshipAttributeToEndType(endDef2, end2Type, end1Type.getTypeName(), typeRegistry, relationshipLabel);
  // add relationship edge direction information
  addRelationshipEdgeDirection();
}
org.apache.atlas.model.typedefAtlasRelationshipDefgetRelationshipLabel

Popular methods of AtlasRelationshipDef

  • getEndDef1
  • getEndDef2
  • <init>
  • getPropagateTags
  • getName
  • getRelationshipCategory
  • toString
  • getGuid
  • setAttributeDefs
  • setEndDef1
  • setEndDef2
  • setPropagateTags
  • setEndDef2,
  • setPropagateTags,
  • setRelationshipCategory

Popular in Java

  • Making http requests using okhttp
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Reference (javax.naming)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now