use of org.apache.atlas.repository.graphdb.AtlasSchemaViolationException in project atlas by apache.
the class AtlasJanusGraph method addEdge.
@Override
public AtlasEdge<AtlasJanusVertex, AtlasJanusEdge> addEdge(AtlasVertex<AtlasJanusVertex, AtlasJanusEdge> outVertex, AtlasVertex<AtlasJanusVertex, AtlasJanusEdge> inVertex, String edgeLabel) {
try {
Vertex oV = outVertex.getV().getWrappedElement();
Vertex iV = inVertex.getV().getWrappedElement();
Edge edge = oV.addEdge(edgeLabel, iV);
return GraphDbObjectFactory.createEdge(this, edge);
} catch (SchemaViolationException e) {
throw new AtlasSchemaViolationException(e);
}
}
use of org.apache.atlas.repository.graphdb.AtlasSchemaViolationException in project incubator-atlas by apache.
the class TypedInstanceToGraphMapper method addOrUpdateAttributesAndTraits.
private List<String> addOrUpdateAttributesAndTraits(Operation operation, List<ITypedReferenceableInstance> instances) throws AtlasException {
List<String> guids = new ArrayList<>();
for (ITypedReferenceableInstance instance : instances) {
try {
// new vertex, set all the properties
String guid = addOrUpdateAttributesAndTraits(operation, instance);
guids.add(guid);
} catch (AtlasSchemaViolationException e) {
throw new EntityExistsException(instance, e);
}
}
return guids;
}
use of org.apache.atlas.repository.graphdb.AtlasSchemaViolationException in project incubator-atlas by apache.
the class Titan1Graph method addEdge.
@Override
public AtlasEdge<Titan1Vertex, Titan1Edge> addEdge(AtlasVertex<Titan1Vertex, Titan1Edge> outVertex, AtlasVertex<Titan1Vertex, Titan1Edge> inVertex, String edgeLabel) {
try {
Vertex oV = outVertex.getV().getWrappedElement();
Vertex iV = inVertex.getV().getWrappedElement();
Edge edge = oV.addEdge(edgeLabel, iV);
return GraphDbObjectFactory.createEdge(this, edge);
} catch (SchemaViolationException e) {
throw new AtlasSchemaViolationException(e);
}
}
Aggregations