use of org.apache.atlas.repository.graphdb.AtlasVertexQuery in project atlas by apache.
the class GraphHelper method getClassificationEdges.
public static List<AtlasEdge> getClassificationEdges(AtlasVertex entityVertex, Boolean propagated) {
List<AtlasEdge> ret = new ArrayList<>();
AtlasVertexQuery query = entityVertex.query().direction(AtlasEdgeDirection.OUT).label(CLASSIFICATION_LABEL);
if (propagated != null) {
query = query.has(CLASSIFICATION_EDGE_IS_PROPAGATED_PROPERTY_KEY, propagated);
}
Iterable edges = query.edges();
if (edges != null) {
Iterator<AtlasEdge> iterator = edges.iterator();
while (iterator.hasNext()) {
AtlasEdge edge = iterator.next();
if (edge != null) {
ret.add(edge);
}
}
}
return ret;
}
use of org.apache.atlas.repository.graphdb.AtlasVertexQuery in project atlas by apache.
the class GraphHelper method getTraitNames.
public static List<String> getTraitNames(AtlasVertex entityVertex, Boolean propagated) {
List<String> ret = new ArrayList<>();
AtlasVertexQuery query = entityVertex.query().direction(AtlasEdgeDirection.OUT).label(CLASSIFICATION_LABEL);
if (propagated != null) {
query = query.has(CLASSIFICATION_EDGE_IS_PROPAGATED_PROPERTY_KEY, propagated);
}
Iterable edges = query.edges();
if (edges != null) {
Iterator<AtlasEdge> iterator = edges.iterator();
while (iterator.hasNext()) {
AtlasEdge edge = iterator.next();
ret.add(AtlasGraphUtilsV1.getProperty(edge, CLASSIFICATION_EDGE_NAME_PROPERTY_KEY, String.class));
}
}
return ret;
}
Aggregations