public TitanLabel makeEdgeLabel(EdgeLabelDefinition definition) { verifyOpen(); TitanLabelVertex label = new TitanLabelVertex(this, temporaryID.decrementAndGet(), ElementLifeCycle.New); addProperty(label, SystemKey.TypeName, definition.getName()); addProperty(label, SystemKey.RelationTypeDefinition, definition); addProperty(label, SystemKey.TypeClass, TitanTypeClass.LABEL); graph.assignID(label); vertexCache.add(label, label.getID()); typeCache.put(definition.getName(), label); return label; }
public TitanKey makePropertyKey(PropertyKeyDefinition definition) { verifyOpen(); TitanKeyVertex prop = new TitanKeyVertex(this, temporaryID.decrementAndGet(), ElementLifeCycle.New); addProperty(prop, SystemKey.TypeName, definition.getName()); addProperty(prop, SystemKey.PropertyKeyDefinition, definition); addProperty(prop, SystemKey.TypeClass, TitanTypeClass.KEY); graph.assignID(prop); Preconditions.checkArgument(prop.getID() > 0); vertexCache.add(prop, prop.getID()); typeCache.put(definition.getName(), prop); return prop; }